You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Sample metadata drops General fields when MediaInfo returns a single track #1295
Tested on Sample Platform commit dd84dc7, using MediaInfoLib 25.04 on Linux. I checked the contributor guide, open and closed issues, and related PRs. This is separate from #1290 / #1291, which concerns a Text track without an ID.
Reproduction
Generate a small MP4, then make a copy without the trailing moov box. In my test, I generated the original with ffmpeg -f lavfi -i color=size=16x16:duration=0.1 -c:v libx264 file.mp4 and copied the bytes up to the start of the moov box.
Run mediainfo --Output=XML on the truncated copy. It emits a single <track type="General"> with Format and FileSize present.
Save that output as TestFiles/media/<sample-sha>.xml and load it with MediaInfoFetcher(sample).get_media_info().
Actual: The parser returns an empty General object. The original MP4, whose XML contains General and Video tracks, returns a populated General object. I tested the actual parser with both generated XML files, not the deployed site.
Expected: Keep the General metadata that MediaInfo recovered, even when it found no stream tracks.
xmltodict decodes a single track as a mapping and multiple tracks as a list. The loop currently iterates the mapping’s keys, which _process_track ignores. Wrapping a single mapping in a one-element list before the loop should preserve the fields without changing the multi-track case.
I'd like to take this one. Plan: in MediaInfoFetcher, normalise the track value before the loop — xmltodict gives a mapping for a single track and a list for several, so wrapping a lone mapping in a one-element list lets _process_track see it, with the multi-track path unchanged. I'd add a test using a truncated-MP4 XML fixture with only a General track, alongside the existing multi-track case.
Note this touches the same parser as #1291 (still open) — happy to rebase on it if that lands first.
Activity
WadekarPrashant commentedon Dec 1, 2026
I'd like to take this one. Plan: in
MediaInfoFetcher, normalise thetrackvalue before the loop —xmltodictgives a mapping for a single track and a list for several, so wrapping a lone mapping in a one-element list lets_process_tracksee it, with the multi-track path unchanged. I'd add a test using a truncated-MP4 XML fixture with only a General track, alongside the existing multi-track case.Note this touches the same parser as #1291 (still open) — happy to rebase on it if that lands first.