pátek 24. prosince 2010

Encode movie for IPBOX 420S

The satellite receiver IPBOX 420S is capable to play uploaded MPEG2 files. I was trying to find correct encoder settings for a long time. Finally it is here:

#!/bin/sh
in_vidname=$1
in_subname=${in_vidname%\.*}.srt
out_name=${in_vidname%\.*}.mpeg
echo IN : $in_vidname
echo SUB: $in_subname
echo OUT: $out_name
mencoder \
-sub $in_subname -subcp utf-8 -oac mp3lame \
-subfont-autoscale 1 -nooverlapsub -subpos 70 \
-ovc lavc -of mpeg -mpegopts format=mpeg2:interleaving2 \
-vf scale=720:306,expand=720:576 \
-lavcopts threads=2:vcodec=mpeg2video:vbitrate=2200 \
-ofps 25 \
-o $out_name $in_vidname


Notes:
-oac copy - only usable for some audio (my case - mp3 was fine)
-vf scale=720:304 - find your own depending on movie size - keep aspect if possible