Hi All, First, the below is my understanding of SMPTE timecode, it may not be 100% complete, or totally correct -
SMPTE timecode includes both clock data - this is binary-coded decimal and takes 32 bits, and user data which is another 32 bits with unspecified content (often a 'tape name' or similar, but also containing flag bits to indicate drop frame or otr details). In LTC (Longitudinal timecode, as it is encoded and written to tape or sent on the wire), the 4-bit nibbles which make up each binary-coded digit in both blocks of data are interleaved, which is why a SMPTE timecode is often represented by 64 bits of packed data. If you wanted to read timecode off the wire, write it into a file, then read the data from the file and write it back on the wire, without parsing it at all then you might want to ensure you had a 'flat' 64-bit type for this. Personally I think it makes more sense to separate clock and user data into 2 32 bit fields, if you want 'raw' storage of this data - using a string representation to get and set the clock data seems ideal, but might be tricky for user data, as bitwise interpretation/manipulation of this data ( e.g. drop frame indicator bit ) may be desirable - though this usage tends to be less important now we are leaving the world of analog tape, I know we abuse it for our purposes in 48fps workflow. There would also be some merit in dumping the 'raw' format entirely and just reading/writing an arbitrary string for timecode, as this would work for most practical purposes ( image file metadata is reference only, and timecode is always reconstructed and sent by some application) just fine. Not sure if this helps too much, I guess following what the DPX format does would be good for consistency. -Pete Mark Boorer <[email protected]> wrote: >Hi, > >Looking further into this, are we sure that timecode doesn't warrant a >new type? EXR's can contain many metadata fields in Timecode format >(not just one) and I don't think we can just give users 2 unsigned >ints and be done with it. Users will probably want their timecode in >string format (as is presently done in the DPX header) or at least >have an easy way for converting to/from strings. > >Further more, I don't think it's particularly intuitive to assume that >any TypeDesc of 2 UINT32 should be written as timecode, especially >where I would expect a TypeDesc of 2 INT32s to be written as an >ImfVecAttribute "v2i". > >Thoughts? > >Cheers, >Mark > >On Sun, Oct 6, 2013 at 9:27 PM, Pete Black <[email protected]> wrote: >> Hi All, >> >> DPX definitely supports timecode - and inside the DPX file, this is stored >> as a uint32 for the timecode data and a uint32 for the user data, by the >> looks >> >> Retrieving timecode from the DPX files we have using OIIO involves reading >> the metadata attribute 'dpx:Timecode' which returns the 'TV Industry >> specific' timecode formatted as a string e.g. '00:00:00:05'. >> >> -Pete >> >> >> >> I believe this maps to the >> >> On 7/10/2013, at 6:58 AM, Andrew Hunter <[email protected]> wrote: >> >>> I believe that DPX also supports SMPTE time code as well as CinemaDNG. >>> >>> -- >>> +1 416 567 9514 >>> [email protected] >>> http://aehunter.net >>> >>> On 3 Oct 2013 13:14, "Larry Gritz" <[email protected]> wrote: >>> I would welcome a pull request with this fully fleshed out and tested. >>> >>> Two more things... >>> >>> 1. Just to future-proof it, I might add this in there: >>> >>> ASSERT(sizeof(Imf::TimeCode) == 2*sizeof(unsigned int)); >>> >>> 2. If there are other formats that have full SMPTE timecodes, we might want >>> to instead change the attribute to "SMPTE:TimeCode" (making it not be >>> exr-specific) and dictate that any other formats follow the same encoding >>> if they have an SMPTE timecode. >>> >>> >>> On Oct 3, 2013, at 10:07 AM, Larry Gritz wrote: >>> >>>> I don't think this merits a new core type. >>>> >>>> I would add it to the metadata as an array of two unsigned ints, which is >>>> how it's encoded in Imf::TimeCode. You'd want something like this in >>>> exrinput.cpp: >>>> >>>> static TypeDesc TwoUints (TypeDesc::UINT, 2); >>>> Imf::TimeCode tc = ...; // get the timecode from the EXR file >>>> spec.attribute ("openexr:TimeCode", TwoUints, &tc); >>>> >>>> And then to extract it (including in exroutput.cpp): >>>> >>>> ImageIOParameter *f = spec.find_attribute ("openexr:TimeCode", >>>> TwoUints); >>>> if (f) { >>>> Imf::TimeCode tc = *(const ImfTimeCode *) f->data(); >>>> ... do your thing with tc ... >>>> } >>>> >>>> >>>> >>>> On Oct 3, 2013, at 8:56 AM, Mark Boorer wrote: >>>> >>>>> Hi, >>>>> >>>>> Was just looking to access timecode metadata from some EXR files, and >>>>> noticed that timecode keys aren't extracted by the reader. >>>>> >>>>> I then found this rather old issue >>>>> https://github.com/OpenImageIO/oiio/issues/337. Is it possible for me to >>>>> add this in? A simple class based on ImfTimeCode.h (or even just this >>>>> class directly) and a new enum added to TypeDesc? >>>>> >>>>> Cheers, >>>>> Mark >>>> >>>> -- >>>> Larry Gritz >>>> [email protected] >>>> >>> >>> -- >>> Larry Gritz >>> [email protected] >>> >>> >>> >>> _______________________________________________ >>> Oiio-dev mailing list >>> [email protected] >>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org >>> >>> _______________________________________________ >>> Oiio-dev mailing list >>> [email protected] >>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org >> >> _______________________________________________ >> Oiio-dev mailing list >> [email protected] >> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org >_______________________________________________ >Oiio-dev mailing list >[email protected] >http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org _______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
