[MEncoder-users] problem with h264/aac .mp4

Alex Samad alex at samad.com.au
Wed Jun 11 09:20:28 CEST 2008


On Tue, Jun 10, 2008 at 11:02:29PM -0500, James Hastings-Trew wrote:
> Alex Samad wrote:
> > Hi
> >
> > I have encoded some mpg to mp4 with 
> > nice mencoder -really-quiet  -aspect 16:9    -vf

[snip]

> > and the picture goes all crappy and eventually come good
> >
> > what am missing / I doing wrong ?
> >
> >
> > alex
> >   
> A few problems:
> Your video bitrate is improbably low, unless you are doing really tiny 
> files. Try increasing it to 800 or more.

I started at 1200 and worked down to 200 which for the sources I have
seems to be okay, I am keeping the originals, the re encoded ones are
for the serving over the web.

> 
> You have to specify the frame rate of the video stream to mp4box. Raw 
> h.264 streams contain no information about framerate.

bugger I missed that in the cut and paste, I do actually set the -fps


> 
> You have a lot of options in your -x264encodeopts that you might not 
> understand why you are using them, yet you don't specify the idc_level. 
I have tried to glean what I can from the mailing list and the web site,
and what other people have said has worked well for them. I also looked
the x624enc script and took one of the profile setup from there.

I have to admit I have not knowledge of using level_idc, my target that
I am aiming for is to be able to play on the quicktime player, reason
for bframes=1, not sure what to set level_idc for this would be (a quick
google tells me the default 21 should be okay as my target size qpal)


> Try sticking to the basics first, get things working, and then tinker 
> with the extra options later. I use:
> 
> //pass 1
> -x264encopts 
> bitrate=2500:vbv_maxrate=5000:vbv_bufsize=1200:bframes=3:nocabac:nofast_pskip:frameref=1:subq=1:level_idc=31:threads=auto:pass=1:turbo
> //pass 2
> -x264encopts 
> bitrate=2500:vbv_maxrate=5000:vbv_bufsize=1200:bframes=3:partitions=all:me=umh:nocabac:nofast_pskip:frameref=6:subq=6:level_idc=31:threads=auto:pass=2
> 
> Or, if you don't really care about peak bitrate or filesize, and want to 
> do it in one pass:
> // one pass
> -x264encopts 
> qp=20:bframes=3:nocabac:nofast_pskip:frameref=6:subq=6:me=umh:level_idc=31:threads=auto

my target is small file size, I am happy with the output currently

> 
> (these are all widely compatible settings for ps3, xbox 360, appletv, etc.)
> 
> Once you get that working, then you can start adding in those other 
> options and see if they help or hinder the process. Cabac in particular 
> can really help file size and quality, at the expense of being more CPU 
> heavy when decoding the video.
> 
> I've found that mp4box does a crappy job of extracting the video and 
> audio streams. Try this:
> 
> Encode as you have been but instead of encoding the audio to aac, encode 
> it to pcm.
> 
> // extract video
> mencoder temp.avi -of rawvideo -nosound -ovc copy -o temp_video.h264
> // extract audio
> mplayer temp.avi -vc null -vo null -ao pcm:fast
> // encode audio
> neroaacenc -lc -br 160000 -if audiodump.wav -of temp_audio.m4a
> // mux in mp4
> mp4box -add temp_video.h264 -add temp_audio.m4a -fps 23.976 -tmp 
> /temp/user/1000/ MyMP4.mp4


I will give that a go

> 
> _______________________________________________
> MEncoder-users mailing list
> MEncoder-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
> 

-- 
"I think it's important to bring somebody from outside the system, the judicial system, somebody that hasn't been on the bench and, therefore, there's not a lot of opinions for people to look at."

	- George W. Bush
10/04/2005
Washington, DC
On the nomination of Harriet Miers to the Supreme Court
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mencoder-users/attachments/20080611/760fbb06/attachment.pgp>


More information about the MEncoder-users mailing list