#!/bin/bash # x264-enc-3p.sh source="$1" bitrate="$2" filters="$3" name="$(date +%F-%T)".avi log="$name".log # 21 #e="mencoder "$source" -vf pullup,softskip,"$filters"harddup -ovc x264 -x264encopts threads=auto:psnr:ssim: b_adapt=2:deblock:cabac:chroma_me:subq=9:partitions=all:8x8dct:me=umh:nofast_pskip:nodct_decimate: me_range=32:trellis=2:frameref=16:bframes=16:b_pyramid:weight_b:mixed_refs:direct_pred=auto: keyint=750:keyint_min=25:direct_8x8=-1:aq_mode=1:aq_strength=1.0:psy_rd=1.0,0.0:bitrate=$bitrate"( #e="mencoder "$source" -vf pullup,softskip,"$filters"harddup -ovc x264 -x264encopts threads=2:psnr:ssim:b_adapt=2:deblock:cabac:chroma_me:subq=9:partitions=all:8x8dct:me=umh:nofast_pskip:nodct_decimate:me_range=32:trellis=2:frameref=16:bframes=16:b_pyramid:weight_b:mixed_refs:direct_pred=auto:keyint=750:keyint_min=25:direct_8x8=-1:aq_mode=1:aq_strength=1.0:psy_rd=1.0,0.0:bitrate=$bitrate" # With niceness = 19 (the lowest priority #E1="nice -n 19 mencoder "$source" -vf pullup,softskip,"$filters"harddup -ovc x264 -x264encopts threads=2:subq=1:frameref=1:bframes=3:b_pyramid=normal:direct_pred=auto:bitrate=$bitrate" #E2="nice -n 19 mencoder "$source" -vf pullup,softskip,"$filters"harddup -ovc x264 -x264encopts threads=2:psnr:ssim:b_adapt=2:deblock:cabac:chroma_me:subq=9:partitions=all:8x8dct:me=umh:nofast_pskip:nodct_decimate:me_range=16:trellis=2:frameref=5:bframes=3:b_pyramid=normal:weight_b:mixed_refs:direct_pred=auto:bitrate=$bitrate" # With niceness = 0 (normal priority) E1="mencoder "$source" -vf pullup,softskip,"$filters"harddup -ovc x264 -x264encopts threads=2:subq=1:frameref=1:bframes=3:b_pyramid=normal:direct_pred=auto:bitrate=$bitrate" E2="mencoder "$source" -vf pullup,softskip,"$filters"harddup -ovc x264 -x264encopts threads=2:psnr:ssim:b_adapt=2:deblock:cabac:chroma_me:subq=9:partitions=all:8x8dct:me=umh:nofast_pskip:nodct_decimate:me_range=16:trellis=2:frameref=5:bframes=3:b_pyramid=normal:weight_b:mixed_refs:direct_pred=auto:bitrate=$bitrate" #E2="mencoder "$source" -vf pullup,softskip,"$filters"harddup -ovc x264 -x264encopts threads=2:psnr:ssim: b_adapt=2:deblock:cabac:chroma_me:subq=6:partitions=all:8x8dct:me=umh:nofast_pskip:nodct_decimate:me_range=32:trellis=2:frameref=5:bframes=3:b_pyramid:weight_b:mixed_refs:direct_pred=auto:keyint=750:keyint_min=25:direct_8x8=-1:aq_mode=1:aq_strength=1.0:psy_rd=1.0,0.0:bitrate=$bitrate" #E2="mencoder "$source" -vf pullup,softskip,"$filters"harddup -ovc x264 -x264encopts threads=2:subq=1:frameref=1:bframes=3:b_pyramid=normal:direct_pred=auto:bitrate=$bitrate" time (\ time $E1:pass=1 -o /dev/null && \ time $E2:pass=2 -o "$name" && \ echo "Encoding time:") rm -v divx2pass.log #(time (\ #time $E1:pass=1 -o /dev/null && \ #time $E2:pass=2 -o "$name" && \ #echo "Encoding time:") &> "$log"; \ #)& #rm -v divx2pass.log #(time (\ #time $E1:pass=1 -o /dev/null && \ #time $E2:pass=2 -o "$name" && \ #echo "Encoding time:") &> "$log";\ #rm -v divx2pass.log*\ #) & #(time (\ #time $e:pass=1 -o /dev/null && \ #time $e:pass=3 -o /dev/null && \ #time $e:pass=3 -o "$name" && \ #echo "Encoding time:") &> "$log";\ #rm -v divx2pass.log*\ #) & #tail -f "$log"