[Libav-user] RTSP over TCP reading hangs

Юлия Шашкина julia.shashkina at gmail.com
Thu Sep 11 11:37:32 CEST 2014


Hi all,
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.
Code:
    AVFormatContext *context;
    AVDictionary *opts = 0;
    int ret;
    ...
    av_register_all();
    avformat_network_init();
    context = avformat_alloc_context();
    av_dict_set(&opts, "rtsp_transport", "tcp", 0);
    ret = avformat_open_input(&context, "rtsp://
10.125.248.169/720x480_frm_vlc_4mbs.264", NULL, &opts);
    ...
    ret = avformat_find_stream_info(context, NULL);
    ...
    while(true) {
        ret = av_read_frame(context, pkt);
        ...
        //do the video processing
        ...
    }

It hangs also if I replace the video processing on, f.e., 0,5 sec of sleep.
I use live555MediaServer for streaming.
How can I get rid of hang? Thanks ahead.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140911/bd12e8a4/attachment.html>


More information about the Libav-user mailing list