AAXtoMP3 icon indicating copy to clipboard operation
AAXtoMP3 copied to clipboard

Error while splitting into chapters

Open nixfuerdiecharts opened this issue 3 years ago • 15 comments

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?

nixfuerdiecharts avatar Feb 25 '21 12:02 nixfuerdiecharts

Hi @nixfuerdiecharts could you please comment the output of ffmpeg -version | head -1?

Nicko98 avatar Feb 25 '21 13:02 Nicko98

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!

Nicko98 avatar Feb 25 '21 13:02 Nicko98

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

nixfuerdiecharts avatar Feb 25 '21 16:02 nixfuerdiecharts

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?

Nicko98 avatar Feb 25 '21 16:02 Nicko98

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

nixfuerdiecharts avatar Feb 25 '21 16:02 nixfuerdiecharts

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.

Nicko98 avatar Feb 25 '21 16:02 Nicko98

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

smvoss avatar Feb 25 '21 21:02 smvoss

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

fabh2o avatar Feb 25 '21 22:02 fabh2o

@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

Nicko98 avatar Feb 25 '21 22:02 Nicko98

It seems as if github deletes double spaces.

Nicko98 avatar Feb 25 '21 22:02 Nicko98

» 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

Nicko98 avatar Feb 25 '21 22:02 Nicko98

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

smvoss avatar Feb 25 '21 22:02 smvoss

Ok thanks. But I think the version fabh2o commented is better since it is more universal.

Nicko98 avatar Feb 25 '21 22:02 Nicko98

Fix merged, if you need more testing please do so. I'll close the issue in a couple of days regardless.

KrumpetPirate avatar Feb 26 '21 03:02 KrumpetPirate

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.

dging85 avatar Jul 30 '21 01:07 dging85