sandreas / m4b-tool

m4b-tool is a command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b
MIT License
1.12k stars 78 forks source link

im running m4b-tool in a bash script on a macOS and its working really well, but --series-part is not working. Any idea why? #242

Closed WalnutAppleStore closed 1 year ago

WalnutAppleStore commented 1 year ago
    m4b-tool merge -v --jobs=8 \
        --audio-bitrate="$closest_bitrate" \
        --audio-samplerate="$closest_samplerate" \
        "${start}"*.mp3 \
        --output-file="${ofolder}${counter}.m4b" \
        --genre="Audiobook" \
        --series-part="$counter" \
        --name="$counter - $title" \
        --album="$counter - $title" \
        --series="$bookseries" \
        --artist="$author" \
        --sortartist="$publisher" \
        --albumartist="$author" \
        --writer="$narrator" \
        --series-part="$track" \
        --sortalbum="$bookseries" \
        --use-filenames-as-chapters \
        --sortname="$counter"

        #everything else works. Here is the error script in the terminal:
        PHP Deprecated:  Return type of Sandreas\Time\TimeUnit::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///opt/homebrew/Cellar/m4b-tool/pre-release/bin/m4b-tool/vendor/sandreas/php-time/src/Sandreas/Time/TimeUnit.php on line 241

Deprecated: Return type of Sandreas\Time\TimeUnit::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///opt/homebrew/Cellar/m4b-tool/pre-release/bin/m4b-tool/vendor/sandreas/php-time/src/Sandreas/Time/TimeUnit.php on line 241

im on macOS Ventura 13.4.1

sandreas commented 1 year ago

Maybe --series-part interferes with --sortalbum , I'll have to check that. Btw --series-part will automatically generate --sortalbum, if not present.

As a temporary workaround I would suggest to just remove --sortalbum from your script...

WalnutAppleStore commented 1 year ago

I tried, it doesn’t work. That’s unlucky. I think it’s because I’m on a mac. I wrote a very long script using m4b-tool that runs in bash on a mac that takes audiobook file combinations(m4b/m4a/mp3) in folders and does what needs to be done with them. For example, Splits them if they are too large and ends up combining and chaptering them really well. Some books had parts and the different parts were partially mp3 and partially other types.

Anyways, I really like your tool, but I think several functions don’t work on a mac so I used work arounds, like using sortalbum. I later use that field to swap it to other tags with mp3tag.app.

Is there any way that you know of that I can add all the id3 tags with your tool, or is it just the ones that are available in the —help?

also I believe the chapter length command doesn’t work 300,900. So far the only way I can control chapter length is by splitting the audio file into smaller files and then merging those. After that the chapter sizes never change automatically based on the values.

I would love to be able to implement those functions if you know any way to get them to work on a mac. Could it be cause we use ZSH now?

sandreas commented 1 year ago

I would love to be able to implement those functions if you know any way to get them to work on a mac. Could it be cause we use ZSH now?

I got a MacBook Pro early 2015. I don't think this is a macOS Problem, but could be an m4b-tool problem. So if you are using the latest pre-release and it does not work, you could as a workaround additionally install tone (https://github.com/sandreas/tone) for tagging, which is way more powerful than plain m4b-tool.

A side effect would be, that m4b-tool uses tone instead of ffmpeg and mp4v2 for tagging, which should result in cleaner tags. But this is not sure, I have to investigate.

WalnutAppleStore commented 1 year ago

I was using tone for a bit but for some reason it wasn’t working when a m4b was very large. For example an entire graphic audio book of 5+gbs. I’m not exactly sure why the tone meta tagging behaved differently but that’s why I ended up taking it out. Now I just use m4b to add some tags and mp4tag app to finish them up. I wish I could just add every audiobook tag I need within your tools. I very much appreciate your Merge and split, are you going to have tone do everything eventually?

sandreas commented 1 year ago

I very much appreciate your Merge and split, are you going to have tone do everything eventually?

Well, the plan is adding feature after feature for tone, but ATM I'm way too busy. Too many projects and too little time :-) Fixing the problem in m4b-tool would be the next step...

If you'd like to, you can add an issue to tone regarding the file is too big problem... I would love to improve anything I can on tone