ccc5312fe001a7127438749f66dccbdfdeb42299
   1#! /bin/bash
   2
   3# AVCHD to MP4 converter
   4# ffmpeg cmdline taken from http://pvdm.xs4all.nl/wiki/index.php/Convert_an_AVCHD_/_MTS_file_to_MP4_using_ffmpeg
   5
   6OPTIND=1
   7
   8src=""
   9dest=""
  10verbose=0
  11
  12while getopts s:d:v option; do
  13        case "$opt" in
  14        s)
  15                src=$OPTARG
  16                ;;
  17        d)
  18                dest=$OPTARG
  19                ;;
  20        v)
  21                verbose=1
  22                ;;
  23        esac
  24done
  25                
  26
  27
  28IFS=$(echo -en "\n\b"); for i in $(find $src -name '*.MTS'); do ffmpeg -i "$i" -vcodec mpeg4 -b:v 15M -acodec libmp3lame -b:a 192k "${$i%.MTS}.mp4"; done
  29
  30