[MEncoder-users] Problems generating MP4 files

Mario Rossi mariofutire at googlemail.com
Wed Jan 24 22:29:18 CET 2007


I'm trying to generate MP4 files with mencoder with the following command

mencoder mobile2.avi -oac faac -ovc lavc -lavcopts vcodec=mpeg4 -of
lavf -lavfopts format=mp4:i_certify_that_my_video_stream_does_not_use_b_frames
-o mobile.mp4

The output file can play in mencoder but fails to play in ffplay and
in the iPod.

This is the output of MEncoder
[andrea at thinkpad rip]$ sh ../men2mp4
MEncoder dev-SVN-r21977-4.1.1 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) M processor 1500MHz (Family: 6, Model: 9, Stepping: 5)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

success: format: 0  data: 0x0 - 0x17649a54
AVI file format detected.
VIDEO:  []  720x576  24bpp  25.000 fps  4887.8 kbps (596.7 kbyte/s)
[V] filefmt:3  fourcc:0x10000002  size:720x576  fps:25.00  ftime:=0.0400
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
==========================================================================
** MUXER_LAVF *****************************************************************
You have certified that your video stream does not contain B frames.
REMEMBER: MEncoder's libavformat muxing is presently broken and will generate
INCORRECT files in the presence of B frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!
*******************************************************************************
OK, exit
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 576 (preferred colorspace: Mpeg PES)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
Try adding the scale filter, e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
==========================================================================
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
videocodec: libavcodec (720x576 fourcc=34504d46 [FMP4])
VIDEO CODEC ID: 13f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.004 [0:0]
AUDIO CODEC ID: 15002, TAG: 0
Writing header...

1 duplicate frame(s)!
Pos:   0.8s     22f ( 0%)  0.00fps Trem:   8min 141mb  A-V:0.082 [0:129]
Skipping frame!
Pos:  12.6s    316f ( 2%) 35.90fps Trem:   5min  63mb  A-V:0.074 [912:127]]
Flushing video frames.
Writing index...

Video stream:  912.388 kbit/s  (114048 B/s)  size: 1432449 bytes
12.560 secs  316 frames

Audio stream:  127.719 kbit/s  (15964 B/s)  size: 208097 bytes  13.035 secs

This is part of the output of ffplay

[aac @ 0xb7d67e64]faac: codec init failed: No error
[aac @ 0xb7d67e64]faac: codec init failed: No error
[aac @ 0xb7d67e64]faac: codec init failed: No error
[aac @ 0xb7d67e64]faac: codec init failed: No error
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'mobile.mp4':
  Duration: 00:02:00.0, start: 0.000000, bitrate: 942 kb/s
  Stream #0.0(und): Video: mpeg4, yuv420p, 720x576, 25.00 fps(r)
  Stream #0.1(und): Audio: aac
[aac @ 0xb7d67e64]faac: codec init failed: No error    0B
[aac @ 0xb7d67e64]faac: codec init failed: No error
[aac @ 0xb7d67e64]faac: codec init failed: No error
[aac @ 0xb7d67e64]faac: codec init failed: No error

While if I generate the file using ffmpeg everything works fine

ffmpeg -i XXX.avi -f mp4 -vcodec mpeg4 -acodec aac mobile2.mp4

I've read on the Internet that it is not possible to generate good MP4
files using MEncoder and everybody suggests to use ffmpeg.
Is it true?

I find MEncoder much more powerful in the fact that it can handle more
kind of input files.

This is the version of ffmpeg I've used

FFmpeg version SVN-r7659, Copyright (c) 2000-2006 Fabrice Bellard, et al.
  configuration:  --enable-mp3lame --enable-libogg --enable-vorbis
--enable-xvid --enable-x264 --enable-gpl --enable-pp --enable-shared
--disable-ipv6 --enable-pthreads --enable-faac --enable-faad
--enable-a52 --enable-dts
  libavutil version: 49.2.0
  libavcodec version: 51.29.0
  libavformat version: 51.8.0
  built on Jan 23 2007 10:48:24, gcc: 4.1.1 20060525 (Red Hat 4.1.1-1)

Thanks



More information about the MEncoder-users mailing list