From 8282502f8f68fa9b5664380c1c1dc4bf8aab6a12 Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Sat, 24 Aug 2019 08:43:12 +0000
Subject: [PATCH] added overviews

---
 transcode_music.sh |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/transcode_music.sh b/transcode_music.sh
index 2b28bca..274bde3 100755
--- a/transcode_music.sh
+++ b/transcode_music.sh
@@ -1,5 +1,9 @@
 #!/bin/bash
 
+# Script to transcode music in buld using ffmpeg
+
+bitrate=192000
+
 shopt -s globstar
 
 rm -r trans_music
@@ -10,8 +14,8 @@
 for d in **/*.{mp3,flac,mp4,m4a,ogg}; do
 	if [ "ffprobe -show_format 2>/dev/null $d | grep bit_rate | cut -d'=' -f2" > 192000 ]; then
 		echo in $d
-		echo out "trans_music/$(echo ${d%.*} | cut -f2,3,4,5 -d'/').mp3"
-		ffmpeg -i "$d" -b:a 192000 "trans_music/$(echo $d | cut -f1 -d'.' | cut -f2,3,4,5 -d'/').mp3"
+		echo out "trans_music/$(echo ${d%.*} | cut -f1 -d'/' --complement).mp3"
+		ffmpeg -i "$d" -b:a $bitrate "trans_music/$(echo $d | cut -f1 -d'.' | cut -f2,3,4,5 -d'/').mp3"
 	else
 		cp "$d" "trans_music/$(echo $d | cut -f2,3,4,5 -d'/')"
 	fi

--
Gitblit v1.9.3