[MEncoder-users] Encodes for slow laptop

Stella-Terra Clemens stellaterraclemens at gmail.com
Sat Jun 14 04:30:20 CEST 2008


> The best way to ensure AV synch is to encode the audio at the same time
> as the video.
> You could do the following (I won't mess with too many of your settings):
>
> #pass 1
> mencoder ${IN_FILE} -o /dev/null -ofps ${FPS} -aid ${AID} -oac pcm
> -channels 2 -srate 48000 -vf
> ${VF_FRAMECONVERT}crop=${CROP},softskip,scale=${SCALE},harddup -ovc x264
> -x264encopts
>
> pass=1:bitrate=${BITRATE}:turbo=2:me=umh:me_range=24:nodct_decimate:nointerlaced:8x8dct:nofast_pskip:trellis=1:partitions=none:mixed_refs:bime:keyint=240:keyint_min=24:frameref=4:bframes=16:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=6:brdo:chroma_me:nocabac:nodeblock:nossim:nopsnr:threads=auto
>
>
> #pass 2
> mencoder ${IN_FILE} -o temp.avi -ofps ${FPS} -aid ${AID} -oac pcm
> -channels 2 -srate 48000 -vf
> ${VF_FRAMECONVERT}crop=${CROP},softskip,scale=${SCALE},harddup -of avi
> -noodml -ovc x264 -x264encopts
>
> pass=2:bitrate=${BITRATE}:me=umh:me_range=24:nodct_decimate:nointerlaced:8x8dct:nofast_pskip:trellis=1:partitions=none:mixed_refs:keyint=240:keyint_min=24:frameref=4:bframes=16:bime:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=6:brdo:chroma_me:nocabac:nodeblock:nossim:nopsnr:threads=auto
>
> #extract video
> mencoder -o movie.264 -ovc copy -nosound -of rawvideo temp.avi
>
> #extract audio
> mplayer temp.avi -ao pcm:fast:waveheader:file=audio${AID}.wav -vc null
> -vo null
>
> #encode audio
> oggenc audio${AID}.wav
>
> #mux
> mkvmerge --title "${TITLE}" -o ${OUT_FILE} --default-duration
> 0:${FPS}fps movie.264 audio${AID}.ogg
>
> I'll just add in passing that 16 is a LOT of b-frames. Try something
> more reasonable, like a number between 3 and 6. The more bframes your
> stream has, the larger the buffers required to decode the video. You can
> also speed up the first pass by reducing the frameref and subq values to
> 1 without really hurting the final encode too much. I'm actually a
> little curious where you got your 264 options from because they look a
> bit unusual to me.
>
> _______________________________________________
> MEncoder-users mailing list
> MEncoder-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
>

Ok, I took your code and tried it out.  Unfortunately, it had the exact same
results (every movie but the matrix has a 200 ms audio delay.)  Could this
be a bug, or maybe a settings mismatch?  Maybe I simply need to mux every
video with a 200 ms audio delay.  That doesn't seem right, though.  Any
ideas?
Stella



More information about the MEncoder-users mailing list