[MEncoder-users] Corrupt H264 Files with Mencoder

Corey Hickey bugfood-ml at fatooh.org
Thu Sep 14 23:50:10 CEST 2006


Andrei Verovski (aka MacGuru) wrote:
> Hi,
> 
> I have wrote simple script which (supposedly) could convert almost any video 
> file into high-quality H264 MP4/AAC.
> 
> Here it is:
> 
> Dump both audio and video in raw format (because lavf cannot hadnle video 
> streams with b-frames, and x264 can create only AVI, not MP4 container)
> mencoder $1 -ovc raw -nosound -o $1.temp.raw.avi

I don't think you need to do this. The_longest_option_in_the_world 
refers to the video stream being encoded, not the one being decoded.

> mplayer $1 -vo null -ao pcm:file=$1.temp.wav
> 
> Convert audio to AAC
> ffmpeg -i $1.temp.wav -acodec aac $1.temp.aac
> 
> Here is the final stage, converting raw video into H264 while muxing it with 
> AAC audio:
> mencoder $1.temp.raw.avi -audiofile $1.temp.aac -oac copy -of lavf -lavfopts 
> format=mp4:i_certify_that_my_video_stream_does_not_use_b_frames -ovc 
> x264 -x264encopts 4x4mv:subq=5:bframes=3:b_pyramid:weight_b -o $1.menc1p.mp4
> 
> Delete temp files.
> rm -f $1.temp.*
> 
> However, I can play these on Linux (in VLC/Xine),

VLC and Xine probably use libavcodec for H.264 and faad for AAC, just 
like MPlayer does.

> on Mac VLC plays it without sound,

There's no faad? That's just a guess; I have no idea otherwise.

> While QuickTime Player

QuickTime's H.264 support is limited. It doesn't support as many 
features as libavcodec and x264 do. A quick google search turned up this:

http://forum.doom9.org/showthread.php?t=102609

You can probably adapt that and/or find a different guide.

> and Windows Media Player cannot play them at all.

Does Microsoft even have an H.264 decoder? You can try ffdshow. Search 
google for ffdshow.

-Corey



More information about the MEncoder-users mailing list