mediainfo.js icon indicating copy to clipboard operation
mediainfo.js copied to clipboard

Parsing `.mxf` format file after any file has been parsed results in missing or incorrect critical fields

Open grochlitz-evertz opened this issue 8 months ago • 1 comments

Checklist

  • [x] I have searched the issue tracker for any duplicate issues and confirmed that this bug has not been reported before.
  • [x] I have tested the issue with the upstream project MediaInfo and can confirm that the problem only exists in mediainfo.js.
  • [x] I have attached all necessary test files, if applicable, so that the issue can be easily reproduced by the developers.
  • [x] I have added a reproduction repository or a code sandbox that clearly illustrates the issue. Providing a minimal example will greatly help the developers in understanding and resolving the problem.
    • As this bug is visible from the mediainfo.js demo page, any reproduction can be done through there.

Bug Description

The first parse of a given MXF file returns expected data - but following the first parse, any subsequent uploads result in missing or inaccurate values

This includes:

  • Parsing the same MXF twice in a row
  • Parsing two different MXFs
  • Parsing an unrelated file format, then parsing an MXF

In each case, the second parse, as well as any other MXF parse afterwards, will have crucial data missing or with inaccurate values. Ex. With the freeMXF-mxf1.mxf from http://freemxf.org/samples/index.html: Correct General Track after first parse:

Image

Incorrect General Track after second parse:

Image

Differences:

  • Format_Version
  • Duration (inaccurate)
  • OverallBitRate (inaccurate)
  • FrameCount (missing)
  • StreamSize (inaccurate)
  • FooterSize (missing)
  • Encoded_Date (inaccurate)
  • IsTruncated (now present)

There are also differences in the other tracks. For the demo MXF being used, I've noticed in the Video track:

  • Format_Settings_GOP (missing)
  • Duration (inaccurate)
  • FrameCount (inaccurate rather than missing - showing as 22 after 2nd parse instead of 266 like first)
  • Delay (inaccurate)
  • StreamSize (inaccurate)

This bug is present on the demo page for mediainfo.js Important note: after a refresh, the first MXF will be correctly parsed again, and subsequent uploads will have the same issue - so a refresh after each parse can be used as a temp workaround.

I have tested parsing the same file through the MediaInfo GUI and can confirm that is working normally when subsequent MXFs are parsed

Steps to Reproduce

  1. Visit the https://mediainfo.js.org/demo/ page
  2. Upload any file of your choosing (to see difference most clearly, should use an MXF here)
  3. Upload any MXF and compare the difference in output

I cannot attach any MXFs in github but for the sake of demonstrating the bug, I've used free available MXFs from http://freemxf.org/samples/index.html. Though from my testing, this issue is present with any MXF file.

Expected Behavior

I expect that uploading an MXF regardless of anything that has been uploaded before it will correctly be parsed

Actual Behavior

Important fields either end up as missing or inaccurate

Environment

  • mediainfo.js version: tested with demo page on version 0.3.5, also tested our project with 0.3.4 and 0.3.3, similar results
  • Operating System: Ubuntu 22.04.5 LTS
  • Browser (if applicable): Tested on all of Chromium 136.0.7103.59, Firefox 138.0.1, Google chrome 136.0.7103.92
  • Node.js (if applicable): Whatever the mediainfo.js.org/demo/ page is using

Additional Information

grochlitz-evertz avatar May 13 '25 16:05 grochlitz-evertz

Hoping to keep this thread alive and get some update -

As a workaround for now, destroying and recreating the module after each use restores the originally functionality, but of course whatever underlying issue exists is still there

grochlitz-evertz avatar Jun 04 '25 20:06 grochlitz-evertz

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jul 05 '25 02:07 github-actions[bot]

In each case, the second parse, as well as any other MXF parse afterwards, will have crucial data missing or with inaccurate values.

I added a test case.

The MediaInfo instance is reset before each analysis run.

This helps, but Video.Delay is still off by 3 on the second run for some reason.

buzz avatar Aug 31 '25 14:08 buzz