From ca99899712114b0307083826a018d0c7374829f1 Mon Sep 17 00:00:00 2001 From: Calin Burloiu Date: Tue, 4 Jan 2011 11:49:01 +0200 Subject: [PATCH] new scripts and updates --- ffmpeg-all-mts2avi | 6 +++--- ffmpeg-all-mts2avi-custom | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100755 ffmpeg-all-mts2avi-custom diff --git a/ffmpeg-all-mts2avi b/ffmpeg-all-mts2avi index ff10130..cacebf4 100755 --- a/ffmpeg-all-mts2avi +++ b/ffmpeg-all-mts2avi @@ -11,10 +11,10 @@ if [ $# -ne 1 ]; then echo "usage: $0 root_path" fi -root_path=$1 +root_path="$1" -for i in $(find $root_path -name "*.mts"); do +for i in $(find "$root_path" -name "*.mts"); do #echo $(dirname $i)/$(basename $i .mts).avi - ./ffmpeg-mts2avi $i "$(dirname $i)/$(basename $i .mts).avi" + ./ffmpeg-mts2avi "$i" "$(dirname $i)/$(basename $i .mts).avi" done diff --git a/ffmpeg-all-mts2avi-custom b/ffmpeg-all-mts2avi-custom new file mode 100755 index 0000000..2a6a8d0 --- /dev/null +++ b/ffmpeg-all-mts2avi-custom @@ -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 +) -- 2.20.1