AAXtoMP3
AAXtoMP3 copied to clipboard
Error while splitting into chapters
I tried to convert an aax audiobook with following command:
./AAXtoMP3 -e:m4a --chaptered --authcode xxxx000x --target_dir ~/Musik/ ~/Downloads/audiobookname.aax
I also tried exchanging the -e:m4a flag with --aac before the --chaptered flag. The audiobook always gets converted in a single file. But everytime the splitting into chapters should proceed I get the following Error:
./AAXtoMP3: Line 687: n4 is not set.0% (0/23 chapters)
Am I doing something wrong?
Hi @nixfuerdiecharts could you please comment the output of ffmpeg -version | head -1
?
A quick fix for you should be to comment out lines 687 and 689-691, but I'd prefer if you would help me sorting this out!
Hi @nixfuerdiecharts could you please comment the output of
ffmpeg -version | head -1
?
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
Ok, could you please replace line 687 of AAXtoMP3 by
if [ "$(($(ffmpeg -version | head -1 | cut -d \ -f 3 | cut -d . -f 1 | cut -d n -f 2) > 3))" = "1" ]; then
and tell me if this fixes it?
Ok, could you please replace line 687 of AAXtoMP3 by
if [ "$(($(ffmpeg -version | head -1 | cut -d \ -f 3 | cut -d . -f 1 | cut -d n -f 2) > 3))" = "1" ]; then
and tell me if this fixes it?
^This didn't work out for me. Same error as before. Your quickfix worked for me tho
Have you saved the file after changing the line and befor testing it?
That's what normaly is my mistake when a fix doesn't work.
Because I tested
cut -d \ -f 3 | cut -d . -f 1 | cut -d n -f 2
on your
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
and it does result in 4
just as it is suppsed to.
cut -d \ -f 3 | cut -d . -f 1 | cut -d n -f 2
Required cut -d '\' -f 3 | cut -d . -f 1 | cut -d n -f 3
for my version string:
» ffmpeg -version | head -1
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
» ffmpeg -version | head -1 | cut -d \ -f 3
cut: the delimiter must be a single character
Try 'cut --help' for more information.
» ffmpeg -version | head -1 | cut -d '\' -f 3
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
» ffmpeg -version | head -1 | cut -d '\' -f 3 | cut -d . -f 1 | cut -d n -f 2
» ffmpeg -version | head -1 | cut -d '\' -f 3 | cut -d . -f 1 | cut -d n -f 3
4
Required
cut -d '\' -f 3 | cut -d . -f 1 | cut -d n -f 3
for my version string:
Since sed
is required, we search for the first number in each row (s/[^0-9]*([0-9]).*/\1/g
). But we only want the first line, so we quit after one line (1q
)
ffmpeg -version | sed -E 's/[^0-9]*([0-9]).*/\1/g;1q'
4
@smvoss
I forgot a space after the backslash. It is supposed to be cut -d \ -f 3 | cut -d . -f 1 | cut -d n -f 2
It seems as if github deletes double spaces.
» ffmpeg -version | head -1
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
» ffmpeg -version | head -1 | cut -d \ -f 3 #with double space after the backslash
n4.3.1
» ffmpeg -version | head -1 | cut -d \ -f 3 | cut -d . -f 1
n4
» ffmpeg -version | head -1 | cut -d \ -f 3 | cut -d . -f 1 | cut -d n -f 2
4
Also works for me, although I might instead suggest quoting a single space (I tested and it works, cut -d ' '
instead), as it gets rid of load-bearing whitespace and it is a lot clearer what you're going for, in my opinion
Ok thanks. But I think the version fabh2o commented is better since it is more universal.
Fix merged, if you need more testing please do so. I'll close the issue in a couple of days regardless.
I am having this same issue but have not been able to remedy it.
when I enter "AAXtoMP3 --authcode 0000xx00 audiobookX.aax"
A singular audio file is created with the error: "/usr/bin/AAXtoMP3: line 687: n4: unbound variable/18 chapters)"
I have commented out lines 687 and 689-691 then it produces:
"/usr/bin/AAXtoMP3: line 725: bc: command not found18 chapters)"
I'm uncertain of how to move forward. Thanks for your help.