Resolve Python - Add Image Sequence Problem

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

Erkan Ozgur Yilmaz

  • Posts: 19
  • Joined: Tue May 02, 2017 6:28 pm

Resolve Python - Add Image Sequence Problem

PostTue Feb 02, 2021 3:46 pm

I'm trying to add new clips to the media storage in Resolve 16.2 & 17b7 using the Python API.

Appending any single video file is working without any problem. But appending an image sequence is not working.

My code is:

Code: Select all
from anima.env import blackmagic  # our own library for connecting to Resolve based on Blackmagic's own Python
resolve = blackmagic.get_resolve()
pm = resolve.GetProjectManager()
project = pm.GetCurrentProject()
media_storage = resolve.GetMediaStorage()

path = "/mnt/T/PROJECTS/BENI_COK_SEV/Sequences/BCS001/SCN001/Shots/BCS001_001_0830/Comp/Outputs/Main/v001/exr/BENI_COK_SEV_BCS001_001_0830_Comp_Main_v001.[000-019].exr"

media_storage.AddItemListToMediaPool(path)
# returns []
# and nothing is appended to the Media Bin

path1 = "/mnt/T/PROJECTS/BENI_COK_SEV/Sequences/BCS001/SCN001/Shots/BCS001_001_0830/Comp/Outputs/Main/v001/exr/BENI_COK_SEV_BCS001_001_0830_Comp_Main_v001.000.exr"

media_storage.AddItemListToMediaPool(path1)
# Doesn't raise any error in Python side
# but Resolve itself shows an error message with the following text
#
# Unable To Find Media
#
# DaVinci Resolve cannot find this media:
#
# /mnt/T/PROJECTS/BENI_COK_SEV/Sequences/BCS001/SCN001/Shots/BCS001_001_0830/Comp/Outputs/Main/v001/exr/BENI_COK_SEV_BCS001_001_0830_Comp_Main_v001.000.exr

# But if the only file in that folder is that single OpenEXR frame than it gets the item to the media storage


The problem persists in Windows and Linux and both in 16.2 and 17b7 versions of Resolve.
Offline

jensenni

  • Posts: 23
  • Joined: Wed Jan 27, 2021 12:26 am
  • Real Name: Jens Klein

Re: Resolve Python - Add Image Sequence Problem

PostTue Feb 02, 2021 4:13 pm

Hi Erkan, I have a similar problem. I didn't check image sequences yet but I am unable to import anything with the DVR API - using this function: AddItemsToMediaPool().

You said you were able to import video clips though and I was wondering if you could check out my post from this morning as I am having trouble figuring this out.

viewtopic.php?f=21&t=133336&p=721143#p721143

thank you!
Jens
Offline

jensenni

  • Posts: 23
  • Joined: Wed Jan 27, 2021 12:26 am
  • Real Name: Jens Klein

Re: Resolve Python - Add Image Sequence Problem

PostTue Feb 02, 2021 4:20 pm

oh wait, did you try this?

path = "/mnt/T/PROJECTS/BENI_COK_SEV/Sequences/BCS001/SCN001/Shots/BCS001_001_0830/Comp/Outputs/Main/v001/exr/BENI_COK_SEV_BCS001_001_0830_Comp_Main_v001.000.exr"

replace [000-019].exr
with 000.exr

Also, copy the path below into a terminal to see if you can reach the sequence (or if you get 'file not found' errors) -- just making sure...

/mnt/T/PROJECTS/BENI_COK_SEV/Sequences/BCS001/SCN001/Shots/BCS001_001_0830/Comp/Outputs/Main/v001/exr/BENI_COK_SEV_BCS001_001_0830_Comp_Main_v001.000.exr
Offline

Erkan Ozgur Yilmaz

  • Posts: 19
  • Joined: Tue May 02, 2017 6:28 pm

Re: Resolve Python - Add Image Sequence Problem

PostWed Feb 03, 2021 7:18 am

Hey @jensenni thanks for your reply.

As you see in my example I'm already referencing the exr sequence with 000.exr (the ``path1`` variable) and it only works if the only file on that folder is that single OpenEXR file. If we have multiple items either from that image sequence or another file, Resolve can not import it.

And yes I checked if the path exists. Also what strange is that when you import the sequence manually and then query what TimelineItem you have and then the path of that MediaPoolItem you get exactly the same path that includes the brackets (mnt/T/PROJECTS/BENI_COK_SEV/Sequences/BCS001/SCN001/Shots/BCS001_001_0830/Comp/Outputs/Main/v001/exr/BENI_COK_SEV_BCS001_001_0830_Comp_Main_v001.[000-019].exr)

We decided to try out exporting our data to XML/AAF (Timeline.Export()) and then importing the whole timeline back to Resolve through XML/AAF (Timeline.ImportIntoTimeline).

Until Blackmagic fixes this broken logic in the Python API.
Offline

张来吃_Lc

  • Posts: 10
  • Joined: Tue Nov 16, 2021 3:13 pm
  • Real Name: Zhang Qiushuang

Re: Resolve Python - Add Image Sequence Problem

PostSun Jan 02, 2022 7:36 am

I found that if the frame number is start with a "_"

Code: Select all
ABC_0010_v001_comp_0001.exr


instead of a "."

Code: Select all
ABC_0010_v001_comp.0001.exr


it can be imported.
Offline

Grayson99

  • Posts: 1
  • Joined: Sun Jun 12, 2022 10:45 am
  • Real Name: Rick Grayson

Re: Resolve Python - Add Image Sequence Problem

PostSun Jun 12, 2022 10:54 am

Hi, thanks for your answer, it’s very usefull

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 14 guests