5 # ./convert_ts_to_mp2.sh a/file.ts b/c/prog_converting.avi b/c/prog.avi a/old
7 # Converts the supplied MPEG-2 ts file to MPEG-2 640x480 format.
17 if [ ! -f "$MP2_FILENAME" ]; then
19 #echo "Converting $TS_FILENAME to MPEG-2 .avi"
22 #echo '$ mencoder -quiet '"'$TS_FILENAME'"' -o '"'$CONV_FILENAME'"' -vf pp=li,scale=640:480 -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=1200'
24 mencoder
-quiet "$TS_FILENAME" -o "$CONV_FILENAME" -vf pp
=li
,scale
=640:480 -oac mp3lame
-ovc lavc
-lavcopts vcodec
=mpeg2video
:vbitrate
=1200 > mencoder_out.txt
2>&1
29 mv "$TS_FILENAME" "$OLD_DIR"
31 if [[ $RETVAL != 0 ]]; then
33 echo '$ mencoder -quiet '"'$TS_FILENAME'"' -o '"'$CONV_FILENAME'"' -vf pp=li,scale=640:480 -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=1200'
37 echo "** Error: mplayer returned '"$RETVAL"' **"
42 mv "$CONV_FILENAME" "$MP2_FILENAME"
48 echo "** Error: .mp2 filename already exists: " $MP2_FILENAME " **"