Resolve OTIO : Retime effects keyframe

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

omakazu

  • Posts: 5
  • Joined: Sun Jan 21, 2024 8:47 am
  • Real Name: Kazuki Omata

Resolve OTIO : Retime effects keyframe

PostThu Feb 01, 2024 1:35 am

When you export otio with clip's retime effect in resolve, we can get keyframe like below.

Code: Select all
effects": [
{
    "OTIO_SCHEMA": "TimeEffect.1",
    "metadata": {
        "Resolve_OTIO": {
            "Key Frames": [
                [
                    0.0,
                    0.0,
                    false,
                    0.0,
                    0.0,
                    0.0,
                    0.0
                ],
                [
                    1.1252248201438849,
                    1.25125,
                    false,
                    0.0,
                    0.0,
                    0.0,
                    0.0
                ],
                [
                    1.1261249999999999,
                    1.2521505866251417,
                    false,
                    0.0,
                    0.0,
                    0.0,
                    0.0
                ],
                [
                    1.2095416666666666,
                    1.3209236138882837,
                    false,
                    0.0,
                    0.0,
                    0.0,
                    0.0
                ],
                [
                    30.68514889018397,
                    19.72702181970176,
                    false,
                    0.0,
                    0.0,
                    0.0,
                    0.0
                ]
            ],
            "Speed Ratio": 0.6428849959405717
        }
    },
    "name": "",
    "effect_name": ""
},


What do these keyframes array represent?
I want to use these to calculate the in/out of the Source TC for this clip on the timeline.
Offline

tony.dorfmeister

  • Posts: 3
  • Joined: Fri Jun 23, 2023 11:27 am
  • Real Name: Tony Dorfmeister

Re: Resolve OTIO : Retime effects keyframe

PostSun Feb 18, 2024 5:51 pm

hey there,
i asked exactly the same some time ago with unfortunately no reply.

I asked copilot. Here's what it has to say:
The values you're seeing are keyframes for a time remapping or speed change effect in an OpenTimelineIO (OTIO) file exported from DaVinci Resolve.

Each keyframe is represented as a list with seven elements:

The first element is the time of the keyframe in seconds. This is the point in time where the change occurs.
The second element is the value at that time. In the context of a time remapping or speed change effect, this could represent the new time or speed at the keyframe's time. However, it's not a percentage change in speed, but rather an absolute value. For example, a value of 0.85085 at a time of 1.8494451951951952 seconds could mean that the time in the output is 0.85085 seconds when the time in the input is 1.8494451951951952 seconds.
The third element is a boolean indicating whether the keyframe is a bezier keyframe (True) or a linear keyframe (False). In this case, all keyframes are linear as the value is False.
The fourth to seventh elements represent the left and right handles of the bezier curve for the keyframe. Each handle is represented by two values: the time and the value. The fourth and fifth elements represent the left handle, and the sixth and seventh elements represent the right handle. In this case, all handles are 0.0, indicating that there are no bezier curves between keyframes.
The 'Speed Ratio' key represents the speed ratio of the time effect. A value of 1.0 typically means that the clip is playing at normal speed.

Please note that this is a general interpretation based on the provided data. The actual meaning of the data might vary depending on the specific software and version that generated the OTIO file.


still can't really wrap my head around it tho. maybe u have an idea? :)
Offline

omakazu

  • Posts: 5
  • Joined: Sun Jan 21, 2024 8:47 am
  • Real Name: Kazuki Omata

Re: Resolve OTIO : Retime effects keyframe

PostMon Feb 26, 2024 12:04 am

tony.dorfmeister wrote:hey there,
i asked exactly the same some time ago with unfortunately no reply.

I asked copilot. Here's what it has to say:
The values you're seeing are keyframes for a time remapping or speed change effect in an OpenTimelineIO (OTIO) file exported from DaVinci Resolve.

Each keyframe is represented as a list with seven elements:

The first element is the time of the keyframe in seconds. This is the point in time where the change occurs.
The second element is the value at that time. In the context of a time remapping or speed change effect, this could represent the new time or speed at the keyframe's time. However, it's not a percentage change in speed, but rather an absolute value. For example, a value of 0.85085 at a time of 1.8494451951951952 seconds could mean that the time in the output is 0.85085 seconds when the time in the input is 1.8494451951951952 seconds.
The third element is a boolean indicating whether the keyframe is a bezier keyframe (True) or a linear keyframe (False). In this case, all keyframes are linear as the value is False.
The fourth to seventh elements represent the left and right handles of the bezier curve for the keyframe. Each handle is represented by two values: the time and the value. The fourth and fifth elements represent the left handle, and the sixth and seventh elements represent the right handle. In this case, all handles are 0.0, indicating that there are no bezier curves between keyframes.
The 'Speed Ratio' key represents the speed ratio of the time effect. A value of 1.0 typically means that the clip is playing at normal speed.

Please note that this is a general interpretation based on the provided data. The actual meaning of the data might vary depending on the specific software and version that generated the OTIO file.


still can't really wrap my head around it tho. maybe u have an idea? :)



Copilot is right, using bezier would make the value true and element~7.
I get the vibe that what COPILOT is saying sounds right.
If the first element is the elapsed time, does that mean that 0 represents the first frame of the source clip? Or the first frame of the clip you put in the timeline?
We'll have to try to tet it.
Offline

tony.dorfmeister

  • Posts: 3
  • Joined: Fri Jun 23, 2023 11:27 am
  • Real Name: Tony Dorfmeister

Re: Resolve OTIO : Retime effects keyframe

PostMon Feb 26, 2024 12:37 pm

i actually started a little python test repo for this.

I'm not allowed to post links so find it in:
- github
- user: tweak-wtf
- repo: otio-tools

feel free to message me ;)

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 23 guests