v1.03 Switch to ffprobe

master
RandomNinjaAtk 2 years 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 LC_ALL=C.UTF-8
export LANG=C.UTF-8 export LANG=C.UTF-8
TITLESHORT="APP" TITLESHORT="APP"
ScriptVersion="1.02" ScriptVersion="1.03"
SECONDS=0 SECONDS=0
set -e set -e
@ -49,7 +49,7 @@ if [ $(find "$1" -type f -iname "*.mp3" | wc -l) -gt 0 ]; then
echo "[CHAPTER]" >> $chapterFile echo "[CHAPTER]" >> $chapterFile
echo "TIMEBASE=1/1000" >> $chapterFile echo "TIMEBASE=1/1000" >> $chapterFile
echo "START=$start" >> $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 )) seconds=$(( $seconds * 1000 ))
end=$(( $start + $seconds - 1 )) end=$(( $start + $seconds - 1 ))
#echo "seconds :: $seconds" #echo "seconds :: $seconds"
@ -59,8 +59,6 @@ if [ $(find "$1" -type f -iname "*.mp3" | wc -l) -gt 0 ]; then
echo "" >> $chapterFile echo "" >> $chapterFile
start=$(( $end + 1 )) start=$(( $end + 1 ))
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 "$1/output.mp4"

Loading…
Cancel
Save