This commit is contained in:
simono41 2017-10-25 01:26:40 +02:00
parent 72a91eb06a
commit 7dff37044b

44
convert_onefile_mp3_copy_cut.sh Executable file
View file

@ -0,0 +1,44 @@
#!/bin/bash
set -ex
cuts="$1"
if [ -z "${cuts}" ]] ;then
cuts=2
else
shift
fi
name=0
# wenn 100 daten und 3 cuts = 33 files
files="$(expr $# / $cuts)"
create=0
i=0
while (( "$#" ))
do
#cutter
if [ "$create" == "$i" ]; then
create="$(expr $create + $files)"
name="$(expr $name + 1)"
fi
i="$(expr $i + 1)"
cd "${1%/*}" # gehe ins Verzeichnis
FILENAME=${1##*/} # Dateiname ist alles ab dem letzten '/'
echo "$FILENAME"
# guck dir die Ausgabe erstmal an - wenn alles passt kannst Du das "echo" weglassen
#ffmpeg -i "$FILENAME" -vn -n -c:a copy "${FILENAME%.*}1.mp3"
cat "${FILENAME%.*}.mp3" >> onefile"$name".mp3
shift
cd -
done
#cd -
#pwd
#ffmpeg -i onefile.mp3 -acodec copy onefile-final.mp3
#rm onefile.mp3
#./convert_onefile_mp3_copy_cut.sh 3 PFAD/*