Accessing Speedwarp Motion Estimation on a TimelineItem

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

wakeforce

  • Posts: 20
  • Joined: Fri Jun 07, 2019 8:09 pm
  • Real Name: Jean-Philippe Allard

Accessing Speedwarp Motion Estimation on a TimelineItem

PostFri Jan 31, 2020 9:42 pm

I'm trying to create a python script and need to access the new Speed Warp motion estimation in DR16.

I can access motion estimation through the Project object, but trying to set project.SetSetting('imageMotionEstimationMode', 'speedWarp') returns False, and don't change anything to the project settings.

Looking through the available keys of a clip in GetClipProperty() doesn't give me a usable key for that either.

I suspect I need to find how to set it at the TimelineItem level, since this is where we set it in the Resolve GUI, but the API docs don't give me any method to access what I normally find in the inspector window (Retime and scaling --> Motion Estimation --> Speed Warp)

Here's what I get when I call dir() on a sample TimeLineItem:

['AddFlag', 'AddFusionComp', 'AddMarker', 'AddTake', 'AddVersion', 'ClearClipColor', 'ClearFlags', 'CopyGrades', 'DeleteFusionCompByName', 'DeleteMarkerAtFrame', 'DeleteMarkersByColor', 'DeleteTakeByIndex', 'DeleteVersionByName', 'ExportFusionComp', 'FinalizeTake', 'GetClipColor', 'GetDuration', 'GetEnd', 'GetFlags', 'GetFusionCompByIndex', 'GetFusionCompByName', 'GetFusionCompCount', 'GetFusionCompNames', 'GetLeftOffset', 'GetMarkers', 'GetMediaPoolItem', 'GetName', 'GetRightOffset', 'GetSelectedTakeIndex', 'GetStart', 'GetStereoConvergenceValues', 'GetStereoLeftFloatingWindowParams', 'GetStereoRightFloatingWindowParams', 'GetTakeByIndex', 'GetTakesCount', 'GetVersionNames', 'ImportFusionComp', 'LoadFusionCompByName', 'LoadVersionByName', 'Print', 'RenameFusionCompByName', 'RenameVersionByName', 'SelectTakeByIndex', 'SetCDL', 'SetClipColor', 'SetLUT']


Any pointers to at least get me in the right direction to access this (must we say it?) awesome feature?

Thanks.
Offline

wakeforce

  • Posts: 20
  • Joined: Fri Jun 07, 2019 8:09 pm
  • Real Name: Jean-Philippe Allard

Re: Accessing Speedwarp Motion Estimation on a TimelineItem

PostTue Feb 04, 2020 8:43 pm

Still looking for a hand on this :/

DaVinci support is on it, but they suggested to ask around here as well.
Offline

wakeforce

  • Posts: 20
  • Joined: Fri Jun 07, 2019 8:09 pm
  • Real Name: Jean-Philippe Allard

Re: Accessing Speedwarp Motion Estimation on a TimelineItem

PostTue Feb 04, 2020 10:06 pm

Another approach I looked into is this:

1. Import all clips in the media pool.
2. Change frame rate of all clips to half their native frame rate.
3. Create huge timeline with all clips.
4. Apply Optical Flow and Speed Warp to one clip.
5. Copy and paste attributes to all other clips.

It's breaking on #6, which is rendering those clips. I can't render them as individual clips as it will remove the effect and only output half the frame rate. And I can't create separate timelines from the existing clips because Timeline.GetItemsInTrack() gives me TimelineItem objects, and I don't see any method for creating timelines out of that object type. The only timeline creation method I can find is MediaPool.CreateTimelineFromClips, and it needs a Clip object, not a TimelineItem object.

Anyone with some tips to get me out of this bind?
Offline
User avatar

Igor Riđanović

  • Posts: 1596
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: Accessing Speedwarp Motion Estimation on a TimelineItem

PostThu Feb 13, 2020 5:13 pm

wakeforce wrote:I can access motion estimation through the Project object, but trying to set project.SetSetting('imageMotionEstimationMode', 'speedWarp') returns False, and don't change anything to the project settings.

Looking through the available keys of a clip in GetClipProperty() doesn't give me a usable key for that either.

I suspect I need to find how to set it at the TimelineItem level, since this is where we set it in the Resolve GUI, but the API docs don't give me any method to access what I normally find in the inspector window (Retime and scaling --> Motion Estimation --> Speed Warp)


I can confirm all this. You're right that motion estimation mode must be set at TimelineItem level. If user could set it at media pool clip level it would not offer necessary granularity.

I can't find a suitable method to write the motion estimation mode on the TimelineItem level either.

Regarding your workaround, you can use GetMediaPoolItem() on a timeline item. You can iterate through the timeline, GetMediaPoolItem() on each and myNewTimeline.AppendToTimeline(). You could rebuild a timeline this way, but it would still not copy these properties that are intrinsic to timeline items like motion estimation mode.
www.metafide.com - DaVinci Resolve™ Apps
Offline

Kaso105

  • Posts: 1
  • Joined: Sun Jun 25, 2023 5:00 am
  • Real Name: Daniel Ponceleon

Re: Accessing Speedwarp Motion Estimation on a TimelineItem

PostSun Jun 25, 2023 5:02 am

Three years later i still looking for the same solution

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 30 guests