Welcome to WSL!

New to the forum? Please read this and this.

Newbie question: to what extend can DaVinci Resolve edit sessions be automated?

User avatar
raarts
Posts: 2
Joined: Fri Apr 30, 2021 1:41 pm
Real name: Ron Arts

Newbie question: to what extend can DaVinci Resolve edit sessions be automated?

#1

Post by raarts »

Hi,

I am a Resolve Studio newbie (and enthusiast).

I have a bunch of video clips, explanatory texts, animations, images, and powerpoint presentations, and I would like to create education videos out of them targeting different audiences. So each audience needs a different selection from this stack of media. By the way some of this media needs to be updated on a regular basis.

I though a smart way to go about this would be to remotely script Resolve Studio to build the videos, but the Python API seems to be missing a lot, for example how to add effects, transitions and such.

So here's my question: what are the options to achieve what I want with Resolve Studio? I'm talking about creating a video from media from start to finish in a fully automated way. If scripting doesn't cut it, can it be done using C++ or by any other means?

Any recommendations greatly appreciated.

Thanks,
Ron Arts

User avatar
cyklotyk
Posts: 1
Joined: Sat Dec 26, 2020 2:57 am

Re: Newbie question: to what extend can DaVinci Resolve edit sessions be automated?

#2

Post by cyklotyk »

Python up to 3.6 can be used for scrpiting.

To play with "effects, transitions and such" look at AddFusionComp() funcion from DR API, and then AttTool() from "Fusion 8 Scripting Guide".

Generaly "Scripting API for DaVinci Resolve Studio" is for manipulating files, bins, building timelines (to some extent), rendering etc..

For effects etc. is "Fusion API". ("Fusion 8 Scripting Guide")

Example of creating "Fusion logo and subtitles structure":
  1.     newcomp = kl.GetFusionCompByIndex(1)
  2.  
  3.     newcomp.AddTool('MediaIn',1,1)
  4.     newcomp.AddTool('MediaIn',1,2)
  5.     newcomp.AddTool('Crop',1,3)
  6.     newcomp.AddTool('Background',1,4)
  7.     newcomp.AddTool('TextPlus',1,5)
  8.     newcomp.AddTool('Merge',2,1)
  9.     newcomp.AddTool('Merge',3,1)
  10.     newcomp.AddTool('Merge',4,1)
  11.     newcomp.AddTool('MediaOut',5,1)
  12.  
  13.      toolsy = newcomp.GetToolList()
  14.      iit = len(toolsy)+1
  15.  
  16.     for ii in range(1,iit):
  17.         pprint(str(ii)+' '+toolsy[ii].Name)
  18.         if (toolsy[ii].Name == 'MediaIn1'):
  19.             MediaInFilm = toolsy[ii]
  20.         if (toolsy[ii].Name == 'MediaIn2'):
  21.             MediaInLogo = toolsy[ii]
  22.         if (toolsy[ii].Name == 'MediaOut1'):
  23.             MediaOut = toolsy[ii]
  24.         if (toolsy[ii].Name == 'Text1'):
  25.             TextSubtiltle = toolsy[ii]
  26.         if (toolsy[ii].Name == 'Merge1'):
  27.             MergeFilmLogo = toolsy[ii]
  28.         if (toolsy[ii].Name == 'Merge2'):
  29.             MergeFilmBackground = toolsy[ii]
  30.         if (toolsy[ii].Name == 'Merge3'):
  31.             MergeFilmText = toolsy[ii]
  32.         if (toolsy[ii].Name == 'Background1'):
  33.             BackgroundSubtitle = toolsy[ii]
  34.         if (toolsy[ii].Name == 'Crop1'):
  35.             CropBackgroudSubtitle = toolsy[ii]
  36.  
  37.     MediaInLogo.MediaID = '6302e27e-b1b6-4ada-9864-a224895ff39a'
  38.     MergeFilmLogo.Size = 0.9
  39.     MergeFilmLogo.Center[0] = [0.1,0.9]
  40.     MergeFilmLogo.ApplyMode = 'Difference'
  41.    
  42.     TextSubtiltle.StyledText = str(klipnum)+'-'+'0123456789 '*5+"\nNext line" # any string you can imagine
  43.     Text1lines = 2
  44.     TextSubtiltle.Size = 0.05
  45.     TextSubtiltle.Center[0] = [0.5,0.14]
  46.     TextSubtiltle.Style = 'Semibold'
  47.  
  48.     BackgroundSubtitle.TopLeftAlpha = 0.5
  49.    
  50.     CropBackgroudSubtitle.YOffset =  900 ; # magic numbers
  51.     CropBackgroudSubtitle.YSize =  936 ;
  52.     MergeFilmLogo.FindMainInput(Background).ConnectTo(MediaInFilm.FindMainOutput(1))
  53.     MergeFilmLogo.FindMainInput(Foreground).ConnectTo(MediaInLogo.FindMainOutput(1))
  54.    
  55.     CropBackgroudSubtitle.FindMainInput(1).ConnectTo(BackgroundSubtitle.FindMainOutput(1))
  56.  
  57.     MergeFilmBackground.FindMainInput(Background).ConnectTo(MergeFilmLogo.FindMainOutput(1))
  58.     MergeFilmBackground.FindMainInput(Foreground).ConnectTo(CropBackgroudSubtitle.FindMainOutput(1))
  59.  
  60.     MergeFilmText.FindMainInput(Background).ConnectTo(MergeFilmBackground.FindMainOutput(1))
  61.     MergeFilmText.FindMainInput(Foreground).ConnectTo(TextSubtiltle.FindMainOutput(1))
  62.  
  63.      
  64.     MediaOut.FindMainInput(1).ConnectTo(MergeFilmText.FindMainOutput(1))
  65.    
  66.  

User avatar
raarts
Posts: 2
Joined: Fri Apr 30, 2021 1:41 pm
Real name: Ron Arts

Re: Newbie question: to what extend can DaVinci Resolve edit sessions be automated?

#3

Post by raarts »

Thanks!

I am coming into this from the DaVinci Resolve side without any prior experience.
I found the page describing the differences between Resolve and Fusion.
Am I right in assuming that all effects in the Effects Page are implemented using Fusion, even transitions?

I'm gonna look at the 'Fusion 8 Scripting Guide'.

Best,
Ron