v1.03 Switch to ffprobe

master
RandomNinjaAtk 1 year ago committed by GitHub
parent d8eb8ba8a5
commit 5dd646d073
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
TITLESHORT="APP"
ScriptVersion="1.02"
ScriptVersion="1.03"
SECONDS=0
set -e
@ -49,7 +49,7 @@ if [ $(find "$1" -type f -iname "*.mp3" | wc -l) -gt 0 ]; then
echo "[CHAPTER]" >> $chapterFile
echo "TIMEBASE=1/1000" >> $chapterFile
echo "START=$start" >> $chapterFile
seconds=$(sox "$i" -n stat |& head -2 | tail -1 | grep -o '[[:digit:]]*' | head -1)
seconds=$(ffprobe -i "$i" -show_format -v quiet | sed -n 's/duration=//p' | cut -d "." -f1)
seconds=$(( $seconds * 1000 ))
end=$(( $start + $seconds - 1 ))
#echo "seconds :: $seconds"
@ -58,9 +58,7 @@ if [ $(find "$1" -type f -iname "*.mp3" | wc -l) -gt 0 ]; then
echo "title=Part \#$chapterNumber" >> $chapterFile
echo "" >> $chapterFile
start=$(( $end + 1 ))
echo "file '$i'" >> $fileList
echo "file '$i'" >> $fileList
done
IFS="$OLDIFS"
ffmpeg -f concat -safe 0 -i "$fileList" -i "$chapterFile" -map_metadata 1 -vn -acodec aac "$1/output.mp4"

Loading…
Cancel
Save