video handling scripts reform: unique all file conversion script; renaming; old scrip...
[video-handling.git] / old / ffmpeg-all-mts2avi-custom
diff --git a/old/ffmpeg-all-mts2avi-custom b/old/ffmpeg-all-mts2avi-custom
new file mode 100755 (executable)
index 0000000..2a6a8d0
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# 2010, Calin-Andrei Burloiu, calin.burloiu@gmail.com
+#
+# This scripts converts all mts files to avi starting from a root directory
+# recursively. The avi files are placed in the same directory as the 
+# original mts files.
+#
+
+if [ $# -ne 1 ]; then
+       echo "usage: $0 root_path"
+fi
+
+root_path=$1
+
+(
+IFS=$'\n'
+for filename in $(find "$root_path" -name '*.mts'); do
+       new_filename=$(dirname "$filename")/$(basename "$filename" .mts).avi
+       rm "$new_filename"
+       ./ffmpeg-mts2avi-custom "$filename" "$new_filename" 800x600
+done
+)