dskrad / mp3chaps

add chapter marks to mp3 files (use cases: audiobooks, podcast episodes, etc)
MIT License
80 stars 17 forks source link

Chapters are not visible in iTunes #5

Open michellekg opened 4 years ago

michellekg commented 4 years ago

Chapters created in mp3chaps are not visible in iTunes and Apple Podcasts. Some other apps like Overcast recognizes them though.

But if you open mp3 file with chapters created by mp3chaps in Forecast (macOS app with GUI) and then just save this file without any editing, chapters will become visible in iTunes.

I compared two files (before and after Forecast) and there some big differencies - mainly in the beginning of the file. Can this problem be solved somehow please?

dskrad commented 4 years ago

Hey, I just uploaded a new version. Can you tell me if this fixes this issue with iTunes, as I cannot test with iTunes. Thanks.

michellekg commented 4 years ago

Hey, I just uploaded a new version. Can you tell me if this fixes this issue with iTunes, as I cannot test with iTunes. Thanks.

Thanks! I'm kinda new to all this Python thing. Should I reinstall mp3chaps like this?

pip3 install mp3chaps

I did it and recieved Requirement already satisfied everywhere:

C:\Users\Wiedzmin>pip3 install mp3chaps Requirement already satisfied: mp3chaps in c:\users\wiedzmin\appdata\local\programs\python\python38\lib\site-packages (0.2) Requirement already satisfied: eyeD3>=0.8.4 in c:\users\wiedzmin\appdata\local\programs\python\python38\lib\site-packages (from mp3chaps) (0.9.5) Requirement already satisfied: docopt>=0.6.2 in c:\users\wiedzmin\appdata\local\programs\python\python38\lib\site-packages (from mp3chaps) (0.6.2) Requirement already satisfied: filetype in c:\users\wiedzmin\appdata\local\programs\python\python38\lib\site-packages (from eyeD3>=0.8.4->mp3chaps) (1.0.7) Requirement already satisfied: deprecation in c:\users\wiedzmin\appdata\local\programs\python\python38\lib\site-packages (from eyeD3>=0.8.4->mp3chaps) (2.1.0) Requirement already satisfied: packaging in c:\users\wiedzmin\appdata\local\programs\python\python38\lib\site-packages (from deprecation->eyeD3>=0.8.4->mp3chaps) (20.3) Requirement already satisfied: six in c:\users\wiedzmin\appdata\local\programs\python\python38\lib\site-packages (from packaging->deprecation->eyeD3>=0.8.4->mp3chaps) (1.14.0) Requirement already satisfied: pyparsing>=2.0.2 in c:\users\wiedzmin\appdata\local\programs\python\python38\lib\site-packages (from packaging->deprecation->eyeD3>=0.8.4->mp3chaps) (2.4.7)

Is it normal or am I doing something wrong?

dskrad commented 4 years ago

@michellekg Pip upgrade as follows:

pip3 install -U mp3chaps

Or

pip3 install --upgrade mp3chaps
michellekg commented 4 years ago

Thanks again. Unfortunately, iTunes still doesn't see chapters. Maybe this will help:

Here's my podcast after adding chapters with mp3chaps: https://media.kg-portal.ru/tv/t/tvpodcast/trailers/tvpodcast_part341_129351_not.mp3 (no chapters in iTunes)

And here's the same file, but opened and saved with Forecast: https://media.kg-portal.ru/tv/t/tvpodcast/trailers/tvpodcast_part341_129351_ok.mp3 (chapters in iTunes are here)

dskrad commented 4 years ago

@michellekg I will check those out, but I'm not sure I'll be able to find a fix.

I am on Linux and Android, and chapters work in mpv (aka celluloid) and Podcast Addict.

michellekg commented 4 years ago

Yes, it works basically in every other podcasts, but not in Podcasts and iTunes. Maybe ask author of Forecast for help? Or just compare this two files to check what's different?

dskrad commented 4 years ago

Since these are binary files, they are not easy to directly compare. I have tried using a couple of tools to see the differences.

I used the eyeD3 command line tool (provided by eyeD3 python library) to examine the ID3 tags.

The "bad" file has all the chapters listed in the "Lyrics" tag, whereas the "good" file has only a small hyperlink in the "Lyrics" tag. I don't know if you removed this on purpose, or if Forecast does this. Maybe the time codes listed in the lyrics tag are confusing iTunes?

I also used the ffprobe command line tool (provided by ffmpeg tool) and noticed that the "bad" file has the first chapter (Благодарим наших спонсоров) at 60 seconds (00:60:00.000) while the "good" file has the first chapter (Introduction) at time zero (00:00:00.000). This may also be confusing to iTunes. It may be standard practice to put the first chapter at time zero, and maybe Forecast defaults to this. Try using my tool to create chapters with the first chapter at time zero, and see if that fixes it.

One other difference is a frame called TLEN which contains the length of the file in milliseconds. This is present in the "good" file and absent in the "bad" file. This may be causing the iTunes issue. I will have mp3chaps update the TLEN frame and post the updated code here soon.

In the meantime, let me know if the other issues items I listed fix the issue for you. Thanks.

michellekg commented 4 years ago

Thanks, I'll try to make first chapter at time zero.

As for tags - yes, Forecast messes with them. For some strange reason it copies Comment to Lyrics and Album to Artist. Also it clears Genre and URL (and maybe more, I don't know). I tried to clear Lyrics, but it doesn't help in iTunes.

Also I think TLEN can help too.

dskrad commented 4 years ago

@michellekg The newest version on pypi now adds TLEN frame. Let me know if that fixes the issue with iTunes.

michellekg commented 4 years ago

Tried it, but no luck (

Here's file after mp3chaps (not working): https://media.kg-portal.ru/tv/t/tvpodcast/trailers/tvpodcast_part341_129351_chaps04.mp3

And here's after mp3chaps and saving in Forecast (works): https://media.kg-portal.ru/tv/t/tvpodcast/trailers/tvpodcast_part341_129351_chaps04_forecast.mp3

dskrad commented 4 years ago

@michellekg Hey, I noticed that the "Track" field gets stripped by Forecast. Maybe this is the trick? Try to not set the "Track" in the ID3 tag, then use mp3chaps and see if it works in iTunes.

michellekg commented 4 years ago

Unfortunately, no luck ( It seems like Forecast clearing Track tag by mistake like all other.

dskrad commented 4 years ago

Just curious what software you are using to encode or tag your mp3 files prior to adding chapters?

And referring to your original question: what "big differences" did you notice in the files before and after saving with Forecast? How did you spot these differences?

michellekg commented 4 years ago

Just curious what software you are using to encode or tag your mp3 files prior to adding chapters?

AIMP for tags, sometimes mp3tags. Enconding with Vegas Pro or foobar2000 - it seems it doesn't matter.

And referring to your original question: what "big differences" did you notice in the files before and after saving with Forecast? How did you spot these differences?

I was just comparing these files with Hex Fiend and differences was there.

pierrocknroll commented 4 years ago

@michellekg did you find a solution ?

michellekg commented 4 years ago

@michellekg did you find a solution ?

Unfortunately no ( I'm still have to use Forecast on macOS. It's a shame.

pierrocknroll commented 3 years ago

I think it's because Apple needs a "table of contents" in the MP3 File. Example (look at toc) : https://github.com/nicfit/eyeD3/blob/master/examples/chapters.py With "top level" ?

michellekg commented 3 years ago

I think it's because Apple needs a "table of contents" in the MP3 File. Example (look at toc) : https://github.com/nicfit/eyeD3/blob/master/examples/chapters.py

Maybe you're right! Can @dskrad please try this?

pierrocknroll commented 3 years ago

I confirm, the "toplevel=True" flag in my example fix the problem