[MEncoder-users] Corrupt H264 Files with Mencoder

andreil1 at starlett.lv andreil1 at starlett.lv
Fri Sep 15 12:14:59 CEST 2006


On Sep 15, 2006, at 8:22, RC wrote:

>
>> I have wrote simple script which (supposedly) could convert almost  
>> any
>> video  file into high-quality H264 MP4/AAC.
>
> This looks extremely over-complicated.  mencoder can directly encode
> (from practically any source) to aac audio and h.264 video.  Why
> do you output to raw, encode audio seperately, etc.?

I had to encode audio separately because faad codec produced NO sound  
when used in conjunction with mencoder. I have no idea why.

>
>> 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
>
> You told x264 to use 3 b-frames, while lavf can't handle b-frames in
> the output (hence the long lavf option) so your file is surely broken.

I am was wrongly thinking that lavf cannot handle b-frames from  
stream being encoded.
I have changed x264 -x264encopts bframes=0, but it did not help -  
output MP4 file is still broken.


Anyone please could help to change my script so it will work with  
QuickTime Player (H264/AAC), and preferably convert any audio/video  
supported by mencoder into high-quality H264/AAC, may be even without  
extracting audio first.


mplayer $1 -vo null -ao pcm:file=$1.temp.wav; ffmpeg -i $1.temp.wav - 
acodec aac $1.temp.aac

mencoder $1 -oac copy -audiofile $1.temp.aac -of lavf -lavfopts  
format=mp4:i_certify_that_my_video_stream_does_not_use_b_frames -ovc  
x264 -x264encopts 4x4mv:subq=5:bframes=0:b_pyramid:weight_b -o  
$1.menc1p.mp4
rm -f $1.temp.*

Thanks in advance

Andrei


More information about the MEncoder-users mailing list