<div dir="ltr"><div><div>Hi all,</div><div>I'm trying to read RTSP stream over TCP with H264. But after a while (after the several frames were read, it depends on stream), the reading hangs.</div><div>Code:</div><div> AVFormatContext *context;</div><div> AVDictionary *opts = 0;</div><div> int ret;</div><div> ...</div><div> av_register_all();</div><div> avformat_network_init();</div><div> context = avformat_alloc_context();</div><div> av_dict_set(&opts, "rtsp_transport", "tcp", 0);</div><div> ret = avformat_open_input(&context, "rtsp://<a href="http://10.125.248.169/720x480_frm_vlc_4mbs.264">10.125.248.169/720x480_frm_vlc_4mbs.264</a>", NULL, &opts);</div><div> ...</div><div> ret = avformat_find_stream_info(context, NULL);</div><div> ...</div><div> while(true) {</div><div> ret = av_read_frame(context, pkt);</div><div> ...</div><div> //do the video processing</div><div> ...</div><div> }</div><div><br></div><div>It hangs also if I replace the video processing on, f.e., 0,5 sec of sleep. I use live555MediaServer for streaming.<br></div><div>How can I get rid of hang? Thanks ahead.</div></div>
</div>