Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #153 from Nicko98/master
Browse files Browse the repository at this point in the history
Fix for issue #145
  • Loading branch information
KrumpetPirate authored Feb 21, 2021
2 parents 1e9c42a + 9058cf1 commit 70ae2ce
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions AAXtoMP3
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,17 @@ do
chapter_codec="copy"
fi

#Since there seems to be a bug in some older versions of ffmpeg, which makes, that -ss and -to
#have to be apllied to the output file, this makes, that -ss and -to get applied on the input for
#ffmpeg version 4+ and on the output for all older versions.
split_input=""
split_output=""
if [ "$(($(ffmpeg -version | head -1 | cut -d \ -f 3 | cut -d . -f 1) > 3))" = "1" ]; then
split_input="-ss ${chapter_start%?} -to ${chapter_end}"
else
split_output="-ss ${chapter_start%?} -to ${chapter_end}"
fi

# Big Long chapter debug
debug_vars "Chapter Variables:" cover_file chapter_start chapter_end chapternum chapterNameScheme chapter_title chapter_file
if [ "$((${continueAt} > ${chapternum}))" = "0" ]; then
Expand All @@ -689,10 +700,10 @@ do
fi
</dev/null ffmpeg -loglevel quiet \
-nostats \
-ss "${chapter_start%?}" \
-to "${chapter_end}" \
${split_input} \
-i "${output_file}" \
-i "${cover_file}" \
${split_output} \
-map 0:0 \
-map 1:0 \
-acodec ${chapter_codec} \
Expand Down

0 comments on commit 70ae2ce

Please sign in to comment.