[Libav-user] Hang on reading multicast

Andrey Utkin andrey.krieger.utkin at gmail.com
Tue Nov 1 17:42:23 CET 2011


Hi.
I notice that reading the source stream from multicast socket is
unstable, especially on high CPU load. In such case read operation
stucks.
When i connect to process with gdb, it shows the backtrace shown below.
Of course, it does not states that the process is waiting forever in
select(), it does step, but it never ends loop and never exits
av_read_packet.
I just give to avformat_open_input an url like udp://224.0.0.1:1234.
I tried also like udp://224.0.0.1:1234?fifo_size=0, and it works.
Could my observation be wrong? Is this issue known? What can be roots,
so we can improve ffmpeg libs?
I'm ready to provide server hardware/software info, and to test trial
patches on the issue.

P. S. libav fork is stable regarding this issue.

P. P. S. I use ffmpeg git HEAD: c881df330d46ccc573c7239f5b704fd2eb634574

(gdb) bt
#0  0x00007fdc195aef13 in select () from /lib64/libc.so.6
#1  0x00007fdc19bf5b94 in udp_read (h=0x1ef4070, buf=0x1f04940
"G\037\377\020", size=1472)
    at libavformat/udp.c:565
#2  0x00007fdc19b2826e in retry_transfer_wrapper (h=0x1ef4070,
buf=0x1f04940 "G\037\377\020",
    size=1472, size_min=1, transfer_func=0x7fdc19bf59de <udp_read>) at
libavformat/avio.c:269
#3  0x00007fdc19b28371 in ffurl_read (h=0x1ef4070, buf=0x1f04940
"G\037\377\020", size=1472)
    at libavformat/avio.c:295
#4  0x00007fdc19b2a0fb in fill_buffer (s=0x1f04f10) at libavformat/aviobuf.c:568
#5  0x00007fdc19b2a447 in avio_read (s=0x1f04f10, buf=0x7fffe835fd80
"G\037\377\020", size=188)
    at libavformat/aviobuf.c:657
#6  0x00007fdc19b8df5d in read_packet (s=0x1ef41f0, buf=0x7fffe835fd80
"G\037\377\020",
    raw_packet_size=188) at libavformat/mpegts.c:1427
#7  0x00007fdc19b8e15e in handle_packets (ts=0x1f04fb0, nb_packets=0)
at libavformat/mpegts.c:1483
#8  0x00007fdc19b8eabc in mpegts_read_packet (s=0x1ef41f0, pkt=0x7fffe835ff40)
    at libavformat/mpegts.c:1704
#9  0x00007fdc19bf7b6d in av_read_packet (s=0x1ef41f0,
pkt=0x7fffe835ff40) at libavformat/utils.c:744
#10 0x00007fdc19bf9654 in read_frame_internal (s=0x1ef41f0, pkt=0x7fffe83600d0)
    at libavformat/utils.c:1220
#11 0x00007fdc19bf9e05 in av_read_frame (s=0x1ef41f0,
pkt=0x7fffe83600d0) at libavformat/utils.c:1344
#12 0x0000000000403511 in main (argc=10, argv=0x7fffe85603e8) at
transcoder.c:406
(gdb)



-- 
Andrey Utkin


More information about the Libav-user mailing list