[MEncoder-users] Script for h264 conversion for mencoder

Cameron Just lists.mplayerhq.hu at spam.phoenixdigital.com
Mon Jan 21 01:17:54 CET 2008


Hi All,

Thankyou for your responses has cleared a few things up for me. My older
version of mencoder did not have aac and I stupidly thought ac3 was the
same.

It appears I cannot find a version of mencoder for win32 which has aac
working in it

Trying to run this
C:\System\Apps\MEncoder\mencoder.exe Test.mpg -sws 9 -of lavf -lavfopts
format=mp4 -vf crop=392:568:70:3,scale=400:304,dsize=400:304,harddup
-ovc x264 -x264encopts
bitrate=350:vbv_maxrate=1500:vbv_bufsize=1835:nocabac:me=umh:trellis=1:level_idc=41:global_header:threads=auto 

-oac faac -faacopts mpeg=4:object=2:br=160:raw -channels 2 -srate 48000
-o output.mp4

Gives me the following output
======================================
MEncoder 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 Processor 3200+ (Family: 15, Model: 47, Stepping: 0)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Error parsing option on the command line: -faacopts

Exiting... (error parsing command line)
======================================

I have tried a few versions from various locations on the net
http://oss.netfarm.it/mplayer-win32.php
and
http://www.mplayerhq.hu/design7/dload.html

However it appears aac is available because when I run
mencoder -oac help
I get
====================
MEncoder 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 Processor 3200+ (Family: 15, Model: 47, Stepping: 0)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.

Available codecs:
   copy     - frame copy, without re-encoding (useful for AC3)
   pcm      - uncompressed PCM audio
   mp3lame  - cbr/abr/vbr MP3 using libmp3lame
   lavc     - FFmpeg audio encoder (MP2, AC3, ...)
   twolame  - Twolame MP2 audio encoder
   faac     - FAAC AAC audio encoder
====================

Am I missing something critical here?

Also with regards to the 1:1 I am archiving video from a Series 1 Tivo
which is recording a 16:9 video format into 4:3 so I need to stretch it
back out again. I thought the scale had to be divisble by 8 my bad there
I will change it to divisible by 16.

And the bitrate is very low I know... I am just archiving things where
the content is more important (ie documentaries) I am not overly
concerned with picture quality... however I find that 350 is quite
reasonable plus it keeps the file sizes down quite a bit.

Thankyou again for all your assistance I appear to be almost there....


James Hastings-Trew wrote:
> Cameron Just wrote:
>> Hi,
>>
>> I have been trying and searching for the last two months to try and 
>> get mencoder to encode a file in the h264 format that works within 
>> the xbox360 media player but just can't seem to get it to work.
>>
>> I have googled and found something close in this list however I can't 
>> seem to contact the people who found a solution using ffmpeg
>> http://lists.mplayerhq.hu/pipermail/mencoder-users/2007-May/005957.html
>>
>> This is the current script I am using but it just wont play on the 360
>>
>> mencoder.exe input.avi -o NUL -passlogfile "2pass.log" -nosound -ovc 
>> x264 -x264encopts 
>> subq=4:bframes=4:b_pyramid:weight_b:pass=1:psnr:bitrate=350:turbo=1
>>
>> mencoder.exe "input.avi" -o "output.mp4" -aspect 16:9 -passlogfile 
>> "2pass.log"  -oac lavc -lavcopts acodec=ac3:abitrate=192 -ovc x264 
>> -x264encopts 
>> subq=5:4x4mv:8x8dct:frameref=3:me=2:bframes=4:b_pyramid:pass=2:psnr:bitrate=350 
>> -vf crop=392:568:70:3,scale=392:296
>>   
> A few things. Your scale is wrong - the dimensions have to be 
> divisible by 16. 392x296 isn't. 400x304 is. Then you have to use the 
> dsize video filter to set the pixel aspect ratio to 1:1. Your bitrate 
> is very very low - try at least 900 for that size of video. Also, from 
> what I can tell you are making an AVI file and calling it .mp4. You'll 
> need to specify the format container. But then you won't be able to 
> use b-frames, at all. So try this as a starting point:
>
> mencoder INPUT -sws 9 -of lavf -lavfopts format=mp4 -vf 
> crop=392:568:70:3,scale=400:304,dsize=400:304,harddup -ovc x264 
> -x264encopts 
> bitrate=900:vbv_maxrate=1500:vbv_bufsize=1835:nocabac:me=umh:trellis=1:level_idc=41:global_header:threads=auto 
> -oac faac -faacopts mpeg=4:object=2:br=160:raw -channels 2 -srate 
> 48000 -o output.mp4
>



More information about the MEncoder-users mailing list