Change Timecode for multiple clips at the same time.

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

alpern

  • Posts: 1
  • Joined: Mon Apr 30, 2018 1:33 am
  • Real Name: Justin Alpern

Change Timecode for multiple clips at the same time.

PostMon Apr 30, 2018 1:56 am

I'm looking for a way to change the starting time code all the clips in my media pool. I've found that this can be done a clip at a time by using clip attributes but that very time consuming and I have 100's of clips.

Basically I need every clip to have starting timecode 00:00:00:00. Any help would be awesome.
Offline

Peter Chamberlain

Blackmagic Design

  • Posts: 14914
  • Joined: Wed Aug 22, 2012 7:08 am

Re: Change Timecode for multiple clips at the same time.

PostMon Apr 30, 2018 7:47 am

That seems to be the reverse of what most users ask for. What’s your workflow need for this?
DaVinci Resolve Product Manager
Offline

timberthrax

  • Posts: 50
  • Joined: Wed Nov 07, 2018 4:26 pm
  • Real Name: Sam Garfield

Re: Change Timecode for multiple clips at the same time.

PostTue Jan 28, 2020 8:20 pm

I also need this because I will often get a bunch of clips from a videographer that have random timecode, then I'll get a paper edit or .edl with timestamps based off of every clip starting at 00:00:00:00. To make it work I need to reset all the clips.
Offline
User avatar

Igor Riđanović

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

Re: Change Timecode for multiple clips at the same time.

PostWed Jan 29, 2020 1:07 am

You can do this using the scripting:

Code: Select all
bin = mediapool.GetCurrentFolder()
clips = bin.GetClips()
for i in clips:
    i.SetClipProperties('Start TC', '00:00:00:00')
www.metafide.com - DaVinci Resolve™ Apps
Offline

Jim Simon

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

Re: Change Timecode for multiple clips at the same time.

PostWed Jan 29, 2020 6:32 pm

timberthrax wrote:random timecode


That seems unlikely. Timecode would be useless were it random.
My Biases:

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

timberthrax

  • Posts: 50
  • Joined: Wed Nov 07, 2018 4:26 pm
  • Real Name: Sam Garfield

Re: Change Timecode for multiple clips at the same time.

PostMon Feb 03, 2020 1:14 am

Igor Riđanović wrote:You can do this using the scripting:

Code: Select all
bin = mediapool.GetCurrentFolder()
clips = bin.GetClips()
for i in clips:
    i.SetClipProperties('Start TC', '00:00:00:00')


I love you.
Offline

timberthrax

  • Posts: 50
  • Joined: Wed Nov 07, 2018 4:26 pm
  • Real Name: Sam Garfield

Re: Change Timecode for multiple clips at the same time.

PostMon Feb 03, 2020 1:15 am

Jim Simon wrote:
timberthrax wrote:random timecode


That seems unlikely. Timecode would be useless were it random.


Random in the sense of - I don't use it so it just is whatever it is.
Offline
User avatar

GuillaumeH

  • Posts: 13
  • Joined: Sat Jul 18, 2020 10:10 am
  • Location: Malmö, Sweden
  • Real Name: Guillaume Hullin

Re: Change Timecode for multiple clips at the same time.

PostSat Jul 18, 2020 11:00 am

For anybody that look for the answer.
Code: Select all
#!/usr/bin/ python

import sys

sys.path.append("/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting/Modules")
import DaVinciResolveScript as dvr_script

try:
    resolve = dvr_script.scriptapp("Resolve")
    pm = resolve.GetProjectManager()
    proj = pm.GetCurrentProject()
    tl = proj.GetCurrentTimeline()
    mp = proj.GetMediaPool()
    rootfolder = mp.GetRootFolder()
    rootclips = rootfolder.GetClips()
    ms = resolve.GetMediaStorage()
    folder = mp.GetCurrentFolder()
    clips = folder.GetClips()

except:
    print("Open the script file and copy/paste in DVR Console :)")
    sys.exit()

x = 0
y = 0

for i in clips:
    GetClipName = (clips[i].GetClipProperty("Clip Name"))["Clip Name"]
    GetStartTC = (clips[i].GetClipProperty("Start TC"))["Start TC"]
    x += 1
    if GetStartTC != "00:00:00;00":
        clips[i].SetClipProperty("Start TC", "00:00:00:00")
        print GetClipName
        y += 1

print
print 'End of script'
print 'Number of clip found:'
print x
print 'Number of "timecode start" modify:'
print y


I'm using DVR 16.2 Free with MacOS Mojave
Dell Precision M3800 with MacOS Mojave
Davinci Resolve 16.2 (Free)

https://www.youtube.com/guillaumehullin
Offline
User avatar

dev_willis

  • Posts: 126
  • Joined: Sun May 03, 2020 5:14 pm
  • Location: Lebanon, TN
  • Real Name: David Willis

Re: Change Timecode for multiple clips at the same time.

PostMon Jul 27, 2020 6:17 pm

Here's a simpler version which may be slightly easier to read for non-coders. This can be copy/pasted right into Resolve's console window as well; just make sure to select the "Py3" option at the top of the window.

Code: Select all
pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
mp = proj.GetMediaPool()
bin = mp.GetCurrentFolder()
clips = bin.GetClipList()

print('For ' + str(len(clips)) + ' clips in ' + bin.GetName())

for c in clips:
   result = ''
   
   if c.SetClipProperty('Start TC', '00:00:00:00'):
      result = '*success*'
   else:
      result = '!failed!!'
   
   print(result, c.GetClipProperty('Start TC')['Start TC'], c.GetClipProperty('File Name')['File Name'])
  • Windows 10 Pro 22H2, Resolve Studio 19.1.4, Nvidia Studio Driver 572.83
  • Threadripper 3960X, RTX 3090 FE, 64GB RAM, 3x 980PRO SSDs
  • Threadripper 1920X, GTX 1070 Ti, 32GB RAM, 3x 960PRO SSDs
  • TrueNAS Mini XL media server
  • Mac Mini M1 project server
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 13236
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: Change Timecode for multiple clips at the same time.

PostTue Jul 28, 2020 6:20 am

This simplified script worked nicely for me, copy and pasted into the Console window.
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

pinthenet

  • Posts: 145
  • Joined: Mon May 18, 2020 3:23 pm
  • Real Name: John Payne

Re: Change Timecode for multiple clips at the same time.

PostTue Jul 28, 2020 4:44 pm

Does this only work in the Studio version? I modified Guillaume's script (Py2) to run on Windows but both scripts fail (I assume) on the 4th clip. Then I get the "Project not saved, Cancel, Save, Don't save" dialog and DR exits. If I select save it doesn't save the changes it says it made, Cancel doesn't cancel the shutdown.

I checked the logs & found this
Code: Select all
Assertion failed: m_EnableStartTimecode, file ClipAttributes\UiClipAttributesViewImp.cpp, line 626
[0x00000254] | Main                 | INFO  | 2020-07-28 18:32:19,685 | Caught termination signal SIGABRT, triggering termination routine



==========[CRASH DUMP]==========
Please send this to support:

#TIME Tue Jul 28 18:32:19 2020 - Uptime 00:06:24 (hh:mm:ss)
#PROGRAM_NAME DaVinci Resolve v16.2.4.016 (Windows/MSVC)

00007FF70D71B39A
00007FF70D6F8DF2
00007FF70D68CE92
00007FFC919AEE1D
00007FFC919B4A14
00007FFC919B5D5F
00007FF70F98DD7B
00007FF70F9B3DF0
00007FF70F2337F1
00007FF70FE76A41
00007FF70FE727EF
000001942DD64DE4
000001942DD63409
000001942DD659C8
000001942DD42A25
0000019496154803


And a crash dump file https://www.dropbox.com/s/aroqiu3t7a0z8cm/098a4360-3981-41a2-bf9f-9532a73a2e7c.dmp?dl=0
[size=85]
PC: Intel i5-12600K /32GB/RTX3060-12GB
Windows 11 Pro; NVIDIA 552.22 Studio; Resolve+Fusion 19B
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 13236
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: Change Timecode for multiple clips at the same time.

PostTue Jul 28, 2020 5:58 pm

I tested David's simplified script on Windows 16.2.4 free version and it worked OK.

Can you test that in the Console window, set to Py3?

Verified that this works on both the Studio and free versions of 16.2.4 on Windows.

Note that you'd want to do this with the clips in the Media Pool, before creating a timeline.
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline
User avatar

Marc Wielage

  • Posts: 13263
  • Joined: Fri Oct 18, 2013 2:46 am
  • Location: Palm Springs, California

Re: Change Timecode for multiple clips at the same time.

PostWed Jul 29, 2020 9:02 am

timberthrax wrote:
Igor Riđanović wrote:You can do this using the scripting:

Code: Select all
bin = mediapool.GetCurrentFolder()
clips = bin.GetClips()
for i in clips:
    i.SetClipProperties('Start TC', '00:00:00:00')


I love you.

A lot of people say that to Igor.
Certified DaVinci Resolve Color Trainer • AdvancedColorTraining.com
Offline

pinthenet

  • Posts: 145
  • Joined: Mon May 18, 2020 3:23 pm
  • Real Name: John Payne

Re: Change Timecode for multiple clips at the same time.

PostWed Jul 29, 2020 1:27 pm

The simplified P3 script fails the same way, but

Note that you'd want to do this with the clips in the Media Pool, before creating a timeline.


suggests that I'm misunderstanding how/when to use the script. I just ran it on a 'sandbox' project that I use to try out techniques and it already has a mix of timelines, adjustment clips, compounds, and fusion clips as well as video & image clips. Maybe that's why it's failing, I could imagine that there are implications if I change the TC on a clips that's already in use....
[size=85]
PC: Intel i5-12600K /32GB/RTX3060-12GB
Windows 11 Pro; NVIDIA 552.22 Studio; Resolve+Fusion 19B
Offline

Ben Richardson

  • Posts: 3
  • Joined: Sun Apr 16, 2017 2:03 pm

Re: Change Timecode for multiple clips at the same time.

PostSat Sep 26, 2020 9:51 pm

For those struggling with the "Python 3.6 not found" issue in Resolve 16.x.x, here is a Python 2 version of the same, simplified script.

(I don't know Python well, I just ran the script through a utility called 3to2.)

This has worked for me, using the Py2 tab of the Console.

Code: Select all
pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
mp = proj.GetMediaPool()
bin = mp.GetCurrentFolder()
clips = bin.GetClipList()

print u'For ' + unicode(len(clips)) + u' clips in ' + bin.GetName()

for c in clips:
   result = u''
   
   if c.SetClipProperty(u'Start TC', u'00:00:00:00'):
      result = u'*success*'
   else:
      result = u'!failed!!'
   
   print result, c.GetClipProperty(u'Start TC')[u'Start TC'], c.GetClipProperty(u'File Name')[u'File Name']
Offline

timberthrax

  • Posts: 50
  • Joined: Wed Nov 07, 2018 4:26 pm
  • Real Name: Sam Garfield

Re: Change Timecode for multiple clips at the same time.

PostMon Oct 19, 2020 12:02 am

I've tried all versions posted above. The simplified script begins working but then eventually crashes Resolve. I noticed it was crashing on the same clip each time. Moving the offending clip to another bin helped get past it, but ultimately I wasn't able to get the script to complete without crashing.

Uploaded my logs here: https://drive.google.com/file/d/1UNIRBp ... sp=sharing

What are the chances of just getting fcpxml import working properly in Resolve without the need for workarounds?
Offline
User avatar

Uli Plank

  • Posts: 25457
  • Joined: Fri Feb 08, 2013 2:48 am
  • Location: Germany and Indonesia

Re: Change Timecode for multiple clips at the same time.

PostMon Oct 19, 2020 1:27 am

It'll only work with proper TC, there is no other way. If your clips are all starting at zero, they have to TC at all.
There are programs which can insert a pseudo-TC by looking at the creation time. I'm using Kyno, but this one is cheaper: https://hdcinematics.com/wnorton/
Of course, this has to be done before editing in either NLE.
My disaster protection: export a .drp file to a physically separated storage regularly.
www.digitalproduction.com

Studio 19.1.3
MacOS 13.7.4, 2017 iMac, 32 GB, Radeon Pro 580 + eGPU
MacBook M1 Pro, 16 GPU cores, 32 GB RAM, MacOS 14.7.2
SE, USM G3
Offline

Danilo Coelho

  • Posts: 36
  • Joined: Fri Oct 21, 2016 9:14 pm
  • Location: Brazil

Re: Change Timecode for multiple clips at the same time.

PostFri Nov 13, 2020 4:33 pm

Did someone tested this with Resolve 17? I've tested and got this error message:

Py3> pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
mp = proj.GetMediaPool()
bin = mp.GetCurrentFolder()
clips = bin.GetClipList()

print('For ' + str(len(clips)) + ' clips in ' + bin.GetName())

for c in clips:
result = ''

if c.SetClipProperty('Start TC', '00:00:00:00'):
result = '*success*'
else:
result = '!failed!!'

print(result, c.GetClipProperty('Start TC')['Start TC'], c.GetClipProperty('File Name')['File Name'])
For 12 clips in VALSA
Traceback (most recent call last):
File "<nofile>", line 17, in <module>
TypeError: string indices must be integers
Offline
User avatar

Igor Riđanović

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

Re: Change Timecode for multiple clips at the same time.

PostSun Nov 15, 2020 7:53 am

Danilo Coelho wrote:Did someone tested this with Resolve 17? I've tested and got this error message:


print(result, c.GetClipProperty('Start TC')['Start TC'], c.GetClipProperty('File Name')['File Name'])
For 12 clips in VALSA
Traceback (most recent call last):
File "<nofile>", line 17, in <module>
TypeError: string indices must be integers


Yes. GetClipProperty() has changed in V17 in a non-backwards compatible way. See: viewtopic.php?f=36&t=125528
www.metafide.com - DaVinci Resolve™ Apps
Offline
User avatar

Drasius Kupstys

  • Posts: 14
  • Joined: Sun Oct 14, 2018 3:24 pm
  • Location: Klaipeda, Lithuania
  • Real Name: Drasius Kupstys

Re: Change Timecode for multiple clips at the same time.

PostFri Feb 26, 2021 9:32 am

Is there any chance that the scripts will work with DR17?
Offline
User avatar

Glenn Sakatch

  • Posts: 743
  • Joined: Sat Apr 13, 2013 5:36 pm

Re: Change Timecode for multiple clips at the same time.

PostFri Feb 26, 2021 3:21 pm

Thats an interesting use of a script there Igor.

I do shudder when I think about changing every clip I have to 00:00:00:00 timecode, but if that is how you want to work...

I have had instances where I needed to subtract 1 frame from each clips timecode because of an audio sync issue. (recorded audio tc was 1 frame out from recorded video tc)

Could a script be used to subtract (or add) a number of frames instead?
Offline
User avatar

Igor Riđanović

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

Re: Change Timecode for multiple clips at the same time.

PostTue Mar 02, 2021 9:11 am

Drasius Kupstys wrote:Is there any chance that the scripts will work with DR17?



yes, just replace with this (but then it will not work in V15 and V16:

Code: Select all
print(result, c.GetClipProperty('Start TC'), c.GetClipProperty('File Name'))
www.metafide.com - DaVinci Resolve™ Apps
Offline
User avatar

Igor Riđanović

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

Re: Change Timecode for multiple clips at the same time.

PostTue Mar 02, 2021 9:13 am

Glenn Sakatch wrote:Thats an interesting use of a script there Igor.

I do shudder when I think about changing every clip I have to 00:00:00:00 timecode, but if that is how you want to work...

I have had instances where I needed to subtract 1 frame from each clips timecode because of an audio sync issue. (recorded audio tc was 1 frame out from recorded video tc)

Could a script be used to subtract (or add) a number of frames instead?


To offset the clip timecode by a frame? Yes you can do that.
www.metafide.com - DaVinci Resolve™ Apps
Offline
User avatar

Drasius Kupstys

  • Posts: 14
  • Joined: Sun Oct 14, 2018 3:24 pm
  • Location: Klaipeda, Lithuania
  • Real Name: Drasius Kupstys

Re: Change Timecode for multiple clips at the same time.

PostThu Mar 04, 2021 3:05 pm

Igor Riđanović wrote:yes, just replace with this (but then it will not work in V15 and V16:

Code: Select all
print(result, c.GetClipProperty('Start TC'), c.GetClipProperty('File Name'))


Najlepša hvala!
Many thanks for sharing your experience.
The following scrpt works with Py2:
Code: Select all
pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
mp = proj.GetMediaPool()
bin = mp.GetCurrentFolder()
clips = bin.GetClipList()

print u'For '  u' clips in ' + bin.GetName()

for c in clips:
   result = u''
   
   if c.SetClipProperty(u'Start TC', u'00:00:00:00'):
      result = u'*success*'
   else:
      result = u'!failed!!'
   
   
   print(result, c.GetClipProperty('Start TC'),
   c.GetClipProperty('File Name'))
Offline
User avatar

Ariel_Brener

  • Posts: 18
  • Joined: Thu Apr 22, 2021 11:01 am
  • Real Name: Ariel Brener

Re: Change Timecode for multiple clips at the same time.

PostMon May 03, 2021 9:18 am

Is there still no in-program script-free solution?
Like in premiere pro where you just mark the clips that you want to set their starting Timecodes and change it at one click?
Using Mac Studio Ultra
Offline
User avatar

Uli Plank

  • Posts: 25457
  • Joined: Fri Feb 08, 2013 2:48 am
  • Location: Germany and Indonesia

Re: Change Timecode for multiple clips at the same time.

PostMon May 03, 2021 10:07 am

I think it's not high on their to-do list, since most people want their TC preserved of it's correct or will need to correct it on a clip by clip basis if there's something wrong. It' a pretty rare case you are asking for.
My disaster protection: export a .drp file to a physically separated storage regularly.
www.digitalproduction.com

Studio 19.1.3
MacOS 13.7.4, 2017 iMac, 32 GB, Radeon Pro 580 + eGPU
MacBook M1 Pro, 16 GPU cores, 32 GB RAM, MacOS 14.7.2
SE, USM G3
Offline
User avatar

Ariel_Brener

  • Posts: 18
  • Joined: Thu Apr 22, 2021 11:01 am
  • Real Name: Ariel Brener

Re: Change Timecode for multiple clips at the same time.

PostMon May 03, 2021 7:06 pm

Uli Plank wrote:I think it's not high on their to-do list, since most people want their TC preserved of it's correct or will need to correct it on a clip by clip basis if there's something wrong. It' a pretty rare case you are asking for.


As you can see there are plenty of people trying to workaround the lack of this feature with scripts...
So IMO this is needed, also it's not that difficult to add, they can use the already available menu. they just need to un-gray-out the option when selecting multiple clips.
Using Mac Studio Ultra
Offline
User avatar

Ariel_Brener

  • Posts: 18
  • Joined: Thu Apr 22, 2021 11:01 am
  • Real Name: Ariel Brener

Re: Change Timecode for multiple clips at the same time.

PostMon May 03, 2021 7:07 pm

Using Mac Studio Ultra
Offline

Andy Mees

  • Posts: 4115
  • Joined: Wed Aug 22, 2012 7:48 am

Re: Change Timecode for multiple clips at the same time.

PostMon May 03, 2021 10:04 pm

Back in the day I worked on a system that simply let you choose/switch between zero offset timecode or embedded timecode in the viewer. It was handy feature. Not sure which system it was tho... maybe Aurora. Seem to recall that legacy FCP used to have the option of choosing which timecode source to show (in the overlays), so you could effectively set and use an auxiliary timecode track to navigate your clips instead of the standard embedded timecode. Not quite as straightforward but still handy when working with producers who hand you offset timecodes instead of embedded.

Got to say I'd very much prefer that BMD took a similarly non destructive approach in implementing zero offset timecode usability in Resolve ie allow users to view and use zero offset timecodes natively when necessary without having to actually change / reset the clips timecode.
Let's have a return to the glory days, when press releases for new versions included text like "...with over 300 new features and improvements that professional editors and colorists have asked for."
Offline
User avatar

Ariel_Brener

  • Posts: 18
  • Joined: Thu Apr 22, 2021 11:01 am
  • Real Name: Ariel Brener

Re: Change Timecode for multiple clips at the same time.

PostWed May 05, 2021 8:11 am

Andy Mees wrote:Got to say I'd very much prefer that BMD took a similarly non destructive approach in implementing zero offset timecode usability in Resolve ie allow users to view and use zero offset timecodes natively when necessary without having to actually change / reset the clips timecode.


Hi Andy - Adobe Premiere Pro has this feature.
When I change the timecode - Premiere still saves the original TC

- Too bad Resolve doesn't have this.

Maybe they will change it. I hope so.
Attachments
Screen Shot 2021-05-05 at 11.06.59.png
Alt TC
Screen Shot 2021-05-05 at 11.06.59.png (125.05 KiB) Viewed 24960 times
Screen Shot 2021-05-05 at 11.07.29.png
Original TC
Screen Shot 2021-05-05 at 11.07.29.png (125.2 KiB) Viewed 24960 times
Using Mac Studio Ultra
Offline

Vit Reiter

  • Posts: 1010
  • Joined: Mon Sep 04, 2017 5:36 pm

Re: Change Timecode for multiple clips at the same time.

PostWed May 05, 2021 8:34 am

Andy Mees wrote:Back in the day I worked on a system that simply let you choose/switch between zero offset timecode or embedded timecode in the viewer. It was handy feature. Not sure which system it was tho... maybe Aurora. Seem to recall that legacy FCP used to have the option of choosing which timecode source to show (in the overlays), so you could effectively set and use an auxiliary timecode track to navigate your clips instead of the standard embedded timecode. Not quite as straightforward but still handy when working with producers who hand you offset timecodes instead of embedded.

Got to say I'd very much prefer that BMD took a similarly non destructive approach in implementing zero offset timecode usability in Resolve ie allow users to view and use zero offset timecodes natively when necessary without having to actually change / reset the clips timecode.
+1
DaVinci Resolve 18.6.6 Studio (macOS Monterey 12.7.6)
Mac Pro 2013, AMD FirePro D700, 64GB RAM

Film Editor, Colorist, DIT, Datalab technician
linkedin.com/in/vít-reiter-film-editor
Offline
User avatar

ReneRotterdam

  • Posts: 72
  • Joined: Wed Mar 03, 2021 2:48 pm
  • Location: Netherlands
  • Real Name: Rene A. Hazekamp

Re: Change Timecode for multiple clips at the same time.

PostWed May 05, 2021 10:02 am

-1 (minus one)

I'm not a big fan of features that hardly anyone uses and I think the scripting solutions above are more than adequate.

All the more so because the previously mentioned solution in Premiere 16 ? ( which I used 2, 3 years ago) was accompanied by a huge pile of bugs and timecode inconsistencies once you started syncing with audio. Got into that mess when editing a long form documentary, with a lot of timecode-less audio.
Rene A. Hazekamp

HP Z840 // 2x E2680v4 // RTX 4070 // Studio 18.5.1
Macbook air M1
Offline

Vit Reiter

  • Posts: 1010
  • Joined: Mon Sep 04, 2017 5:36 pm

Re: Change Timecode for multiple clips at the same time.

PostWed May 05, 2021 12:21 pm

ReneRotterdam wrote:-1 (minus one)
All the more so because the previously mentioned solution in Premiere 16 ? ( which I used 2, 3 years ago) was accompanied by a huge pile of bugs and timecode inconsistencies once you started syncing with audio. Got into that mess when editing a long form documentary, with a lot of timecode-less audio.
This is standard in Avid and Final Cut Pro 7 and works without the mess you mentioned above.
DaVinci Resolve 18.6.6 Studio (macOS Monterey 12.7.6)
Mac Pro 2013, AMD FirePro D700, 64GB RAM

Film Editor, Colorist, DIT, Datalab technician
linkedin.com/in/vít-reiter-film-editor
Offline
User avatar

Mylonas Films

  • Posts: 77
  • Joined: Mon Aug 05, 2019 5:41 am
  • Location: Central Coast - Australia
  • Real Name: Stephen Mylonas

Re: Change Timecode for multiple clips at the same time.

PostThu May 27, 2021 12:19 pm

is there a way to change the timecode to the' Date modified' time, with a script? Replace the 00:00:00:00 with the words "Date Modified' maybe? or is that wishful thinking.

I've used All VideoToolsheds tools like 'QTchange' to do this but Davinci won't recognise the new Timecode unless VideoToolSheds software re-renders the files out before bringing it into Davinci.

I'm filming with a tentacle system which works well but when it's off during Broll shots sometimes the TC goes back to normal on the camera which wasn't set properly.
-----------------------------------------
stephen.mylo@gmail.com
DOP/Colorist
DaVinci Resolve V20
Windows 10 Pro 64-bit (10.0, Build 19041)
GeForce RTX 2070Super Gaming OC 8GB
Intel(R) Core(TM) i9-10920X CPU @ 3.50GHz (24 CPUs)
Memory: 132GB RAM
Offline
User avatar

Sergey Mirontsev

  • Posts: 256
  • Joined: Sun Mar 12, 2017 9:18 am
  • Location: Moscow, Russia

Re: Change Timecode for multiple clips at the same time.

PostThu May 27, 2021 5:37 pm

Mylonas Films wrote:is there a way to change the timecode to the' Date modified' time, with a script? Replace the 00:00:00:00 with the words "Date Modified' maybe? or is that wishful thinking.

I've used All VideoToolsheds tools like 'QTchange' to do this but Davinci won't recognise the new Timecode unless VideoToolSheds software re-renders the files out before bringing it into Davinci.

I'm filming with a tentacle system which works well but when it's off during Broll shots sometimes the TC goes back to normal on the camera which wasn't set properly.

You need to add the line
Code: Select all
from datetime import datetime
to the beginning of the script.
And instead code
Code: Select all
if c.SetClipProperty(u'Start TC', u'00:00:00:00'):
you need
Code: Select all
modified = datetime.strptime(c.GetClipProperty('Date Modified'), "%a %b %d %H:%M:%S %Y")
if c.SetClipProperty('Start TC', modified.strftime("%H:%M:%S:00")):
Blackmagic Design Certified Master Trainer

Blackmagic Pocket Cinema Camera (Samyang 12mm Cine, 35mm Cine)
DaVinci Resolve Studio 17.4.4.0007
Speed Editor 1.4.1
Windows 10 Pro 21H1, i7-7700, 32Gb RAM, SSD, GeForce GTX 1080 Ti 11Gb (471.68 Studio)
Offline
User avatar

Mylonas Films

  • Posts: 77
  • Joined: Mon Aug 05, 2019 5:41 am
  • Location: Central Coast - Australia
  • Real Name: Stephen Mylonas

Re: Change Timecode for multiple clips at the same time.

PostTue Jun 01, 2021 11:48 am

Thanks serg. I have never used Python script before, so I'll probably give up, but When I pasted in your script it didn't work. I'm using DR V17.2 and Python2.
This is my script I pasted. I'm sure I put some things wrong that you gave me. If you reply, I'll try your result one more time and that's it. I'll give up.
I pasted this: *remember, this is for changing timecode to 'Date Modified'

Code: Select all
from datetime import datetime

pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
mp = proj.GetMediaPool()
bin = mp.GetCurrentFolder()
clips = bin.GetClipList()

print u'For '  u' clips in ' + bin.GetName()

for c in clips:
   result = u''
   
   modified = datetime.strptime(c.GetClipProperty('Date Modified'), "%a %b %d %H:%M:%S %Y")
if c.SetClipProperty('Start TC', modified.strftime("%H:%M:%S:00")):
      result = u'*success*'
   else:
      result = u'!failed!!'
   
   
  print(result, c.GetClipProperty('Start TC'), c.GetClipProperty('File Name'))


and the error I got was:
Code: Select all
 File "<nofile>", line 17
    else:
        ^
IndentationError: unindent does not match any outer indentation level
-----------------------------------------
stephen.mylo@gmail.com
DOP/Colorist
DaVinci Resolve V20
Windows 10 Pro 64-bit (10.0, Build 19041)
GeForce RTX 2070Super Gaming OC 8GB
Intel(R) Core(TM) i9-10920X CPU @ 3.50GHz (24 CPUs)
Memory: 132GB RAM
Offline
User avatar

Sergey Mirontsev

  • Posts: 256
  • Joined: Sun Mar 12, 2017 9:18 am
  • Location: Moscow, Russia

Re: Change Timecode for multiple clips at the same time.

PostTue Jun 01, 2021 4:50 pm

Mylonas Films wrote:Thanks serg...
My version:
Code: Select all
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from datetime import datetime

currentProject = resolve.GetProjectManager().GetCurrentProject()
mediaPool = currentProject.GetMediaPool()
currentBin = mediaPool.GetCurrentFolder()
clips = currentBin.GetClipList()
for clip in clips:
    print clip.GetClipProperty('File Name')
    created = datetime.strptime(clip.GetClipProperty('Date Created'), "%a %b %d %H:%M:%S %Y")   
    clip.SetClipProperty('Start TC', created.strftime("%H:%M:%S:00"))
Blackmagic Design Certified Master Trainer

Blackmagic Pocket Cinema Camera (Samyang 12mm Cine, 35mm Cine)
DaVinci Resolve Studio 17.4.4.0007
Speed Editor 1.4.1
Windows 10 Pro 21H1, i7-7700, 32Gb RAM, SSD, GeForce GTX 1080 Ti 11Gb (471.68 Studio)
Offline
User avatar

Mylonas Films

  • Posts: 77
  • Joined: Mon Aug 05, 2019 5:41 am
  • Location: Central Coast - Australia
  • Real Name: Stephen Mylonas

Re: Change Timecode for multiple clips at the same time.

PostTue Jun 01, 2021 10:08 pm

[/quote]My version:[/quote]

Oh my, That worked! You're a legend. At 1st i pasted in the top part you wrote (since I don't understand python) -
#!/usr/bin/env python
# -*- coding: utf-8 -*-


But then tried again without the top part and just started with
from datetime import datetime

and it worked!

incase anyone is wondering, Python2 , DR V17.2
-----------------------------------------
stephen.mylo@gmail.com
DOP/Colorist
DaVinci Resolve V20
Windows 10 Pro 64-bit (10.0, Build 19041)
GeForce RTX 2070Super Gaming OC 8GB
Intel(R) Core(TM) i9-10920X CPU @ 3.50GHz (24 CPUs)
Memory: 132GB RAM
Offline

Trevor Asquerthian

  • Posts: 679
  • Joined: Sun May 11, 2014 10:03 am

Re: Change Timecode for multiple clips at the same time.

PostTue Nov 16, 2021 10:13 am

+1 I just wanted to do the same thing - burnt in timecode from screeners was e.g. 12:xx:xx:xx for roll 12 - HiRes supplied is 00:xx:xx:xx - be easier to conform if I could batch adjust clips.

Avid has multiple Aux timecodes for this too (as well as being able to adjust start).
Offline

vanroyko

  • Posts: 3
  • Joined: Wed Dec 15, 2021 4:51 pm
  • Real Name: Van Royko

Re: Change Timecode for multiple clips at the same time.

PostWed Dec 15, 2021 7:29 pm

Can any of you serious geniuses write me a script that will offset the timecode by a certain value that I have calculated in adavnce. Ie- I want to had 03:49:12:03 to every starting tc of clips in a bin. This is for Resolve 17.

Anyone know how to do that??

Thanks in advance
Offline

TomFid

  • Posts: 1
  • Joined: Tue Feb 15, 2022 8:45 pm
  • Real Name: Tom Fiddaman

Re: Change Timecode for multiple clips at the same time.

PostTue Feb 15, 2022 9:01 pm

Here's my version of the script provided by Sergey, which elaborates quite a bit. It includes a fixed offset option, per vanroyko's request. See the comments in the script for details.

Code: Select all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ^ probably don't need that junk

# Set timecode from creation date for files in bin
# Also provides for a fixed time offset to be added to all files
# Tom Fiddaman, 2022
# Adapted from https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=73220#p765251
# MIT License https://opensource.org/licenses/MIT

# Notes
#
# To use, navigate to the clip bin desired, then run in the console.
# Be sure to select Py3 mode in the console toolbar.
#
# Default below is preview = True, which will only print the proposed timecode changes.
# To actually change the tcs, set preview=False.
#
# I found that getting the right start TC required subtracting clip duration from the
# create date, because the file is timestamped at the end of recording.
# There is an option for that below, controlled by subtractDuration=True.
#
# A fixed offset can be added/subtracted from all create times.
# Look up datetime.timedelta for additional options (days, weeks, etc.)
#
# I've used this myself in a very limited way. It should be safe, but ...
# For anything mission-critical, you should have backup copies of your work.
# Note that original Start TC metadata will be lost,
# and frame # data is ignored, so it's accurate only to 1s.
#
# On Fuji and Olympus cameras, and probably lots of others,
# you can avoid the need for this script by changing the timecode setting
# to "free run" in the menu system.
#
# In free Resolve, this probably only works in the internal console.

from datetime import datetime, timedelta

# if preview = true, files won't be changed
# set to False to actually execute the change
preview = True

# creation date may represent end of clip rather than start
subtractDuration = True

# fixed offset to add to all files
# negative values work
offset = timedelta(hours=0, minutes=0, seconds=0)

# todo : add filtering by filename or type

# in the console, resolve should be predefined - see https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=113252
# external use might require an api call
currentProject = resolve.GetProjectManager().GetCurrentProject()
mediaPool = currentProject.GetMediaPool()
currentBin = mediaPool.GetCurrentFolder()
clips = currentBin.GetClipList()
for clip in clips:
    try:
        # could also use 'Date Modified' though for camera clips likely to match creation date
        created = datetime.strptime(clip.GetClipProperty('Date Created'), "%a %b %d %Y %H:%M:%S")
        # the original used the format string "%a %b %d %H:%M:%S %Y" (year at end) - this may be an OS or regional difference
       
        if subtractDuration:
            # note %f is milliseconds in datetime whereas timecode has frames, but not using it anyway
            duration = datetime.strptime(clip.GetClipProperty('Duration'), '%H:%M:%S:%f')
            delta = timedelta(hours=duration.hour, minutes=duration.minute, seconds=duration.second)
            created = created-delta
            created = created+offset
           
        print(clip.GetClipProperty('File Name')+' Start TC = '+clip.GetClipProperty('Start TC')+' -> '+created.strftime("%H:%M:%S:00"))
       
        if preview == False:  # actually do it
            clip.SetClipProperty('Start TC', created.strftime("%H:%M:%S:00"))
    except ValueError as err:  # arises for things like timelines that don't have a create date
        print(clip.GetClipProperty('File Name')+' skipped')
        print('\t'+format(err))
Offline

drafeirha

  • Posts: 22
  • Joined: Wed Feb 17, 2021 12:06 pm
  • Location: Luxembourg
  • Real Name: Steve Peffer

Re: Change Timecode for multiple clips at the same time.

PostMon Apr 04, 2022 4:16 pm

dev_willis wrote:Here's a simpler version which may be slightly easier to read for non-coders. This can be copy/pasted right into Resolve's console window as well; just make sure to select the "Py3" option at the top of the window.

Code: Select all
pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
mp = proj.GetMediaPool()
bin = mp.GetCurrentFolder()
clips = bin.GetClipList()

print('For ' + str(len(clips)) + ' clips in ' + bin.GetName())

for c in clips:
   result = ''
   
   if c.SetClipProperty('Start TC', '00:00:00:00'):
      result = '*success*'
   else:
      result = '!failed!!'
   
   print(result, c.GetClipProperty('Start TC')['Start TC'], c.GetClipProperty('File Name')['File Name'])



I am looking for a solution to assign the starting timecode of 0:00 to all the clips in the media pool and stumbled upon this post. I tried to use the scripts you guys have posted here but I have no idea how. I have no scripting experience whatsoever. I am working on Mac, Apple Silicone, MacOS Monterey.

So what I've done is I downloaded and installed Python 3.6. I copied a script from here, then went into Resolve > Workspace > Console. Inside the console I selected Python3, pasted the script into the typing field and pressed enter. The script shows up inside the console, but nothing happens. No error messages either. What am I doing wrong? I tested all the scripts you guys have posted here but nothing works.

I also tried pasting the script into Sublime Text, saved it as a .py file in the Scripts directory and inside Resolve > Workspace > Scripts > Comp, my script file shows up and is selectable, but when I click on it, nothing happens.

What am I missing? :(
Offline

jahaik

  • Posts: 2
  • Joined: Fri Apr 15, 2022 5:01 pm
  • Real Name: Jeremy Haik

Re: Change Timecode for multiple clips at the same time.

PostFri Apr 15, 2022 5:09 pm

ReneRotterdam wrote:-1 (minus one)

I'm not a big fan of features that hardly anyone uses


A lot of us get timecode notes from non-editors or creative directors who just open up a clip in QuickTime or whatever and have no way to reference the actual timecode. its INCREDIBLY common and this would be a very useful feature
Offline

Jim Simon

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

Re: Change Timecode for multiple clips at the same time.

PostSat Apr 16, 2022 2:52 pm

jahaik wrote:A lot of us get timecode notes from non-editors or creative directors who just open up a clip in QuickTime or whatever and have no way to reference the actual timecode.
Not a fan of that argument, especially if it's being used to justify spending BMD development resources.

The best solution is for everyone to do it correctly. In this case, that means Window Dubs.

If a client wastes their time doing it wrong and then has to do it again correctly, that's not for BMD to solve.
My Biases:

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

Andy Mees

  • Posts: 4115
  • Joined: Wed Aug 22, 2012 7:48 am

Re: Change Timecode for multiple clips at the same time.

PostSat Apr 16, 2022 3:16 pm

Jim Simon wrote:If a client wastes their time doing it wrong and then has to do it again correctly, that's not for BMD to solve.
I'm not a fan of that argument in this instance.

Zero offset timecode references are an all too common mistake/occurence, and whilst I routinely have to instruct producers to rectify their error, adding a simple zero offset display option to the (Source) Viewer in the Edit/Cut Page (ie not changing timecode) would be an easy feature for the BMD folks to implement and a valuable addition to the software's core edit functionality.
Let's have a return to the glory days, when press releases for new versions included text like "...with over 300 new features and improvements that professional editors and colorists have asked for."
Offline

RossGill

  • Posts: 1
  • Joined: Thu Apr 21, 2022 11:12 am
  • Real Name: Ross Gillespie

Re: Change Timecode for multiple clips at the same time.

PostThu Apr 21, 2022 11:16 am

Right click the file, click "clip attributes", change the timecode to 00:00:00:00

No script needed.

:)
Offline

chrisbrearley

  • Posts: 199
  • Joined: Tue Nov 05, 2013 2:19 pm

Re: Change Timecode for multiple clips at the same time.

PostWed May 04, 2022 2:28 pm

Still no built-in solution for this? Just been handed 2 XMLs from Final Cut X, footage shot on A7S. Looks like FCX has used a TC of 00:00:00:00 for all the clips which I need to replicate.
Offline

Tom Early

  • Posts: 2719
  • Joined: Wed Jul 17, 2013 11:01 am

Re: Change Timecode for multiple clips at the same time.

PostWed May 04, 2022 2:41 pm

jahaik wrote:
ReneRotterdam wrote:-1 (minus one)

I'm not a big fan of features that hardly anyone uses


A lot of us get timecode notes from non-editors or creative directors who just open up a clip in QuickTime or whatever and have no way to reference the actual timecode. its INCREDIBLY common and this would be a very useful feature


Surely that would be just one file though? i.e. modify your timeline timecode to match it.

I remember having to change the timecode on a load of clips in Avid once using the aux timecode feature, and it was certainly very handy that I could do this, but I can't remember why though i.e. what it was all for.

More recently, I have had to change timecode on multiple ref qt files before (because if the ref is a codec that doesn't contain timecode it won't match the timeline it corresponds to), and also multiple timelines, and being restricted to one at a time was a definite pain, so +1 for batch timecode reprocessing, and also for maintaining the original tc when dealing with clips.
MBP2021 M1 Max 64GB, macOS 15.1, Resolve Studio 19.1 build 12
Output: UltraStudio 4K Mini, Desktop Video 12.7
Offline
User avatar

Uli Plank

  • Posts: 25457
  • Joined: Fri Feb 08, 2013 2:48 am
  • Location: Germany and Indonesia

Re: Change Timecode for multiple clips at the same time.

PostFri May 06, 2022 8:45 am

@Chris
Normally I get TC across from files used in FCP. Could you check if those originals had TC with a tool like MediaInfo? Maybe it was switched off in the camera, which is a bad idea for any workflow.
My disaster protection: export a .drp file to a physically separated storage regularly.
www.digitalproduction.com

Studio 19.1.3
MacOS 13.7.4, 2017 iMac, 32 GB, Radeon Pro 580 + eGPU
MacBook M1 Pro, 16 GPU cores, 32 GB RAM, MacOS 14.7.2
SE, USM G3
Offline

rhrn.ch

  • Posts: 113
  • Joined: Thu Jun 06, 2019 10:37 am
  • Real Name: Jonathan Moy de Vitry

Re: Change Timecode for multiple clips at the same time.

PostThu Dec 15, 2022 1:54 pm

RossGill wrote:Right click the file, click "clip attributes", change the timecode to 00:00:00:00

No script needed.

:)


Just a few thousand times! It's easy and you have nothing better todo :ugeek:
Next

Return to DaVinci Resolve

Who is online

Users browsing this forum: Frank Feijen, marcoos, panos_mts and 400 guests