From 043ba978b72482e1443a3224c76db78520ae6a0f Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sun, 19 Jan 2020 08:48:59 -0500 Subject: dotfiles --- bin/media-filename-to-title.sh | 2 -- bin/split-media-files.sh | 12 ++++-------- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'bin') diff --git a/bin/media-filename-to-title.sh b/bin/media-filename-to-title.sh index 0047ac3..38dadd2 100755 --- a/bin/media-filename-to-title.sh +++ b/bin/media-filename-to-title.sh @@ -1,5 +1,3 @@ -#!bash - for f in *; do ffmpeg -i "$f" -metadata title="$(basename $f)" -c copy "new_$f" mv "new_$f" "$f" diff --git a/bin/split-media-files.sh b/bin/split-media-files.sh index 1f4c8bc..c680629 100755 --- a/bin/split-media-files.sh +++ b/bin/split-media-files.sh @@ -1,5 +1,3 @@ -#!bash - max_duration=$((4*3600)) if [[ $# -ne 1 ]]; then @@ -10,10 +8,8 @@ fi input_file="$1" base="$(basename $input_file | perl -pe 's/(.*)\.([^.]*)$/$1/')" -extension="$(echo $input_file | perl -pe 's/(.*)\.([^.]*)$/$2/')" -if [[ $extension == "m4b" ]]; then - extension=m4a -fi -ffmpeg -i "${input_file}" -c copy -f segment -segment_time $max_duration \ - "${base}-%03d.${extension}" +ffmpeg -i "${input_file}" \ + -f segment -segment_time $max_duration -segment_start_number 1 \ + -segment_format mp3 -qscale:a 5 \ + "${base}-%02d.mp3" -- cgit v1.2.3