93fac50b9b8dd2e021bae4506b303e7a652a7683
[video-handling.git] / ffmpeg-all-mts2mp4-custom
1 #!/bin/bash
2 #
3 # 2010, Calin-Andrei Burloiu, calin.burloiu@gmail.com
4 #
5 # This scripts converts all mts files to avi starting from a root directory
6 # recursively. The avi files are placed in the same directory as the 
7 # original mts files.
8 #
9
10 if [ $# -ne 1 ]; then
11         echo "usage: $0 root_path"
12 fi
13
14 root_path="$1"
15
16 (
17 IFS=$'\n'
18 for filename in $(find "$root_path" -name '*.mts'); do
19         new_filename=$(dirname "$filename")/$(basename "$filename" .mts).avi
20         rm "$new_filename"
21         ./ffmpeg-mts2mp4-custom "$filename" "$new_filename" 1440x1080 1400k
22 done
23 )