Convert 1080i AVCHD directly to 720p avi with ffmpeg 0.5

With the realease off ffmpeg 0.5 there is much better AVCHD support in my experience, so you can use it for perfect conversions. You can download ffmpeg from and then use this script:

# ffmpeg-avchd script by
# to encode a directory use this command:
# for i in *.m2ts; do ffmpeg-avchd $i; done
IN="$1"; shift
OUT=$(echo $IN | sed 's/.m2ts//')-720p.avi
echo Encoding $IN to $OUT.
ff="ffmpeg -deinterlace -i "$IN" -acodec copy -vcodec libx264 -vpre normal -crf 25 -sws_flags lanczos -s hd720 -r 25"
echo $ff $OUT
nice $ff "$OUT"

The only thing I'm not really happy with yet is the deinterlacing and deshaking. I would like to use a sharper deinterlacer, but I guess I'd need mencoder for that. The Lanczos software scaler does make steady images pretty sharp already, though.


  1. great! i used the script under windows:

    ffmpeg-avchd.cmd movie.MOV movie_720p.AVI

    rem ffmpeg-avchd.cmd
    set HOME=c:\Users\user1\
    rem .ffmpeg dir at %HOME% with all ffmpeg presets
    ffmpeg -deinterlace -i "%1" -acodec copy -vcodec libx264 -vpre libx264-normal -crf 25 -sws_flags lanczos -s hd720 -r 25 "%2"

  2. Good to hear! :) I also use some of my mplayer scripts in Windows.


I appreciate comments. Feel free to write anything you wish. Selected comments and questions will be published.