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

Error while splitting into chapters #155

Open
nixfuerdiecharts opened this issue Feb 25, 2021 · 15 comments
Open

Error while splitting into chapters #155

nixfuerdiecharts opened this issue Feb 25, 2021 · 15 comments

Comments

@nixfuerdiecharts
Copy link

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?

@Nicko98
Copy link
Contributor

Nicko98 commented Feb 25, 2021

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

@Nicko98
Copy link
Contributor

Nicko98 commented Feb 25, 2021

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!

@nixfuerdiecharts
Copy link
Author

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

@Nicko98
Copy link
Contributor

Nicko98 commented Feb 25, 2021

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?

@nixfuerdiecharts
Copy link
Author

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

@Nicko98
Copy link
Contributor

Nicko98 commented Feb 25, 2021

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.

@smvoss
Copy link

smvoss commented Feb 25, 2021

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

@fabh2o
Copy link
Contributor

fabh2o commented Feb 25, 2021

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

@Nicko98
Copy link
Contributor

Nicko98 commented Feb 25, 2021

@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
Copy link
Contributor

Nicko98 commented Feb 25, 2021

It seems as if github deletes double spaces.

@Nicko98
Copy link
Contributor

Nicko98 commented Feb 25, 2021

» 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

@smvoss
Copy link

smvoss commented Feb 25, 2021

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

@Nicko98
Copy link
Contributor

Nicko98 commented Feb 25, 2021

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

Nicko98 added a commit to Nicko98/AAXtoMP3 that referenced this issue Feb 25, 2021
KrumpetPirate added a commit that referenced this issue Feb 26, 2021
@KrumpetPirate
Copy link
Owner

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

@dging85
Copy link

dging85 commented Jul 30, 2021

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.

antfred pushed a commit to antfred/AAXtoMP3 that referenced this issue Oct 15, 2022
antfred pushed a commit to antfred/AAXtoMP3 that referenced this issue Oct 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants