Parsing `.mxf` format file after any file has been parsed results in missing or incorrect critical fields
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:
Incorrect General Track after second parse:
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
- Visit the https://mediainfo.js.org/demo/ page
- Upload any file of your choosing (to see difference most clearly, should use an MXF here)
- 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
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
This issue is stale because it has been open for 30 days with no activity.