%markername as filename multiple clip export

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

TimElschner

  • Posts: 38
  • Joined: Mon Nov 12, 2018 2:46 pm
  • Real Name: Tim Elschner

%markername as filename multiple clip export

PostWed May 18, 2022 2:16 pm

Use Case:
We have an FAQ Session with multiple sections (with markers) which we need as individual clips exported.
The name of the clip should be the %markernotes
So if we have a marker with the note "What to do next"
we want the filename to be "what to do next.mp4"

Resolve SEEMS to be so close to enable this feature since there are the % variables BUT the delivery page does not produce any usefull output. If you choose individual clips you will get all clips and video layers individual. The naming of the output files does not reflect the %markernotes or %markername. (see attachment)

Am I doing anything wrong or do I really have to write a python script to create the Render Queue by %makernote with markerlength?

Request:
Please add an option to export multiple clips (as the full composed output) with %markername or %variablename
Screenshot 2022-05-18 154739.jpg
Screenshot 2022-05-18 154739.jpg (452.47 KiB) Viewed 3368 times


Screenshot 2022-05-18 160850.jpg
Screenshot 2022-05-18 160850.jpg (281.53 KiB) Viewed 3368 times
Last edited by TimElschner on Wed May 18, 2022 4:09 pm, edited 1 time in total.
Offline

Jim Simon

  • Posts: 35602
  • Joined: Fri Dec 23, 2016 1:47 am

Re: %markername as filename multiple clip export

PostWed May 18, 2022 2:19 pm

Try using Single clip mode with In/Out points.
My Biases:

You NEED training.
You NEED a desktop.
You NEED a calibrated (non-computer) display.
Offline

TimElschner

  • Posts: 38
  • Joined: Mon Nov 12, 2018 2:46 pm
  • Real Name: Tim Elschner

Re: %markername as filename multiple clip export

PostWed May 18, 2022 4:07 pm

Jim Simon wrote:Try using Single clip mode with In/Out points.


of course you can name every single clip by hand and set manually in and out points
but I am looking for an automated way.
Offline
User avatar

Igor Riđanović

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

Re: %markername as filename multiple clip export

PostWed May 18, 2022 7:57 pm

You can do this using scripting. I'm just writing something of the sort right now. It takes some information from the timeline
name, timeline metadata, and from the markers to build render paths, filenames, and render jobs.
www.metafide.com - DaVinci Resolve™ Apps
Offline

safron

  • Posts: 1
  • Joined: Tue Mar 07, 2023 5:22 pm
  • Real Name: Eric Blum

Re: %markername as filename multiple clip export

PostTue Mar 07, 2023 5:35 pm

I had a very similar desire to auto generate ~30 render jobs from marker start to end with the marker name as the filename.

I attached the simple python script I made to accomplish this for my use case in case someone has a similar desire

It only renders markers attached to clips since that was more convenient for my workflow but it wouldn't be hard to adapt it to include timeline markers

Code: Select all
C:/ProgramData/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Utility/ExportMarkers.py

#!/usr/bin/env python3
print("Running ExportMarkers Script")

# resolve2 = dvr_script.scriptapp("Resolve")

project = resolve.GetProjectManager().GetCurrentProject()

if not project:
    print("No project is loaded")
    sys.exit()

timeline = project.GetCurrentTimeline()

video_tracks = timeline.GetTrackCount("video")
audio_tracks = timeline.GetTrackCount("audio")

exports = []



for i in range(video_tracks):
    video_clips = timeline.GetItemListInTrack("video", i+1)
    for clip in video_clips:
        marker_offset = clip.GetStart()
        markers = clip.GetMarkers()
        if markers:
            # e.g. {'color': 'Blue', 'duration': 4906, 'note': '', 'name': 'Ambassadors of Audacity', 'customData': ''}
            for frame, marker in markers.items():
                if marker['duration'] > 1:
                    exports.append((frame, marker_offset, marker))


for i in range(audio_tracks):
    clips = timeline.GetItemListInTrack("audio", i+1)
    for clip in clips:
        marker_offset = clip.GetStart()
        markers = clip.GetMarkers()
        if markers:
            # e.g. {'color': 'Blue', 'duration': 4906, 'note': '', 'name': 'Ambassadors of Audacity', 'customData': ''}
            for frame, marker in markers.items():
                if marker['duration'] > 1:
                    exports.append((frame, marker_offset, marker))


for frame, offset, export in exports:
    print(frame, export)
    project.SetRenderSettings({
        "SelectAllFrames": False,
        "MarkIn": frame + offset,
        "MarkOut": frame + offset + export['duration'] - 1,
        "CustomName": export["name"],
    })
    project.AddRenderJob()
Offline

dimsum

  • Posts: 105
  • Joined: Sat Feb 29, 2020 4:14 pm
  • Real Name: Dimitar Pouchnikov

Re: %markername as filename multiple clip export

PostTue May 09, 2023 2:17 pm

safron wrote:I had a very similar desire to auto generate ~30 render jobs from marker start to end with the marker name as the filename.


This is great! Exactly what I was looking for. Thanks so much for posting!

Here is a script for green timeline markers, if anyone may need it

Code: Select all
project_manager = resolve.GetProjectManager()
project = project_manager.GetCurrentProject()

timeline = project.GetCurrentTimeline()
markers = timeline.GetMarkers()

# get marker frames, green only and names
mf = []

for frame,marker in markers.items():
    if marker['color'] == "Green":
        mf.append((frame, marker['name']))

mf.append((timeline.GetEndFrame(),"end")) #add end

# iterate through list, skipping last item used only for end frame
for i in range(len(mf)-1):
        project.SetRenderSettings({
            "SelectAllFrames": False,
            "MarkIn": mf[i][0],
            "MarkOut": mf[i+1][0],
            "CustomName": f"{i:02}-" + mf[i][1],
        })
        print(i)
        project.AddRenderJob()
youtube.com/uhstudio | uhstudio.com
Win11, RTX 4 series
Offline
User avatar

JasonTheRoberts

  • Posts: 9
  • Joined: Mon May 22, 2023 9:50 pm
  • Location: Western Australia
  • Real Name: Jason Roberts

Re: %markername as filename multiple clip export

PostThu Jul 13, 2023 5:10 am

Hi I just made a vid showing how to do this with a LUA script so you don't have to install Python:
My Resolve tutorials: https://www.youtube.com/playlist?list=PLF3XxzX27iiJ9HY0NVJ24A9BHQ7vW7Aue
Offline
User avatar

DerPaule13

  • Posts: 99
  • Joined: Tue Sep 24, 2019 8:28 am
  • Real Name: Paul Kuno

Re: %markername as filename multiple clip export

PostMon Oct 21, 2024 3:29 pm

dimsum wrote:Here is a script for green timeline markers, if anyone may need it

Thank you! Unfortunately I couldn't get it to work for me.
Over at steakunderwater.com from user white_wizard I found another Py3 script that I modified a bit. This script is quite easy to use as all the individual parameters are at the top:

It renders all timeline markers with the specified color, uses their duration to set in and out points and uses their name for the exported file name. Specifying a Render Preset is also possible.
Important: It does NOT jump to the next timeline marker. Instead, it renders the duration of each individual timeline marker! (Use alt+left click on a marker to adjust its duration.)

I also added a prefix option for the file name and corrected a line so that all timeline markers are rendered if no color is specified.
I also added the list of timeline marker color names in the correct order so you don't have to look them up every time.

Code: Select all
#######CUSTOM PARAMETERS########
#Choose render path in delivery page first! Then:
marker_filter = 'Green' #choose which marker color to render. If no color is specified, all markers will get rendered.
#Timeline marker names in correct order are: Blue, Cyan, Green, Yellow, Red, Orange, Pink, Purple, Fuchsia, Rose, Lavender, Sky, Mint, Lemon, Sand, Cocoa, Cream
render_preset_name = '' #change this to the name of your render preset. Otherwise, the current settings will be used.
filename_prefix = '' #write something between quotes to add a prefix to the filename (e.g. 'Film 1 - ')
################################
 
pm = resolve.GetProjectManager()
project = pm.GetCurrentProject()
timeline = project.GetCurrentTimeline()
 
#set render preset
render_preset = project.LoadRenderPreset(render_preset_name)
 
#Get Markers
marker_offset = timeline.GetStartFrame()
markers = timeline.GetMarkers()
 
def renderjob_create( vfx_name, start_frame, end_frame ):
    render_settings = project.SetRenderSettings({'CustomName': vfx_name, 'MarkIn': start_frame, 'MarkOut': end_frame})
    project.AddRenderJob()  #add renderjob
 
for marker in markers:
    marker_color = markers[marker]['color']
 
    if not marker_filter or marker_filter.lower() == 'all' or marker_color == marker_filter:
        marker_name = markers[marker]['name']
        marker_startframe = marker + marker_offset
        marker_endframe = ( marker_startframe + markers[marker]['duration'] - 1 )
 
        print(f"Adding {marker_name} to Render Queue. Frames: {marker_startframe} - {marker_endframe}")
        renderjob_create(filename_prefix + marker_name, marker_startframe, marker_endframe)
DR 19.0 B69 (nice) | Win10 Pro 64 bit | AMD Ryzen 9 5900X | 64 GB RAM | Nvidia GTX 3090 (24 GB) (SD 560.81) | NAS 1621+ w/ SSDs | NAS 1819+ w/ HDDs (DR PostgreSQL DB) | Network & Internet via 10GbE LAN | Avira Anitvirus
Offline
User avatar

dsol1980

  • Posts: 72
  • Joined: Thu Aug 01, 2019 9:25 pm
  • Real Name: Daniel Solberg

Re: %markername as filename multiple clip export

PostWed May 07, 2025 2:53 pm

This guy's script works for any marker! use the scripting console Lua language and copy the code into there and voila you get a ton of render jobs in the cue based solely on timeline marker name.
https://jason-roberts-shop.fourthwall.c ... duct_shelf

Return to DaVinci Resolve

Who is online

Users browsing this forum: JimmyWilliams, RedRider14, Robert Niessner, uwe_sm and 296 guests