Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpv player shows error after tagging with atldotnet #296

Open
sandreas opened this issue Dec 20, 2024 · 8 comments
Open

mpv player shows error after tagging with atldotnet #296

sandreas opened this issue Dec 20, 2024 · 8 comments
Assignees

Comments

@sandreas
Copy link
Contributor

Recently someone submitted issue 79 in tone where he stated mpv was not playing the file correctly after tagging (it IS playing audio, but it shows errors - something is strange). I traced this down to an atldotnet behaviour, and I'm not sure, how to handle this...

He also states, that with older versions of tone (and so atldotnet) it worked - which I can confirm, so I suspect this to be a regression. Since and OpenGL error is reported:

[vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[vo/gpu/opengl] after rendering: OpenGL error INVALID_FRAMEBUFFER_OPERATION.
[vo/gpu/opengl] after rendering: OpenGL error INVALID_FRAMEBUFFER_OPERATION.

I also think this might have to do something with the cover...

Some code:

var original = "input_original.m4b";
var bogus = "input_broken.m4b";

if (File.Exists(bogus))
{
    File.Delete(bogus);
}

File.Copy(original, bogus);

var track = new Track(bogus);
track.Genre = "Audiobook";
track.Save();

I attached both files, just in case:
input.zip

@sandreas
Copy link
Contributor Author

@Zeugma440
Update: The author of the issue took the effort to add another example, which should help you to reproduce.

@gnattu
Copy link
Contributor

gnattu commented Dec 21, 2024

More context: Tone 0.1.6 updated to atl with version 5.22 so if it is an regression it is a regression months ago

@Zeugma440 Zeugma440 self-assigned this Dec 21, 2024
@Zeugma440 Zeugma440 added the bug label Dec 21, 2024
@Zeugma440
Copy link
Owner

Can repro the issue from end to end on Windows with ATL 6.10 on MPV 0.39.0 👍

Can also repro the issue not happening on Windows with ATL 4.19 on MPV 0.39.0 👍

I'll investigate further and let you know what I find.

NB : The UI disappearing is a design problem on MPV's side, btw. VLC also seems to be annoyed by these files, but at least it keeps its composure 😄

@sandreas
Copy link
Contributor Author

I'll investigate further and let you know what I find.

Thank you very much... I think this is probably a minor thing, maybe even a problem with mpv and not atldotnet, but thank you very much for taking a look.

@Zeugma440
Copy link
Owner

Okay, I got it!

The issue is linked to a feature introduced in v5.06 to handle MP4/M4A chapters that have no attached images.

See #163 for the description of the issue and its solution, i.e. Inserting a 1x1 black image on any chapter without picture if at least one chapter has a user-defined picture.

Problem is the implementation always inserted that 1x1 image regardless of whether there's any user-defined picture among chapters or not. That's what I just fixed.

That fixes the immediate problem triggered by the code you posted, where chapters have no attached picture.

However, that doesn't really fix the case when you feed MPV a file that has :

  • No picture attached to chapter 1 => chapter 1 will be displayed with that 1x1 picture and break MPV's UI
  • A user-defined picture attached to chapter 2 => Chapter 2 will be properly displayed

My own take about that is you need to submit a bug report to the MPV tracker and explain the problem you have. Their controls UI seems to be scaled to the picture that's being displayed regardless of its size.

That leads to ridiculously small controls when loading files with low-res pics (here's an non-rescaled example of MPV reading a file with a 200x174 cover picture - top bar buttons have a correct size, but bottom bar controls are so tiny 😂 )

image

Zeugma440 added a commit that referenced this issue Dec 22, 2024
…er-defined chapter pictures are actually present [#296]
@Zeugma440
Copy link
Owner

Fix is available on today's v6.11.

Please comment back if you need a different fix, or close the issue if that works for you 😄

@sandreas
Copy link
Contributor Author

Okay, I got it!

Great thank you.

My own take about that is you need to submit a bug report to the MPV tracker and explain the problem you have. Their controls UI seems to be scaled to the picture that's being displayed regardless of its size.

Well, I'm going to redirect this to the initial issue reporter, because I neither use mpv atm nor plan to use it in the future. My main purpose with this issue was (an always is):

  • checking if atldotnet has an issue that leads to corrupt files under specific circumstances (which would have been bad for anyone using the lib)
  • impoving player compatibility of written files in general

You've already put a lot of effort in this wonderful library and I think it is one of the most complete and most versatile out there (in any language). I also love that you are regularly maintaining and responding to issues - this is not taken for granted. Last time I tried to write an audio (book) player app I mainly failed because dart / flutter did not have a good lib to read all metadata (e.g. chapters) and the lack of proper headset remote support.

I think some tone users have found interesting edge cases in atldotnet which led to improving the lib even more - I still don't know why some devs still seem to prefer ffmpeg wrappers over it. Please let me know as soon as it gets too much with tone feedback that produces additional work...

Please comment back if you need a different fix, or close the issue if that works for you 😄

I try to check in the next days, thanks.

@Zeugma440
Copy link
Owner

I still don't know why some devs still seem to prefer ffmpeg wrappers over it.

For one, ffmpeg is an institution. It's maintained regularly and is one of the most used audio libraries out there. Also, it does way more than just tagging : it's also the swiss-knife army for transcoding media.

The main alternative to ATL is TagLibSharp, which is more or less of a zombie project right now, but still widespread and part of the Mono repos, which does give it prestige.

Please let me know as soon as it gets too much with tone feedback that produces additional work...

So far so good. I do appreciate people from other projects coming here to help me find edge cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants