1.07 - Add fast start, bugfix for chapter titles

master
RandomNinjaAtk 2 years ago committed by GitHub
parent a53191f2ad
commit a1eb4fbb39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
export LANG=C.UTF-8 export LANG=C.UTF-8
TITLESHORT="APP" TITLESHORT="APP"
ScriptVersion="1.06" ScriptVersion="1.07"
SECONDS=0 SECONDS=0
set -e set -e
@ -53,7 +53,7 @@ if [ $(find "$1" -type f -iname "*.mp3" | wc -l) -gt 0 ]; then
seconds=$(ffprobe -i "$i" -show_format -v quiet | sed -n 's/duration=//p' | cut -d "." -f1) seconds=$(ffprobe -i "$i" -show_format -v quiet | sed -n 's/duration=//p' | cut -d "." -f1)
seconds=$(( $seconds * 1000 )) seconds=$(( $seconds * 1000 ))
end=$(( $start + $seconds - 1 )) end=$(( $start + $seconds - 1 ))
chapterTitle=$(ffprobe -i "$i" -show_format -v quiet | sed -n 's/TAG:title=//p' | cut -d "." -f1) chapterTitle=$(ffprobe -i "$i" -show_format -v quiet | sed -n 's/TAG:title=//p')
#echo "seconds :: $seconds" #echo "seconds :: $seconds"
#echo "end :: $end" #echo "end :: $end"
echo "END=$end" >> "$chapterFile" echo "END=$end" >> "$chapterFile"
@ -67,7 +67,7 @@ if [ $(find "$1" -type f -iname "*.mp3" | wc -l) -gt 0 ]; then
echo "file '$i'" >> "$fileList" echo "file '$i'" >> "$fileList"
done done
IFS="$OLDIFS" IFS="$OLDIFS"
ffmpeg -f concat -safe 0 -i "$fileList" -i "$chapterFile" -map_metadata 1 -vn -acodec aac "$1/output.mp4" ffmpeg -f concat -safe 0 -i "$fileList" -i "$chapterFile" -map_metadata 1 -vn -acodec aac -movflags +faststart "$1/output.mp4"
mv "$1/output.mp4" "$1/audiobook.m4b" mv "$1/output.mp4" "$1/audiobook.m4b"
find "$1" -type f -iname "*.mp3" -delete find "$1" -type f -iname "*.mp3" -delete
rm "$chapterFile" rm "$chapterFile"

Loading…
Cancel
Save