Giter VIP home page Giter VIP logo

mxfinspect's Introduction

License: MIT dotnet version

MXF Inspect

MXF Inspect is a fully functional and completely free Windows tool to display the internal structure of a MXF (Material eXchange Format) file. It can NOT play the MXF movie itself. The application is tested on Windows 7, 8, 10 & 11.

MXF files are extensively used in the broadcast industry. Since I was working in the broadcast industries, I personally used a lot of MXF files. I wanted to determine if certain MXF files were valid but could not find any good (free) tools on the internet so I decided to make my own. The source code is released under the LGPL.

This project is updated in February 2023 by merging the rayden84 fork. This project now includes all changes that have been done in the rayden84 fork (https://github.com/rayden84). It includes code of the following contributors: feigenanton, rayden84, ft, ws, Nicolas Gaullier and Wolfgang Ruppel. They have made numerous updates and expanded the original project far beyond my original ideas. The original code has been totally revamped, clean-up, restructured, great work guys!

MXF Inspect Features

  • Open multiple MXF files at once.
  • Support for different MXF File Version (e.g. 1.2, 1.3)
  • Support for large number of MXF metadata packs, see this TODO list for the classes that are supported.
  • View offsets, parsed MXF data and raw data in a glance.
  • Physical (Offset) and Logical (Object hierarchy) view present.
  • Jump to the next/previous object of the same type.
  • Only show/filter the current object type.
  • Written in .NET6. Thus allowing MXFInspect to be shipped as a single-file-application without any dependencies on installed .NET frameworks
  • Large file support. It is possible to load very huge MXF files (several Gigabytes).
  • 'Syntax' coloring. Different types of metadata can be given separate colors so it is easier to distinguish between the different types.
  • Drag and drop of MXF file in order to open it
  • Report screen that shows the results of the following tests/validators:
    • Consistency of partitions (check if the previous/next partitions and footer partitions are filled in correctly)
    • RIP check (present and pointing to valid partitions)
    • Check if every entry in all index tables point to valid essences. (Actually being reimplemented)
    • Test if the user dates in all system items (if present) increase correct (no jumps present). (Actually being reimplemented)
    • Test continuity counter of the system items increases. (Actually being reimplemented)

This application does NOT (yet) implement the WHOLE SMPTE-MXF specifications. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public License for more details.

Screenshots

Validation report showing the "health status" of the MXF file* Validation report showing the "health status" of the MXF file

Logical view Logical view

Physical view Physical view

MXF Packs tree (with 'syntax' coloring, i.e. colorization based on MXF pack type)

MXF Packs tree (with 'syntax' coloring, i.e. colorization based on MXF pack type)

Quick info Quick info

Latest improvements:

  • Further SMPTE Standards Implementation

    • New metadata classes (e.g. MPEGPictureEssenceDescriptor, JPEG2000PictureSubDescriptor). A hierarchical inheritance tree of MXF classes can be found here. See this TODO list for the classes that still need to be implemented.
    • New MXF types (e.g. CodedContentScanningKind, ProductVersion, FrameLayout, Emphasis). A list of MXF types can be found here
  • Quick info panel added

  • Basic logging functionality (see settings window...) using Serilog logging

  • Basic exception handling of unparseable MXF packs

Future work

However, there is still a long TODO list:

  • implement additional/more thorough file checks/validations features such as:

    • Structurual validation (is KLV stream error-free?)
    • KAG (=Key alignment grid) validation
    • Essence validation
    • Metadata validation
    • add validation profiles, like ARD ZDF profiles
    • ability to export validation reports in various formats (txt, json, xml)
    • search for text in validation output
    • filter based on severity/error type
  • User Interface/Usability

    • true MDI application, where multiple MXF files can be opened side-by-side
    • pimp up the property grid (colors, hyperlinks for UMIDs)
    • use a better control for the hex view, which makes use of colors for the various byte segments (e.g. this HexViewer)
    • thumbnail preview of video essences (by using https://github.com/cmxl/FFmpeg.NET or https://github.com/rosenbjerg/FFMpegCore)
    • decoding of subtitles
    • "go to offset/go to pack number" navigation
    • optimize the MXFReader class to reduce file loading time
    • reorganize the file check dialog
  • Features

    • export/demux/remux essences
    • command-line-interface of MXF library for automated validation
  • Long Term TODO

    • migrating to NET.8 (not possible at the moment because of ObjectListView dependency)
    • multi-platform-support (maybe by replacing winforms with Electron.NET?

Any help/contribution is greatly appreciated!!!

Installation

Find the latest release and just download the self-contained single file for your Windows version, copy the zip contents to a separate folder and run the MXFInspect.exe.

Have fun!

PS: The MXF file specification is huge! The specification allows for a lot of different ‘tastes’ of MXF files. I started developing this application by using the SMPTE 377-1-2009 specifications only. But during development I realized that I needed to use a lot of other SMPTE specs as well. Some specifications are a bit unclear (at least to me). I don’t know if I understood/implemented them correctly which might result in a possible incorrect warning or error for some tests…

mxfinspect's People

Contributors

bakjalfen avatar imftool avatar myriadbits avatar ngaullier avatar rayden84 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mxfinspect's Issues

Wrong hex conversion for offsets values

Hi again,

Second bug i'm experiencing, is that if i change the settings to display the offsets in hex instead of decimal, the displayed values are completely wrong.

See the 2 pictures attached displaying the same part of the same file, in decimal and in hexadecimal.

For example value 34 949 439 086 becomes 0x34949439086 which is the same digits that the decimal values, but with a 0x appended and spaces removed.

Version 4.0.9.0 Windows 22H2.

Thanks again for your help!

Regards.

GoodDecimalOffsets
WrongHexOffsets

Displayed index entries lines are all empty on graphical display

Hi,

I've just discovered your product, and i try to use it to inspect some MXF files. It works pretty great, except for 2 strange bugs on some files.

First bug is that when i click the "+" sign of "IndexEntries" to display the contained entries (in this case 4308 items), lines are appearing, but nothing is displayed on it, they remain completely empty. Normaly, i should see something like "Index[000] - TempsOffs (...)".

It works correctly on some other files with less items (240 for example), so maybe is it related to the number of items.

Version 4.0.9.0, Windows 10 22H2.

Thanks in advance for your help, and congratulations for your great work!

EmptyIndexEntries

Error when open and incomplete header partition pack

Hi
I found that when there is an open and incomplete header partition pack, program reports a wrong headerbytecount in footer,
either if the value is correct. This is due to the fact that IsHeaderByteCountCorrect method evaluate value measuring from start of primer pack to end of partition, but doesn't take account of index table present on footer. Correct value should be from start of primer pack to index table offset, as reported from MXFAnalyzer Lite from IRT.
I correct the bug on my code, how can I get in touch with contributors ?
Regards
FrancescoBLT

ANC Frame Element's Packet Boundary Calculation Error

I found a problem that incorrectly analyzes the ANC Frame Element while using MXF Inspect.
If the element is a CDP, AFD, OP47 packet, then the next element is calculated incorrectly.

image

The problematic part is the source below, and I also included the modifications I made, but I don't know if there is a better way to fix it.

		// Length Alignment
		this.Length = 4 * ((this.Length + 3) / 4);

		// FIX : calculate end of packet position
		long packetEndPosition = reader.Position + this.Length;

		if (this.Length > 3)
		{
			// Read the DID
			this.DID = reader.ReadB();
			this.SDID = reader.ReadB();
			this.Size = reader.ReadB();

			UInt16 combinedID = (UInt16)((((UInt16)this.DID) << 8) | this.SDID);
			if (m_DIDDescription.ContainsKey(combinedID))
				this.ContentDescription = m_DIDDescription[combinedID];
			else
				this.ContentDescription = "<unknown content>";

			switch (combinedID)
			{
				case 0x6101: // CDP
					this.AddChild(new MXFCDPPacket(reader));
					break;
				case 0x4105: // AFD
					break;
				case 0x4302: // OP47
					break;
				default:
					// Read the real payload without the did/sdid/size
					this.Payload = new byte[this.Length - 3];
					reader.Read(this.Payload, this.Length - 3);
					break;
			}
		}

		// FIX : move to packet end position
		if ( reader.Position != packetEndPosition )
			reader.Seek(packetEndPosition);

After modification, it will look like this.

image

SetTypePropertiesToReadOnly causes unwanted behavior

We adopted your work to on of our projects and came to an issuse regarding SetTypePropertiesToReadOnly found in MXFKLVFactory.cs

https://github.com/Myriadbits/MXFInspect/blob/master/MXF/MXFKLVFactory.cs#L177

Our web application would not serialize the users post json as this methods sets every property to readonly via the TypeDescriptionProvider

as debuging shows your code here goes up to System.Object

SetTypePropertiesToReadOnly: System.Object
SetTypePropertiesToReadOnly: Myriadbits.MXF.MXFObject
SetTypePropertiesToReadOnly: Myriadbits.MXF.MXFKLV
SetTypePropertiesToReadOnly: Myriadbits.MXF.MXFMetadataBaseclass
SetTypePropertiesToReadOnly: Myriadbits.MXF.MXFInterchangeObject
SetTypePropertiesToReadOnly: Myriadbits.MXF.MXFGenericPackage
SetTypePropertiesToReadOnly: Myriadbits.MXF.MXFDescriptiveFramework

you might could add some check for MXFObject to prevent this.

thanks

Terse loader error messages could be made more helpful

As part of the metarex project we're testing the toxicity of a new framework with different tools.

Currently MXF Inspect 4.x fails to open some files with errors like Error while populating the tree ... Sequence contains no elements whereas v2.x loads the same file and displays SourceClips for every Sequence (we think).

Could we have some helpful errors like

printf ( "Sequence %s contains no elements", SequienceUUID.toString())

A typical breaking file is on the metarex dowloads page. We know it's broken but it's really hard to find where the error is.

Thanks for reading this.

How to get Sourcepackage track Origin and Duration

Hello and thanks for open-sourcing this great package. It looks like it could ease my life when looking out for specific issues in MXF files.
What i want to do is to retrieve and compare the Origin and Duration values of all track from Material Package and Source Package.
Unfortunately the coding style of the whole project is new to me and i don't know how to dig my way through the source code in order to get out how to do what i want to do.

Basically, this works for getting the MP tracks:
List<MXFLogicalObject> lot = MXFLogicalObject.GetLogicChilds<MXFGenericTrack>(mxff.LogicalBase[typeof(MXFMaterialPackage)]);

But the same for MXFSourcePackage does not work and i cannot get out why.

So i tried just looping through all the items manually but finally when i come to the track in the Sourcepackage, Visual Studio shows that the field "Reference" would contain the Origin and Duration but i cannot access this field for my _track object below. (it is now shown by VS intellisense). Also casting _track to MXFTimelineTrack returns 0.


            Myriadbits.MXF.MXFFile mxff = new Myriadbits.MXF.MXFFile(filename, backgroundWorker1,Myriadbits.MXF.FileParseOptions.Fast);
            int trackID = 2;
            try
            {
                var blah = mxff.LogicalBase.Children;
                foreach (var package in blah) {
                    var name = package.ToString();
                    if (package.ToString().Contains("ContentStorage")) //content storave contains MP and SP
                    {
                        foreach (var pack in package.Children) {
                            if (pack.ToString().Contains("Source")) {//source package
                                
                                var tracks = pack.Object.Children[0].Children;
                                foreach (var _track in tracks)
                                {
                                    //_track is now a track in Source package, but Casting to Logical or Timelinetrack returns null
                                }

                            }
                        }
                       
                    }
                    
                }

Any clue would be very welcome :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.