Josh Harris - 2005-11-16

It seems that Avid is no longer distributing the full source code for the OMF format because they are moving to AAF and MXF.  This is strange since my company just bought an Avid Adrenaline and an Avid Xpress Pro HD system and they both capture video to OMF and not to AAf or MXF.  I need to be able to read OMF video data so that I can run batch operations.  I have been using AviSynth, custom Perl scripts and other software to run batch processing and encoding of Avi files captured on our old Matrox Digisuite system.

I found what is left of the OMF developers toolkit on this site and have been using it to write an AviSynth import filter for OMF video data.  The problem for me is that it does not come with any documentation or example code.  I look through the AAF source code for omf2aaf and used that as a starting point.  My filter is far enough along that I can successfully import video data from almost all of the NTSC OMFs I can get my hands on (Uncompressed, Jpeg, DV25 and Mpeg2) but a lot of my code is just a hacked work around because I cannot figure out the correct OMF functions to use.

Does anyone have the full OMF Toolkit with documentation and/or example code that they could upload or email to me?

Some of the main issues I am trying to resolve:
1) Field Order: I am able to successfully determine if the file is progressive, interlaced, contains only field, etc. but I am having trouble determining the correct field order of interlaced video.  Right now, I just assume everything is lower field first which works for all of my NTSC files but the field order is reversed on the one or two PAL files I have tired it on.

2) FrameIndexes for a Jpeg compressed file.  I am not sure how to directly read this data into an array.  My current workaround is to find the "OMFI:JPEG:FrameIndex" property with a property iterator and use OMGetPropertyFileOffset to find out where in the file the array starts.  I then use fopen and manually read each frame offset into an array.

3) Codecs: I have no idea how to go about initializing and using the codecs to decode video.  My workaround: for uncompressed, DV25 and Jpeg compressed I use omfsReadDataValue or OMReadProp to read a frame of data into a buffer.  Uncompressed video is copied directly as YUY2 data.  I manually feed jpeg data into libjpeg and DV25 data to Cedocida DV decoder.  For Mpeg2 I use fopen and fread to manually feed data into mpeg2dec.  There has to be a better way to do this.

4) Segmented OMF files:  When an OMF file reaches 2 GBs, Avid Adrenaline starts a new OMF and writes references to the new file in the original file.  I can't figure out how exactly to read and use these references to open all segments as one continuous video.  I am able to import them one at a time but I lose a frame of data at the beginning of each segment.

5) Eventually I would also like to write an export filter, but I think that will be a ways down the road.

I have other issues that need fixing but those are the main ones at the moment.

Thanks for your time,

Josh