Discussion:
[MPlayer-users] problem with Too many audio packets in the buffer
Philip Walden
2011-03-22 22:04:58 UTC
Permalink
I am trying to use mencoder as as transcoder for a minidlna. Basically
mencoder get called to transcode the source video into mpeg2 DVD format.
This works great except for some mp4 files I download from PBS.org.
Other mp4/flv work fine. When I transcode these I get the "Too many
audio packets in the buffer" error and it stops. I understand that one
can encode the video and audio separately and then remux them in a
second step, but the transcoder has to do it in one step.

If use ffmpeg to transcode, I have no problems. However, ffmpeg seems to
be 2-3x slower on my system and I have trouble with some files that are
very HD or have lots of noise/artifacts causing the bitrate to spike.

If anyone can suggest a different set of prarmeters I would appreciate
the help. Here is the failing run. Dropping the harddup causes huge A/V
sync issues. I have a Intel i3 3 GHz and 2GB of memory, so I don't think
lack of machine resources is a problem.

$ 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 NOSN_CanWeMakeItToMars.mp4
MEncoder SVN-r31628-4.4.4 (C) 2000-2010 MPlayer Team
success: format: 0 data: 0x0 - 0x1135caeb
libavformat file format detected.
[flv @ 0x9ebcdd0] Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0
VIDEO: [H264] 512x288 0bpp 15.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44 fourcc:0x34363248 size:512x288 fps:15.000 ftime:=0.0667
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
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: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
[ac3 @ 0x9fecd50] 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 1.78:1 - prescaling to correct movie aspect..000 [0:0]
[swscaler @ 0xa06b0a0] BICUBIC scaler, from yuv420p to yuv420p using MMX2
videocodec: libavcodec (720x480 fourcc=3267706d [mpg2])
[VE_LAVC] Using constant qscale = 1.000000 (VBR).
Writing header...
INITV: 0.200, 0.167, fps: 29.970
Pos: 95.7s 2868f ( 6%) 154.90fps Trem: 4min 1082mb A-V:0.000
[5747:128]
Too many audio packets in the buffer: (4096 in 3776561 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

Flushing video frames.
Writing index...

Overhead: 1.397% (940131 / 67305373)
Writing header...

Video stream: 5747.125 kbit/s (718390 B/s) size: 68722852 bytes
95.662 secs 2868 frames

Audio stream: 128.000 kbit/s (16000 B/s) size: 1537024 bytes 96.064 secs
[***@walden8 NovaScienceNow]$ mencoder -demuxer help
MEncoder SVN-r31628-4.4.4 (C) 2000-2010 MPlayer Team
No file given

Exiting... (error parsing command line)
--
Linuxfest Northwest - Apr 30-May 1, 2011
<http://www.linuxfestnorthwest.org/>
Carl Eugen Hoyos
2011-03-23 05:17:07 UTC
Permalink
Post by Philip Walden
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
Philip Walden
2011-03-23 20:09:01 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Philip Walden
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/>
Reimar Döffinger
2011-03-23 20:27:40 UTC
Permalink
Post by Philip Walden
MEncoder SVN-r31628-4.4.4 (C) 2000-2010 MPlayer Team
Please try a newer version, this one is several thousand revisions
old (not including FFmpeg revisions), and one of the changes was
a modification to audio sync handling which the author actually
claimed to fix all the "remaining sync issues" he had.
I suspect that's more because he was lucky than because the code
is now "perfect" but still it should be worth a try.
Philip Walden
2011-03-23 23:17:31 UTC
Permalink
Post by Reimar Döffinger
Post by Philip Walden
MEncoder SVN-r31628-4.4.4 (C) 2000-2010 MPlayer Team
Please try a newer version, this one is several thousand revisions
old (not including FFmpeg revisions), and one of the changes was
a modification to audio sync handling which the author actually
claimed to fix all the "remaining sync issues" he had.
I suspect that's more because he was lucky than because the code
is now "perfect" but still it should be worth a try.
_______________________________________________
Thank you for the quick reply. I downloaded the latest SVN version of
mplayer and built it. I can see the newer SVN-r33098-4.5.1 header in the
output. I also see it is using ffaac instead of faad.

Unfortunately it has the same "Too many audio packets error". It also
seems to fail at 63 seconds into the video whereas the older version
failed at 95 seconds. Here is the output:

$ 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 NOSN_CanWeMakeItToMars.mp4
MEncoder SVN-r33098-4.5.1 (C) 2000-2011 MPlayer Team
success: format: 0 data: 0x0 - 0x1135caeb
libavformat file format detected.
[flv @ 0x8ff5a00] Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0
VIDEO: [H264] 512x288 0bpp 15.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44 fourcc:0x34363248 size:512x288 fps:15.000 ftime:=0.0667
==========================================================================
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))
==========================================================================
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: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
[ac3 @ 0x889d7c0]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.
Pos: 0.0s 1f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.000 [0:0]
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
[swscaler @ 0x8945d40]BICUBIC scaler, from yuv420p to yuv420p using MMX2
videocodec: libavcodec (720x480 fourcc=3267706d [mpg2])
[VE_LAVC] Using constant qscale = 1.000000 (VBR).
Writing header...
INITV: 0.200, 0.167, fps: 29.970
Pos: 63.6s 1907f ( 4%) 132.43fps Trem: 5min 903mb A-V:0.000 [5587:127]

Too many audio packets in the buffer: (4096 in 3776466 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

Flushing video frames.
Writing index...

Overhead: 1.426% (558109 / 39130083)
Writing header...

Video stream: 5587.745 kbit/s (698468 B/s) size: 44420388 bytes
63.597 secs 1907 frames

Audio stream: 128.000 kbit/s (16000 B/s) size: 1024000 bytes 64.000 secs
--
Linuxfest Northwest - Apr 30-May 1, 2011
<http://www.linuxfestnorthwest.org/>
Reimar Döffinger
2011-03-24 07:06:23 UTC
Permalink
Post by Reimar Döffinger
Post by Philip Walden
MEncoder SVN-r31628-4.4.4 (C) 2000-2010 MPlayer Team
Please try a newer version, this one is several thousand revisions
old (not including FFmpeg revisions), and one of the changes was
a modification to audio sync handling which the author actually
claimed to fix all the "remaining sync issues" he had.
I suspect that's more because he was lucky than because the code
is now "perfect" but still it should be worth a try.
_______________________________________________
Thank you for the quick reply. I downloaded the latest SVN version of mplayer and built it. I can see the newer SVN-r33098-4.5.1 header in the output. I also see it is using ffaac instead of faad.
$ 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 NOSN_CanWeMakeItToMars.mp4
Sorry for not noticing before, but unfortunately encoding to AC3 is broken ever since the encoder was changed to use float input.
I also get really bad audio quality in addition to sync issues.
Reimar Döffinger
2011-03-24 07:25:34 UTC
Permalink
Post by Reimar Döffinger
Post by Reimar Döffinger
Post by Philip Walden
MEncoder SVN-r31628-4.4.4 (C) 2000-2010 MPlayer Team
Please try a newer version, this one is several thousand revisions
old (not including FFmpeg revisions), and one of the changes was
a modification to audio sync handling which the author actually
claimed to fix all the "remaining sync issues" he had.
I suspect that's more because he was lucky than because the code
is now "perfect" but still it should be worth a try.
_______________________________________________
Thank you for the quick reply. I downloaded the latest SVN version of mplayer and built it. I can see the newer SVN-r33098-4.5.1 header in the output. I also see it is using ffaac instead of faad.
$ 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 NOSN_CanWeMakeItToMars.mp4
Sorry for not noticing before, but unfortunately encoding to AC3 is broken ever since the encoder was changed to use float input.
I also get really bad audio quality in addition to sync issues.
Forgot: try acodec=ac3_fixed
Philip Walden
2011-03-24 16:27:50 UTC
Permalink
Post by Reimar Döffinger
Post by Reimar Döffinger
Post by Reimar Döffinger
Post by Philip Walden
MEncoder SVN-r31628-4.4.4 (C) 2000-2010 MPlayer Team
Please try a newer version, this one is several thousand revisions
old (not including FFmpeg revisions), and one of the changes was
a modification to audio sync handling which the author actually
claimed to fix all the "remaining sync issues" he had.
I suspect that's more because he was lucky than because the code
is now "perfect" but still it should be worth a try.
_______________________________________________
Thank you for the quick reply. I downloaded the latest SVN version of mplayer and built it. I can see the newer SVN-r33098-4.5.1 header in the output. I also see it is using ffaac instead of faad.
$ 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 NOSN_CanWeMakeItToMars.mp4
Sorry for not noticing before, but unfortunately encoding to AC3 is broken ever since the encoder was changed to use float input.
I also get really bad audio quality in addition to sync issues.
Forgot: try acodec=ac3_fixed
_______________________________________________
Using "acodec=ac3_fixed" Still fails with "Too many audio packets" at 95
seconds. It is now behaving just like the older version of mencoder.
Sounds like the ac3 encoder has a design problem.

I also tried using acodec=mp2 and had the same problem. Seems like the
problem is between the decoder and the encoder.

$ 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_fixed:abitrate=128:keyint=18
-subdelay 20000 -ofps 30000/1001 -mc 0 -noskip -af lavcresample=48000
-srate 48000 -o test.mpg NOSN_CanWeMakeItToMars.mp4
MEncoder SVN-r33098-4.5.1 (C) 2000-2011 MPlayer Team
success: format: 0 data: 0x0 - 0x1135caeb
libavformat file format detected.
[flv @ 0xae5ca10] Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0
VIDEO: [H264] 512x288 0bpp 15.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44 fourcc:0x34363248 size:512x288 fps:15.000 ftime:=0.0667
==========================================================================
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))
==========================================================================
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: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
[ac3_fixed @ 0x889d7c0]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.
Pos: 0.0s 1f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.000 [0:0]
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
[swscaler @ 0x8945d40]BICUBIC scaler, from yuv420p to yuv420p using MMX2
videocodec: libavcodec (720x480 fourcc=3267706d [mpg2])
Writing header...
INITV: 0.200, 0.167, fps: 29.970
Pos: 95.7s 2868f ( 6%) 167.22fps Trem: 4min 1072mb A-V:0.000
[5714:128]

Too many audio packets in the buffer: (4096 in 3776551 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

Flushing video frames.
Writing index...

Overhead: 1.388% (926354 / 66741614)
Writing header...

Video stream: 5714.923 kbit/s (714365 B/s) size: 68337786 bytes
95.662 secs 2868 frames

Audio stream: 128.000 kbit/s (16000 B/s) size: 1537024 bytes 96.064 secs
--
Linuxfest Northwest - Apr 30-May 1, 2011
<http://www.linuxfestnorthwest.org/>
Reimar Döffinger
2011-03-24 18:09:12 UTC
Permalink
Post by Philip Walden
$ 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_fixed:abitrate=128:keyint=18
-subdelay 20000 -ofps 30000/1001 -mc 0 -noskip -af
lavcresample=48000 -srate 48000 -o test.mpg
NOSN_CanWeMakeItToMars.mp4
Uh, have you tried without -mc 0 -noskip?
The combination of -ofps, re-encoding and this can't really work.
The only case where you should use these is
1) You use -ovc copy because that's not going to work without them
2) If for some reason it actually works better (should be quite rare).
Philip Walden
2011-03-24 18:53:42 UTC
Permalink
Post by Reimar Döffinger
Post by Philip Walden
$ 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_fixed:abitrate=128:keyint=18
-subdelay 20000 -ofps 30000/1001 -mc 0 -noskip -af
lavcresample=48000 -srate 48000 -o test.mpg
NOSN_CanWeMakeItToMars.mp4
Uh, have you tried without -mc 0 -noskip?
The combination of -ofps, re-encoding and this can't really work.
The only case where you should use these is
1) You use -ovc copy because that's not going to work without them
2) If for some reason it actually works better (should be quite rare).
Yes the encode completes if -mc 0 and -nokip are removed. However, they
were there at the suggestion of the man page:

"MPEG muxer (-mpegopts): The MPEG muxer can generate 5 types of
streams, each of which has reasonable default parameters that the user
can override. Generally, when generating MPEG files, it is advisable to
disable MEncoder's frame-skip code (see -noskip, -mc as well as the
harddup and softskip video filters)."

Honestly, I had thought I had tried removing these parameters earlier
and ran into severe A/V sync problems (video was 2x the audio) on these
files. However, I am not seeing these now. So I may stumble upon the
video that was giving problems earlier, but for now thanks for spotting
the problem. The man page is unclear in this area.
--
Linuxfest Northwest - Apr 30-May 1, 2011
<http://www.linuxfestnorthwest.org/>
Loading...