Import in Java Objects the struct of an MXF file with BMXLib
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings
src/uk/co/bbc/rd/bmx
.classpath
.gitignore
.project
LICENSE
README.md

README.md

Use with Java and JAXB API the informations from MXF File from BMXLib Tools.

You can see the Javadoc (you can ignore the french comments, it's auto generated).

Usage, with Java 8:

    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.JAXBException;
    import javax.xml.bind.Unmarshaller;
    import uk.co.bbc.rd.bmx.Bmx;

Start mxf2raw --info-format xml source-file.xml and get a XML file to give to Java.

And import the XML:

// Load it in this InputStream
InputStream os = new FileInputStream("source-file.xml");

// Init JAXB
JAXBContext jc = JAXBContext.newInstance("uk.co.bbc.rd.bmx");
Unmarshaller unmarshaller = jc.createUnmarshaller();

// Enjoy your BMX Object !
Bmx b = (Bmx) unmarshaller.unmarshal(os);

Examples:

Get the start time code: b.getClip().getStartTimecodes().getPhysicalSource().getValue();

Get the Clip name: b.getFiles().getFile().get(0).getMaterialPackages().getMaterialPackage().get(0).getName();

Code automatically generated with xjc -p uk.co.bbc.rd.bmx mxf2raw_info.xsd, and some problems with vars names are corrected.