[MPlayer-users] problem with Too many audio packets in the buffer

Philip Walden pwaldenlinux at comcast.net
Wed Mar 23 21:09:01 CET 2011


Carl Eugen Hoyos wrote:
> Philip Walden<pwaldenlinux<at>  comcast.net>  writes:
>
>    
>> If use ffmpeg to transcode, I have no problems. However, ffmpeg seems to
>> be 2-3x slower on my system
>>      
> This is not possible due to the audio decoder you are using with mencoder (faad
> is significantly slower than ffaac).
> It is of course possible to pass options to mencoder and ffmpeg to make ffmpeg
> slower (when mencoder is using FFmpeg to encoder audio and video, as in your
> command line) outputting better quality.
>
> (You did not clarify if the file you want to transcode plays fine with MPlayer).
>
> Carl Eugen
>    
Sorry to confuse two issues together:

1. mencoder fails on some mp4's with "Too many audio packets" while 
ffmpeg works.
2. thus I end up using ffmpeg, but ffmpeg is 2x slower on some other (HD 
mov qt) files.

WRT 1 - I only get the "Too many audio packets" error with mencoder on 
some mp4 files. ffmpeg produces a complete viewable transcode that works 
in mplayer. mencoder produces a 90 second fragment wherein the video 
runs 2x faster than the audio. So from your response, it sounds like 
ffmpeg is using ffaac succesfully and mencoder is using faad and 
failing. I added -afm ffmpeg to the mencoder command, which forced it to 
use ffaac, however it still fails with the "Too many audio packet" 
error. So there is some other reason that mencoder has the error and 
ffmpeg does not.

Here is the output fragment showing ffaac was used:

Trying to force audio codec driver family ffmpeg...
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->176400)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))

WRT 2 - mencoder and ffmpeg are roughly equal in fps transcoding 
performance most times except for some 1080i HD mov files I have. In 
this case, ffmpeg seems to be 2x slower. See the two runs below on a 
1080i to DVD conversion: mencoder completes at 52fps while ffmpeg runs 
at 27fps. Since the result is consumed in real-time at 30fps by my (Sony 
BDP) viewer, the ffmpeg causes a halting-jerky rendering on the viewer. 
Perhaps someone can spot why there is such a discrepancy.

Here is the mencoder run:

$ mencoder -oac lavc -of mpeg -mpegopts 
format=mpeg2:muxrate=25000:vbuf_size=1194:abuf_size=64 -vf 
scale=720:480,harddup -ovc lavc -lavdopts debug=0 -lavcopts 
autoaspect=1:vcodec=mpeg2video:vbitrate=8000:acodec=ac3:abitrate=128:keyint=18:vqscale=1:vqmin=2 
-subdelay 20000 -ofps 30000/1001 -mc 0 -noskip -af lavcresample=48000 
-srate 48000 -o test.mpg ksc_022411_sts133_launch_HD_1080i.mov
MEncoder SVN-r31628-4.4.4 (C) 2000-2010 MPlayer Team
success: format: 0  data: 0x0 - 0x933b5b4
libavformat file format detected.
[lavf] stream 0: video (svq3), -vid 0
[lavf] stream 1: audio (mp3), -aid 0, -alang eng
VIDEO:  [SVQ3]  1920x1080  32bpp  25.000 fps  7938.7 kbps (969.1 kbyte/s)
[V] filefmt:44  fourcc:0x33515653  size:1920x1080  fps:25.000  ftime:=0.0400
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
PACKET SIZE: 2048 bytes, deltascr: 17694
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
Opening video filter: [scale w=720 h=480]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffsvq3] vfm: ffmpeg (FFmpeg Sorenson Video v3 (SVQ3))
==========================================================================
[ac3 @ 0x99f3ca0] No channel layout specified. The encoder will guess 
the layout, but it might be incorrect.
Limiting audio preload to 0.4s.
Increasing audio density to 4.
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x99fd6a0] BICUBIC scaler, from yuv420p to yuv420p using MMX2
videocodec: libavcodec (720x480 fourcc=3267706d [mpg2])
[VE_LAVC] Using constant qscale = 1.000000 (VBR).
Writing header...1f ( 3%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
INITV: 0.200, 0.167, fps: 29.970
Pos: 126.6s   3796f (100%) 52.04fps Trem:   0min  59mb  A-V:0.000 [3805:128]
Flushing video frames.
Writing index...

Overhead: 1.501% (924108 / 61550132)
Writing header...

Video stream: 3805.182 kbit/s  (475647 B/s)  size: 60229612 bytes  
126.626 secs  3796 frames

Audio stream:  128.000 kbit/s  (15999 B/s)  size: 2032640 bytes  127.040 
secs

------------------------------------------------------------------------------------------------------------------------
Here is the ffmpeg run:

$ ffmpeg -i ksc_022411_sts133_launch_HD_1080i.mov -sameq -target 
ntsc-dvd test.mpg
FFmpeg version SVN-r24044, Copyright (c) 2000-2010 the FFmpeg developers
   built on Jul 21 2010 15:07:15 with gcc 4.5.0 20100716 (Red Hat 4.5.0-3)
   configuration: --prefix=/usr --bindir=/usr/bin 
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg 
--libdir=/usr/lib --mandir=/usr/share/man --arch=i686 
--extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom 
-fasynchronous-unwind-tables' --extra-version=rpmfusion --enable-bzlib 
--enable-libdc1394 --enable-libdirac --enable-libgsm --enable-libmp3lame 
--enable-libopenjpeg --enable-librtmp --enable-libschroedinger 
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx 
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter 
--enable-avfilter-lavf --enable-postproc --enable-pthreads 
--disable-static --enable-shared --enable-gpl --disable-debug 
--disable-stripping --shlibdir=/usr/lib --cpu=i686 
--enable-runtime-cpudetect
   libavutil     50.20. 0 / 50.20. 0
   libavcodec    52.79. 1 / 52.79. 1
   libavformat   52.73. 0 / 52.73. 0
   libavdevice   52. 2. 0 / 52. 2. 0
   libavfilter    1.20. 1 /  1.20. 1
   libswscale     0.11. 0 /  0.11. 0
   libpostproc   51. 2. 0 / 51. 2. 0

Seems stream 0 codec frame rate differs from container frame rate: 
600.00 (600/1) -> 25.00 (25/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
'ksc_022411_sts133_launch_HD_1080i.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 537199360
     compatible_brands: qt
   Duration: 00:02:31.86, start: 0.000000, bitrate: 8132 kb/s
     Stream #0.0(eng): Video: svq3, yuvj420p, 1920x1080, 7938 kb/s, 25 
fps, 25 tbr, 600 tbn, 600 tbc
     Stream #0.1(eng): Audio: mp3, 48000 Hz, 2 channels, s16
[scale @ 0x9384db0] w:1920 h:1080 fmt:yuvj420p -> w:720 h:480 
fmt:yuv420p flags:0x4
[ac3 @ 0x932f170] No channel layout specified. The encoder will guess 
the layout, but it might be incorrect.
Output #0, dvd, to 'test.mpg':
   Metadata:
     encoder         : Lavf52.73.0
     Stream #0.0(eng): Video: mpeg2video, yuv420p, 720x480, q=2-31, 6000 
kb/s, 90k tbn, 29.97 tbc
     Stream #0.1(eng): Audio: ac3, 48000 Hz, stereo, s16, 448 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
   Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 4550 fps= 27 q=0.0 Lsize=   65660kB time=151.78 
bitrate=3543.7kbits/s dup=754 drop=0
video:55748kB audio:8304kB global headers:0kB muxing overhead 2.511353%

-- 
Linuxfest Northwest - Apr 30-May 1, 2011 
<http://www.linuxfestnorthwest.org/>


More information about the MPlayer-users mailing list