Python - Import file sequence into MediaPool (.dng)

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline

jensenni

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

Python - Import file sequence into MediaPool (.dng)

PostWed Jan 27, 2021 5:12 am

Hi All,
is there a way to import a file sequence (BMCC .dng) via python into a specific folder in the media pool?

I tried this via terminal:

import DaVinciResolveScript as dvr
resolve = dvr.scriptapp('Resolve')
pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
tl = proj.GetCurrentTimeline()
mp = proj.GetMediaPool()
ms = resolve.GetMediaStorage()
ms.AddItemsToMediaPool('/Volumes/RAID/DATA/MEDIA/TWO_CHAIRS/DAY02/FW_A01_2020-12-08_2051_C0000/FW_A01_2020-12-08_2051_C0000_[000000-032898].dng')

... and that didn't work of course :)

DNG Folder File Structure is:
FW_A01_2020-12-01_2000_C0021_000000
FW_A01_2020-12-01_2000_C0021_000001
FW_A01_2020-12-01_2000_C0021_000002
FW_A01_2020-12-01_2000_C0021_000003
...etc.

Thank you so much!
Jens
_______________
macOS 10.13.2
DVR 15.3.1
python 3.6
Offline
User avatar

Igor Riđanović

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

Re: Python - Import file sequence into MediaPool (.dng)

PostWed Jan 27, 2021 6:30 am

Try W_A01_2020-12-08_2051_C0000_000000.dng for the file name.

You need to run SetCurrentFolder() on the mp instance to set the current bin. AddItemsToMediaPool() will import to the current bin, whether that bin is set manually in the UI or by the script.

You also don't need to make an instance of the timeline in this case. It doesn't do anything right now.
www.metafide.com - DaVinci Resolve™ Apps
Offline

jensenni

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

Re: Python - Import file sequence into MediaPool (.dng)

PostWed Jan 27, 2021 7:22 am

FW_A01_2020-12-08_2051_C0000_000000.dng as the filename did the trick :). Thank you!
Offline

jensenni

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

Re: Python - Import file sequence into MediaPool (.dng)

PostTue Feb 02, 2021 1:29 pm

Hi Igor, could you take a look at this post if you get a chance?
I tried the DVR API documentation on a small issue I have and
couldn't find anything on that topic. I thought you might be able
to guide me in the right direction.

viewtopic.php?f=21&t=133336&p=721060#p721060

Return to DaVinci Resolve

Who is online

Users browsing this forum: Bing [Bot], Fully_Loaded34, Mads Johansen, panos_mts, sjubussen and 289 guests