Hi!
I've done some more investigating and found that if I replace oiio.TIMECODE
with oiio.TypeTimeCode I don't get the traceback as my call now follows the
valid signature. Unfortunately this still doesn't produce a valid timecode
entry. Does anyone have any suggestions on how to make this work?
What I've tried so far:
buf.specmod().attribute('smpte:TimeCode', oiio.TypeTimeCode, (421729315, 0))
buf.specmod().attribute('smpte:TimeCode', oiio.TypeTimeCode, (421729315, ))
buf.specmod().attribute('smpte:TimeCode', oiio.TypeTimeCode, (0x19231423,
0x0))
I've confirmed that using oiio.TypeBlaBla style works by adding frame rate
meta to a buffer like so:
buf.specmod().attribute('framesPerSecond', oiio.TypeRational, (24000, 1000))
Thanks!
-Daniel
On Sat, Dec 2, 2017 at 8:08 PM, Daniel Flehner Heen <[email protected]
> wrote:
> Hi again!
>
> Ok, so I tried and got this Traceback. Seems like it doesn't like my
> tuples. I tried a few variations with no luck
>
> >>> import OpenImageIO as oiio
> >>> buf = buf = oiio.ImageBuf(oiio.ImageSpec(1920, 1080, 3, oiio.HALF))
> >>> buf.specmod().attribute('smpte:TimeCode', oiio.TIMECODE, (421729315,
> 0))
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> Boost.Python.ArgumentError: Python argument types in
> ImageSpec.attribute(ImageSpec, str, VECSEMANTICS, tuple)
> did not match C++ signature:
> attribute(OpenImageIO_v1_8::ImageSpec {lvalue}, std::string,
> OpenImageIO_v1_8::TypeDesc, boost::python::tuple {lvalue})
> attribute(OpenImageIO_v1_8::ImageSpec {lvalue}, std::string,
> OpenImageIO_v1_8::TypeDesc, boost::python::api::object {lvalue})
> attribute(OpenImageIO_v1_8::ImageSpec {lvalue}, std::string,
> std::string)
> attribute(OpenImageIO_v1_8::ImageSpec {lvalue}, std::string, int)
> attribute(OpenImageIO_v1_8::ImageSpec {lvalue}, std::string, float)
>
>
>
> On Sat, Dec 2, 2017 at 7:51 PM, Daniel Flehner Heen <
> [email protected]> wrote:
>
>> Thank you so much! I'll try it and report back!
>>
>> On Dec 2, 2017 19:46, "Larry Gritz" <[email protected]> wrote:
>>
>>> Yes, I think that if you do something like
>>>
>>> spec.attribute ("smpte:timecode", oiio.TimeCode, (bcdint,userint))
>>>
>>> that should add the timecode to the imagespec. You then have to write a
>>> file with it, of course.
>>>
>>>
>>> On Dec 2, 2017, at 10:40 AM, Daniel Flehner Heen <
>>> [email protected]> wrote:
>>>
>>> OK, so could I pass a list or tuple with the timecode (BCD) in index 0
>>> and something else in index 1? According to wikipedia the second half of
>>> the int[2] should be userdata, an i correct? What should i provide in that
>>> case?
>>>
>>> Thanks,
>>> Daniel
>>>
>>>
>>> On Dec 2, 2017 19:12, "Larry Gritz" <[email protected]> wrote:
>>>
>>> Ah, so here's the crazy thing: timecode attributes (according to
>>> OpenEXR) aren't strings, they are encoded as an int[2], as described in
>>> https://github.com/openexr/openexr/blob/develop/OpenEXR/I
>>> lmImf/ImfTimeCode.h
>>>
>>>
>>> On Dec 2, 2017, at 4:53 AM, Daniel Flehner Heen <[email protected]>
>>> wrote:
>>>
>>> Hello!
>>> Not sure if this got through before I joined the list. Sorry about the
>>> double post on that case.
>>>
>>>
>>> On Dec 1, 2017 01:00, "Daniel Flehner Heen" <[email protected]>
>>> wrote:
>>>
>>> Hi!
>>>
>>> Apologize if this is the wrong mail list for this, but is there a way to
>>> add a timecode to EXR's in python?
>>> I read a thread once discussing a way of adding timecode to all
>>> supported formats, but I'm not sure how it ended.
>>> I've tried specmod().attribute("smpte:timecode", <value>) without
>>> success where value was either string or a BCD int same as one I got from a
>>> frame with timecode. It didn't complain, but no valid timecode appears in
>>> exrhreader or RV for instance.
>>>
>>> Am I missing something obvious or is this still not implemented?
>>>
>>> Thanks,
>>> -Daniel
>>>
>>>
>>> _______________________________________________
>>> Oiio-dev mailing list
>>> [email protected]
>>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>>>
>>>
>>> --
>>> 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
>>>
>>>
>>> --
>>> 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