Recoding of videos to H.264 using mencoder

INPUT=video.avi
OUTPUT=video_h264.avi

# a few possible video filters
VF="-vf crop=712:568:4:4,pp=fd"
VF="-vf crop=688:568:18:4,pp=fd"
VF="-vf spp,scale"
VF="-sws 9 -vf scale=720:-11,expand=:-48::0"
VF="-vf expand=0:-32::0"
VF=

# audio filters
AF="-af stats,volume=6 -oac lavc -lavcopts acodec=ac3 -aid 128"
AF="-af stats,volume -oac pcm -aid 129"
AF="-aid 128 -af volume=20:0"
AF=

################
# H.264 settings
BITRATE=1200
ENCOPTS="bitrate=$BITRATE:threads=6:8x8dct:cabac:deblock:frameref=3:bframes=2:b_adapt:weight_b:chroma_me"
PASS1="-ovc x264 -x264encopts pass=1:$ENCOPTS"
PASS2="-ovc x264 -x264encopts pass=3:$ENCOPTS"
mencoder "$INPUT" \
         -o "$OUTPUT" \
         -nosub \
         $VF $PASS1 \
         -nosound \
         ;

mencoder "$INPUT" \
         -o "$OUTPUT" \
         -nosub \
         $VF $PASS2 \
         -nosound \
         ;

# extract the (AC3) audio track
mencoder -of rawaudio -ovc copy $VF $AF $INPUT -o en.ac3

Notes

  • I do not really understand the encoding options ENCOPTS. I’ve picked them up from various other posts and it looks to me, I can get reasonable results.
  • Using the option -nosound may desynchronize the video from the audio stream, the the video output-framerate is wrong.Watch out for warnings “duplicate frame” and check the length of the video stream and audio track!
  • For sharpening, use: -vf unsharp=l5x5:1.0:c5x5:1.0, but test the result!
Advertisements

Just turned 50

I just turned 50 yesterday and I’ve finally decided to invest time in writing a blog.

Currently I’m struggling with the peculiarities of WordPress, mostly in finding a theme using the full available width.

What else has happened yesterday. Well, die EU has finally decided what the measurements to solve the €problem. The issue of GR, the overwhelming state deficits are certainly not easy (if not impossible) to solve with a short time. Let’s see how things develop in the next months.

Much more important than the short-time measures that have been decided (basically to chunk around with a lot of money) is the scheme and actions the politicians will take to prevent a similar disaster in the future. In my opinion the most urgent problems are:

  • Reduce the state deficits
  • Prevent banks from being “too big to fail”
  • Regulation of the derivates market: a forced default of GR was not feasible for political reason but also because nobody was capable to predict the consequences of default with respect to the CDS (Credit Default Swap) market.

And most important: the world has develop an economy model that is independent from permanent grow but instead takes into account the restricted resources.