Skip to content

[BUG] Sample metadata drops General fields when MediaInfo returns a single track #1295

Backlog

Description

@Junaid2-7777

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

  1. 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.
  2. Run mediainfo --Output=XML on the truncated copy. It emits a single <track type="General"> with Format and FileSize present.
  3. 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.

Activity

  1. WadekarPrashant commented on Dec 1, 2026

    @WadekarPrashant

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions