Page 1 of 2
Change Timecode for multiple clips at the same time.

Posted:
Mon Apr 30, 2018 1:56 am
by alpern
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon Apr 30, 2018 7:47 am
by Peter Chamberlain
That seems to be the reverse of what most users ask for. What’s your workflow need for this?
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Jan 28, 2020 8:20 pm
by timberthrax
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed Jan 29, 2020 1:07 am
by Igor Riđanović
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')
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed Jan 29, 2020 6:32 pm
by Jim Simon
timberthrax wrote:random timecode
That seems unlikely. Timecode would be useless were it random.
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon Feb 03, 2020 1:14 am
by timberthrax
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon Feb 03, 2020 1:15 am
by timberthrax
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Sat Jul 18, 2020 11:00 am
by GuillaumeH
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
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon Jul 27, 2020 6:17 pm
by dev_willis
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'])
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Jul 28, 2020 6:20 am
by Dwaine Maggart
This simplified script worked nicely for me, copy and pasted into the Console window.
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Jul 28, 2020 4:44 pm
by pinthenet
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
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Jul 28, 2020 5:58 pm
by Dwaine Maggart
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed Jul 29, 2020 9:02 am
by Marc Wielage
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed Jul 29, 2020 1:27 pm
by pinthenet
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....
Re: Change Timecode for multiple clips at the same time.

Posted:
Sat Sep 26, 2020 9:51 pm
by Ben Richardson
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']
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon Oct 19, 2020 12:02 am
by timberthrax
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?
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon Oct 19, 2020 1:27 am
by Uli Plank
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Fri Nov 13, 2020 4:33 pm
by Danilo Coelho
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
Re: Change Timecode for multiple clips at the same time.

Posted:
Sun Nov 15, 2020 7:53 am
by Igor Riđanović
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
Re: Change Timecode for multiple clips at the same time.

Posted:
Fri Feb 26, 2021 9:32 am
by Drasius Kupstys
Is there any chance that the scripts will work with DR17?
Re: Change Timecode for multiple clips at the same time.

Posted:
Fri Feb 26, 2021 3:21 pm
by Glenn Sakatch
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?
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Mar 02, 2021 9:11 am
by Igor Riđanović
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'))
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Mar 02, 2021 9:13 am
by Igor Riđanović
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Thu Mar 04, 2021 3:05 pm
by Drasius Kupstys
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'))
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon May 03, 2021 9:18 am
by Ariel_Brener
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?
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon May 03, 2021 10:07 am
by Uli Plank
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon May 03, 2021 7:06 pm
by Ariel_Brener
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon May 03, 2021 7:07 pm
by Ariel_Brener
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon May 03, 2021 10:04 pm
by Andy Mees
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed May 05, 2021 8:11 am
by Ariel_Brener
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed May 05, 2021 8:34 am
by Vit Reiter
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
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed May 05, 2021 10:02 am
by ReneRotterdam
-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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed May 05, 2021 12:21 pm
by Vit Reiter
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Thu May 27, 2021 12:19 pm
by Mylonas Films
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Thu May 27, 2021 5:37 pm
by Sergey Mirontsev
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")):
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Jun 01, 2021 11:48 am
by Mylonas Films
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
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Jun 01, 2021 4:50 pm
by Sergey Mirontsev
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"))
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Jun 01, 2021 10:08 pm
by Mylonas Films
[/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
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Nov 16, 2021 10:13 am
by Trevor Asquerthian
+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).
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed Dec 15, 2021 7:29 pm
by vanroyko
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
Re: Change Timecode for multiple clips at the same time.

Posted:
Tue Feb 15, 2022 9:01 pm
by TomFid
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))
Re: Change Timecode for multiple clips at the same time.

Posted:
Mon Apr 04, 2022 4:16 pm
by drafeirha
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?

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

Posted:
Fri Apr 15, 2022 5:09 pm
by jahaik
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
Re: Change Timecode for multiple clips at the same time.

Posted:
Sat Apr 16, 2022 2:52 pm
by Jim Simon
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Sat Apr 16, 2022 3:16 pm
by Andy Mees
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Thu Apr 21, 2022 11:16 am
by RossGill
Right click the file, click "clip attributes", change the timecode to 00:00:00:00
No script needed.

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

Posted:
Wed May 04, 2022 2:28 pm
by chrisbrearley
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Wed May 04, 2022 2:41 pm
by Tom Early
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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Fri May 06, 2022 8:45 am
by Uli Plank
@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.
Re: Change Timecode for multiple clips at the same time.

Posted:
Thu Dec 15, 2022 1:54 pm
by rhrn.ch
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
