From c4c5470b6bfac81fe5767f7d5fd8914a36700e94 Mon Sep 17 00:00:00 2001 From: Nicko98 <39709875+Nicko98@users.noreply.github.com> Date: Tue, 9 Feb 2021 03:15:22 +0100 Subject: [PATCH 1/3] faster chapter splitting Since there is an issue with this fix when applied on flac option, the changes dont take effect on flac. For more information have a look in KrumpetPirate/AAXtoMP3 issue #142. --- AAXtoMP3 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/AAXtoMP3 b/AAXtoMP3 index ec2ce38..8fb3490 100755 --- a/AAXtoMP3 +++ b/AAXtoMP3 @@ -542,14 +542,18 @@ do chapter_title="${title}-$(printf %0${#chaptercount}d $chapternum) ${chapter}" chapter_file="${output_directory}/${chapter_title}.${extension}" - # the ID3 tags must only be specified for *.mp3 files, - # the other container formats come with their own - # tagging mechanisms. - id3_version_param="" - if test "${extension}" = "mp3"; then - id3_version_param="-id3v2_version 3" + # Since the .aax file allready got converted we can use + # -acodec copy, which is much faster than a reencodation. + # Since there is an issue when using copy on flac, where + # the duration of the chapters gets shown as if they where + # as long as the whole audiobook. + chapter_codec="" + if test "${extension}" = "flac"; then + chapter_codec="-acodec flac "${compression_level_param}"" + else + chapter_codec="-acodec copy" fi - + # Big Long chapter debug debug_vars "Chapter Variables:" cover_file chapter_start chapter_end id3_version_param chapternum chapter_title chapter_file if [ "$((${continueAt} > ${chapternum}))" = "0" ]; then @@ -564,8 +568,7 @@ do -i "${cover_file}" \ -map 0:0 \ -map 1:0 \ - -acodec "${codec}" ${id3_version_param} \ - ${compression_level_param} \ + ${chapter_codec} \ -metadata:s:v title="Album cover" \ -metadata:s:v comment="Cover (Front)" \ -metadata track="${chapternum}" \ From 2b31c7defa978e6751235e179c9ad9d20ae3b79a Mon Sep 17 00:00:00 2001 From: Nicko98 <39709875+Nicko98@users.noreply.github.com> Date: Tue, 9 Feb 2021 03:24:20 +0100 Subject: [PATCH 2/3] faster chapter splitting Since there is an issue with this fix when applied on flac option, the changes dont take effect on flac. For more information have a look in KrumpetPirate/AAXtoMP3 issue #142. --- AAXtoMP3 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AAXtoMP3 b/AAXtoMP3 index 8fb3490..b6e9363 100755 --- a/AAXtoMP3 +++ b/AAXtoMP3 @@ -549,11 +549,11 @@ do # as long as the whole audiobook. chapter_codec="" if test "${extension}" = "flac"; then - chapter_codec="-acodec flac "${compression_level_param}"" + chapter_codec="flac "${compression_level_param}"" else - chapter_codec="-acodec copy" + chapter_codec="copy" fi - + # Big Long chapter debug debug_vars "Chapter Variables:" cover_file chapter_start chapter_end id3_version_param chapternum chapter_title chapter_file if [ "$((${continueAt} > ${chapternum}))" = "0" ]; then @@ -568,7 +568,7 @@ do -i "${cover_file}" \ -map 0:0 \ -map 1:0 \ - ${chapter_codec} \ + -acodec ${chapter_codec} \ -metadata:s:v title="Album cover" \ -metadata:s:v comment="Cover (Front)" \ -metadata track="${chapternum}" \ From e6f34b5f97473554c67bd78ed010042d92db238f Mon Sep 17 00:00:00 2001 From: Nicko98 <39709875+Nicko98@users.noreply.github.com> Date: Tue, 9 Feb 2021 12:39:15 +0100 Subject: [PATCH 3/3] faster chapter splitting Since there is an issue with this fix when applied on flac option, the changes dont take effect on flac. For more information have a look in KrumpetPirate/AAXtoMP3 issue #142. --- AAXtoMP3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AAXtoMP3 b/AAXtoMP3 index b6e9363..fa85260 100755 --- a/AAXtoMP3 +++ b/AAXtoMP3 @@ -555,7 +555,7 @@ do fi # Big Long chapter debug - debug_vars "Chapter Variables:" cover_file chapter_start chapter_end id3_version_param chapternum chapter_title chapter_file + debug_vars "Chapter Variables:" cover_file chapter_start chapter_end chapternum chapter_title chapter_file if [ "$((${continueAt} > ${chapternum}))" = "0" ]; then # Extract chapter by time stamps start and finish of chapter. # This extracts based on time stamps start and end.