mirror of
https://github.com/KrumpetPirate/AAXtoMP3.git
synced 2024-11-17 18:58:58 +01:00
Merge branch 'master' of github.com:KrumpetPirate/AAXtoMP3 into custom-output-folder
This commit is contained in:
commit
93478c797d
21
AAXtoMP3
21
AAXtoMP3
@ -579,16 +579,20 @@ do
|
||||
fi
|
||||
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="flac "${compression_level_param}""
|
||||
else
|
||||
chapter_codec="copy"
|
||||
fi
|
||||
|
||||
# Big Long chapter debug
|
||||
debug_vars "Chapter Variables:" cover_file chapter_start chapter_end id3_version_param chapternum chapterNameScheme chapter_title chapter_file
|
||||
debug_vars "Chapter Variables:" cover_file chapter_start chapter_end chapternum chapterNameScheme 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.
|
||||
@ -601,8 +605,7 @@ do
|
||||
-i "${cover_file}" \
|
||||
-map 0:0 \
|
||||
-map 1:0 \
|
||||
-acodec "${codec}" ${id3_version_param} \
|
||||
${compression_level_param} \
|
||||
-acodec ${chapter_codec} \
|
||||
-metadata:s:v title="Album cover" \
|
||||
-metadata:s:v comment="Cover (Front)" \
|
||||
-metadata track="${chapternum}" \
|
||||
|
22
README.md
22
README.md
@ -51,7 +51,9 @@ bash AAXtoMP3 [-f|--flac] [-o|--opus] [-a|-aac] [-s|--single] [--level <COMPRESS
|
||||
* **-c** or **--chaptered** Output a single file per chapter. The `--chaptered` will only work if it follows the `--aac -e:m4a -e:m4b --flac` options.
|
||||
* **--continue <CHAPTERNUMBER>** If the splitting into chapters gets interrupted (e.g. by a weak battery on your laptop) you can go on where the process got interrupted. Just delete the last chapter (which was incompletely generated) and redo the task with "--continue <CHAPTERNUMBER>" where CHAPTERNUMBER is the chapter that got interrupted.
|
||||
* **--level <COMPRESSIONLEVEL>** Set compression level. May be given for mp3, flac and opus.
|
||||
|
||||
* **--dir-naming-scheme <STRING>** Use a custom directory naming scheme, with variables. See [below](#custom-naming-scheme) for more info.
|
||||
* **--file-naming-scheme <STRING>** Use a custom file naming scheme, with variables. See [below](#custom-naming-scheme) for more info.
|
||||
* **--chapter-naming-scheme <STRING>** Use a custom chapter naming scheme, with variables. See [below](#custom-naming-scheme) for more info.
|
||||
|
||||
### [AUTHCODE]
|
||||
**Your** Audible auth code (it won't correctly decode otherwise) (required).
|
||||
@ -119,6 +121,24 @@ __Note:__ At least one of the above must be exist. The code must also match the
|
||||
* The default codec is mp3
|
||||
* The default output is by chapter.
|
||||
|
||||
### Custom naming scheme
|
||||
The following flags can modify the default naming scheme:
|
||||
* **--dir-naming-scheme**
|
||||
* **--file-naming-scheme**
|
||||
* **--chapter-naming-scheme**
|
||||
Each flag takes a string as argument. If the string contains a variable defined in the script (eg. artist, title, chapter, narrator...), the corresponding value is used.
|
||||
The default options correspond to the following flags:
|
||||
* `--dir-naming-scheme '$genre/$artist/$title'`
|
||||
* `--file-naming-scheme '$title'`
|
||||
* `--chapter-naming-scheme '$title-$(printf %0${#chaptercount}d $chapternum) $chapter'`
|
||||
* If a command substitution is present in the passed string, (for example `$(printf %0${#chaptercount}d $chapternum)`, used to pad with zeros the chapter number), the commands are executed.
|
||||
So you can use `--dir-naming-scheme '$(date +%Y)/$artist'`, but using `--file-naming-scheme '$(rm -rf /)'` is a really bad idea. Be careful.
|
||||
* You can use basic text, like `--dir-naming-scheme 'Converted/$title'`
|
||||
* You can also use shell variables as long as you escape them properly: `CustomGenre=Horror ./AAXtoMP3 --dir-naming-scheme "$CustomGenre/\$artist/\$title" *.aax`
|
||||
* If you want shorter chapter names, use `--chapter-naming-scheme '$(printf %0${#chaptercount}d $chapternum) $chapter'`: only chapter number and chapter name
|
||||
* If you want to append the narrator name to the title, use `--dir-naming-scheme '$genre/$artist/$title-$narrator' --file-naming-scheme '$title-$narrator'`
|
||||
* If you don't want to have the books separated by author, use `--dir-naming-scheme '$genre/$title'`
|
||||
|
||||
### Installing Dependencies.
|
||||
#### FFMPEG,FFPROBE
|
||||
__Ubuntu, Linux Mint, Debian__
|
||||
|
Loading…
Reference in New Issue
Block a user