videoImporter – use getOMEXMLMetaData instead of getMetaData??

Home Forums Development videoImporter – use getOMEXMLMetaData instead of getMetaData??

  • Frederic Marion-Poll

    To use VideoImporter, I took as an example the code from fab, as found in the plugin SingleMouseTracker. To read a file and get info from an AVI file, it looks like this:

    import plugins.stef.importer.xuggler.VideoImporter;

    VideoImporter importer = new VideoImporter();
    status = EnumStatus.AVIFILE;
    importer.open( fileName, 0 );
    OMEXMLMetadataImpl metaData = importer.getMetaData();
    nTotalFrames = MetaDataUtil.getSizeT( metaData, 0 ) – 2 ; // get one frame less as there is a little bug in the decompression of the video in h264

     

    Under Eclipse, “getMetaData” and “getSizeT” are noted as “deprecated” (and they are tagged as such in Stephane’s code). What is the correct version to be used?

     

    Should we simply replace OMEXMLMetaData by OMEXMLMetadata? like this:

    OMEXMLMetadata metaData = importer.getOMEXMLMetaData();

    nTotalFrames = MetaDataUtil.getSizeT( metaData, 0 ) – 2 ;

    Are these structures equivalent? (OMEXMLMetadata and OMEXMLMetadataImpl)

    fred

    Stephane Dallongeville

    Hi Frederic,

    Indeed you need to use the importer.getOMEXMLMetaData() method now, this is because internally Bio-Formats refactored some of their classes a long time ago so we had to change the interface but it does not make any differences (OMEXMLMetadata is the interface while OMEXMLMetadataImpl is the class implementing this interface and it’s better to work from the interface).

    Best,

    – Stephane

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Development’ is closed to new topics and replies.