Opened 4 years ago

Last modified 2 years ago

#1157 new defect

Circular buffer overrun with 4+ ffmpeg instances.

Reported by: Involar Owned by:
Priority: normal Component: undetermined
Version: 0.10.2 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hello, im trying to launch multiple transcoding instances on an i7 2600k. Now with 3 instaces everything is fine, but after 4th I get crashes with this error. CPU is at no more than 30% at the moment of crash. Memory ussage is about 500mb/4G. Here is the output.

ffmpeg -i udp://@239.1.1.2:5000 -pass 1 -crf 5 -vcodec libx264 -preset ultrafast -g 20 -b 500k -bt 10k -acodec libfaac -ab 128k -ar 48000 -ac 2 -f mpegts udp://192.168.1.136:5004 -v warning -bufsize 10000 -vframes 10
[mpeg2video @ 0x249da20] mpeg_decode_postinit() failure

Last message repeated 5 times

[mpegts @ 0x24733a0] max_analyze_duration 5000000 reached at 5016000
[mpegts @ 0x24733a0] Estimating duration from bitrate, this may be inaccurate
Please use -b:a or -b:v, -b is ambiguous
[udp @ 0x24738e0] Circular buffer overrun. To avoid, increase fifo_size URL option. To survive in such case, use overrun_nonfatal option
[mpegts @ 0x24733a0] PES packet size mismatch
[mpeg2video @ 0x249da20] ac-tex damaged at 31 4
[mpeg2video @ 0x249da20] Warning MVs not available
[mp2 @ 0x24a3be0] incomplete frame
Error while decoding stream #0:1.

Now I get it that my fifo buffer is too small to handle 4 instances. Can you please advise where can I change the initial value ?

Thanks in advance

Change History (6)

comment:1 Changed 4 years ago by Involar

Also, please note that with 3 instances i have no issues and they are stable.

comment:2 Changed 4 years ago by cehoyos

Please post complete, uncut console output.
Is the problem also reproducible with current git master?

Is this only reproducible with network output, or also if you output to a file?
Is this also reproducible if you do not encode at all, for example with -f null - ?
If encoding is needed, does not using external encoders like x264 and libfaac also allow to reproduce the problem?

comment:3 Changed 4 years ago by Involar

Hello,
I tested with a file output and i experienced no instability or crashing.
Any kind of streaming seems to get unstable with more instances of ffmpeg running.
I tried with mpegts and h264 muxers and the result was the same. My version is as follows :

ffmpeg -version
ffmpeg version git-2012-03-31-f9143d2
built on Mar 31 2012 23:08:54 with gcc 4.4.3
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab
libavutil 51. 44.100 / 51. 44.100
libavcodec 54. 12.100 / 54. 12.100
libavformat 54. 3.100 / 54. 3.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 66.101 / 2. 66.101
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 10.100 / 0. 10.100
libpostproc 52. 0.100 / 52. 0.100

ffmpeg -i udp://@239.1.1.2:5000 -pass 1 -crf 10 -vcodec libx264 -preset ultrafast -g 50 -b 500k -bt 100k -threads 0 -acodec libfaac -ab 128k -ar 48000 -ac 2 -async 1 -f mpegts udp://192.168.1.136:5000 -v verbose
ffmpeg version git-2012-03-31-f9143d2 Copyright (c) 2000-2012 the FFmpeg developers

built on Mar 31 2012 23:08:54 with gcc 4.4.3
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab
libavutil 51. 44.100 / 51. 44.100
libavcodec 54. 12.100 / 54. 12.100
libavformat 54. 3.100 / 54. 3.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 66.101 / 2. 66.101
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 10.100 / 0. 10.100
libpostproc 52. 0.100 / 52. 0.100

[mpegts @ 0x25a33a0] Unable to seek back to the start
[mpeg2video @ 0x25cda20] mpeg_decode_postinit() failure

Last message repeated 10 times

[mpegts @ 0x25a33a0] max_analyze_duration 5000000 reached at 5016000
[mpegts @ 0x25a33a0] Estimating duration from bitrate, this may be inaccurate
Input #0, mpegts, from 'udp://@239.1.1.2:5000':

Duration: N/A, start: 40354.983533, bitrate: 15192 kb/s
Program 100

Stream #0:0[0x1f7]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 15000 kb/s, 26.94 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1f8]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, 2 channels, s16, 192 kb/s

Please use -b:a or -b:v, -b is ambiguous
[buffer @ 0x26062a0] w:720 h:576 pixfmt:yuv420p tb:1/1000000 sar:16/15 sws_param:flags=2
[libx264 @ 0x29fcbe0] using SAR=16/15
[libx264 @ 0x29fcbe0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle? SSE4.2 AVX
[libx264 @ 0x29fcbe0] profile Constrained Baseline, level 3.0
[mpegts @ 0x2605c80] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, mpegts, to 'udp://192.168.1.136:5000':

Metadata:

encoder : Lavf54.3.100
Stream #0:0: Video: h264, yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=-1--1, pass 1, 500 kb/s, 90k tbn, 25 tbc
Stream #0:1: Audio: aac, 48000 Hz, 2 channels, s16, 128 kb/s

Stream mapping:

Stream #0:0 -> #0:0 (mpeg2video -> libx264)
Stream #0:1 -> #0:1 (mp2 -> libfaac)

Press [q] to stop, ? for help
* 21 dup!
Circular buffer overrun. To avoid, increase fifo_size URL option. To survive in such case, use overrun_nonfatal option
PES packet size mismatch.0 size= 276021kB time=00:02:16.28 bitrate=16592.1kbits/s dup=21 drop=0
[mpeg2video @ 0x25cda20] ac-tex damaged at 36 21
[mpeg2video @ 0x25cda20] Warning MVs not available
[mpeg2video @ 0x25cda20] concealing 675 DC, 675 AC, 675 MV errors
[mp2 @ 0x25d3be0] incomplete frame
Error while decoding stream #0:1
* 2 dup!
frame= 3431 fps= 24 q=-1.0 Lsize= 278340kB time=00:02:16.93 bitrate=16650.9kbits/s dup=23 drop=0
video:255602kB audio:2139kB global headers:0kB muxing overhead 7.991834%
[libx264 @ 0x29fcbe0] frame I:69 Avg QP: 6.86 size:188256
[libx264 @ 0x29fcbe0] frame P:3362 Avg QP: 9.83 size: 73988
[libx264 @ 0x29fcbe0] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0x29fcbe0] mb P I16..4: 4.5% 0.0% 0.0% P16..4: 84.2% 0.0% 0.0% 0.0% 0.0% skip:11.2%
[libx264 @ 0x29fcbe0] coded y,uvDC,uvAC intra: 95.9% 96.9% 93.9% inter: 72.9% 50.2% 36.3%
[libx264 @ 0x29fcbe0] i16 v,h,dc,p: 24% 34% 29% 13%
[libx264 @ 0x29fcbe0] i8c dc,h,v,p: 25% 39% 23% 13%
[libx264 @ 0x29fcbe0] kb/s:15257.17

comment:4 Changed 4 years ago by streamingguy

Any update on this ticket? I have the same issue with UDP streams pushing to network. If the source stream is H.264 (instead of MPEG-2), I can't even push single stream to the network.

comment:5 Changed 3 years ago by rogerdpack

this may mean your box or network is too slow. what if you increase fifo_size?

comment:6 Changed 2 years ago by hemanth.he

I'm also facing same issue.In my case i can run 6 channels, after starting 7th one it starts giving error.

Here is my system CPU usage for 6 channels.

Cpu(s): 39.0%us,  1.6%sy, 21.8%ni, 37.3%id,  0.0%wa,  0.0%hi,  0.4%si,  0.0%st
Mem:  32844180k total, 14477672k used, 18366508k free,    28748k buffers
Swap: 16490488k total,     7404k used, 16483084k free,  1222388k cached
Note: See TracTickets for help on using tickets.