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

Does not return duration of several FLAC and MID files #457

Open
prototyperspective opened this issue Oct 10, 2024 · 2 comments
Open

Does not return duration of several FLAC and MID files #457

prototyperspective opened this issue Oct 10, 2024 · 2 comments

Comments

@prototyperspective
Copy link

Please see: https://phabricator.wikimedia.org/T376137

On Wikimedia Commons, the Wikipedia sister project for media files, many FLAC files and some MID files display a duration of zero (0:00 until one has clicked play). According to a dev this is because this media parser did not return the duration.

Why is that and how to fix it? Example file (you can download it) 2 3. I don't know if the parser is also used for webm files which sometimes show a wrong (not 0) duration – example example.

@JamesHeinrich
Copy link
Owner

I downloaded your 5 sample files, getID3 shows playtime as per the attached screenshot. This matches with what MediaInfo and Windows File Explorer show (except the MIDI which is unsupported). Playing the videos in VLC is weird, the playback appears to start at the 24h/180h and count down the ~30s of actual video. Clearly something is weird with these files, maybe they were snipped out of a much longer video without rewriting the relevant metadata (wild guess)?
457

MIDI is a bit of an odd format in that it's very difficult to calculate playtime without interpreting all the instruction, it can be full of loops etc, potentially even infinite continuous playback. getID3 takes a quick "best guess" that is correct for the simplest MIDI, but can easily be (very) wrong for complex structures.

@prototyperspective
Copy link
Author

prototyperspective commented Oct 11, 2024

Thanks for looking into this! I reported this info back in the phab issue. The problem of the too long webm duration is currently minor because these are rare exceptions in contrast to the FLAC files where the duration is not displayed for many files. I guess then this issue here is only about the too long duration of the webm files so it should probably be renamed.

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

No branches or pull requests

2 participants