[MEncoder-users] mencoder new 3 pass encoding

ivan sa at rtsystem.com
Thu Mar 3 09:40:41 CET 2005


hi all. im' trying to use the new 3 pass encoding, as described in the man page of mplayer 1.0pre6-3.3.5. 
<cite>
       vpass=<1-3>
              Activates internal two (or three) pass mode, only specify if you wish to  use  two
              (or three) pass encoding.
                 1    first pass (also see turbo)
                 2    second pass
                 3    Nth pass (second and third passes of three pass encoding)
              Here is how it works, and how to use it:
              The first pass (vpass=1) writes the stats file.  You might want to deactivate some
              CPU-hungry options, like "turbo" mode does.
              In two pass mode, the second pass (vpass=2) reads the stats file and  bases  rate-
              control decisions on it.
              In  three  pass  mode, the second pass (vpass=3, that is not a typo) does both: It
              first reads the stats, then  overwrites  them.   You  might  want  to  backup  di-
              vx2pass.log  before  doing  this if there is any possibility that you will have to
              cancel MEncoder.  You can use all encoding options, except very CPU-hungry options
              like "qns".
              The  third  pass  (vpass=3) is the same as the second pass, except that it has the
              second pass's stats to work from.  You can use  all  encoding  options,  including
              CPU-hungry ones.
</cite>

this is all the doc i can find. the questions are : 

1) does this method still need the step 
"mencoder -ovc frameno -o frameno.avi  .... " ? mencoder actually compliains about 
"File not found: 'frameno.avi Failed to open frameno.avi" but the process goes well. 

2) is "psnr" needed in all the passes ?

3) how many vpass=3 can i do ? the "man" says Nth, so i can refine the encoding "ad libitum", 
running the last pass 6 or 7 times. the cpu time is not a problem :)


this is my mencoder ( on debian sarge )
MPlayer 1.0pre6-3.3.5 (C) 2000-2004 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 9)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

this is the template script i use to encode, please review and comment :)
TIA
ivan


--------------- code starts here -----------------
#!/bin/sh
set -x

file_input=$1
file_output=${2:-$1}.mencoder.avi

echo "mencoding [$file_input] to [$file_output]"

rm -rf frameno.avi *log


# generali options for mencoder
me=" -noskip -mc 0 "
me=""

# options for the video filter
vf=" -vf crop=708:418:8:80,scale=656:352,hqdn3d " # modify this


# options for the audio filter
af=""

# audio enc
ac0=" mp3lame -lameopts preset=standard "
ac0="copy"

# options for libavcodec
lavc0="keyint=192:vbitrate=1024"  # modify bitrate
lavc1="vqmax=24:me_range=0:mbd=2:v4mv:mv0:preme=2:trell:cbp"



# 1st pass
date +"%Y/%m/%d %X [%s]"
mencoder $file_input -o $file_output $me \
        $af -oac $ac0 \
        $vf -ovc lavc -lavcopts vcodec=mpeg4:$lavc0:psnr:vb_strategy=1:vpass=1

cp divx2pass.log divx2pass1.log

# 2nd pass ( is actually vpass=3, not a typo )
date +"%Y/%m/%d %X [%s]"
mencoder $file_input -o $file_output $me \
        $af -oac $ac0 \
        $vf -ovc lavc -lavcopts vcodec=mpeg4:$lavc0:$lavc1:psnr:qns=0:qpel:subq=8:vpass=3

cp divx2pass.log divx2pass2.log

# 3rd pass. i think i can run this command more than once
date +"%Y/%m/%d %X [%s]"
mencoder $file_input -o $file_output $me \
        $af -oac $ac0 \
        $vf -ovc lavc -lavcopts vcodec=mpeg4:$lavc0:$lavc1:psnr:qns=3:qpel:subq=8:vpass=3


date +"%Y/%m/%d %X [%s]"
echo "mencoded $file_output"

------------- code ends here -----------------




More information about the MEncoder-users mailing list