Relinking Graphics

Do you have questions about Desktop Video, Converters, Routers and Monitoring?
  • Author
  • Message
Offline
User avatar

Krejue

  • Posts: 8
  • Joined: Wed Feb 08, 2023 10:37 am
  • Real Name: Jürg Krebs

Relinking Graphics

PostThu Mar 28, 2024 10:04 pm

[url]https://youtu.be/yFYfCm5m4BA
[/url]

We have some graphics, who do relink wrong or don't want to link. Its seems, Resolve does not check the filename or is confused about something. Most of our lower graphics do work, but some are completely wrong. That is very bad with a 50min documentary with 40 lowers, graphics, maps, titles, subtitles and more.

Because the original name disappears when linked to the wrong media, its not possible to find the right one later- of course, there is the conform lock fonction with the <!> to choose an other clip, but in this case it shows sometimes almost every clip in the system.

With a script we would like to reconnect the graphics by their name and length. There seems to be no way to link to clips to the timeline item. Any good ideas about our workaround?

Chatbot helped me so far, but nothing happens:

function findMatchingClipInMediaPool(name, duration)
local project = resolve:GetProjectManager():GetCurrentProject()
local mediaPool = project:GetMediaPool()
local rootFolder = mediaPool:GetRootFolder()

local function scanFolder(folder)
local clips = folder:GetClips()
for _, clip in pairs(clips) do
local clipProps = clip:GetClipProperty()
if clipProps["Clip Name"] == name and tonumber(clipProps["Frames"]) == duration then
return clip
end
end

local subFolders = folder:GetSubFolders()
for _, subFolder in pairs(subFolders) do
local matchingClip = scanFolder(subFolder)
if matchingClip then
return matchingClip
end
end
end

return scanFolder(rootFolder)
end

function relinkOfflineClips()
print("Starting to relink offline clips...")
local project = resolve:GetProjectManager():GetCurrentProject()
local timeline = project:GetCurrentTimeline()
if not timeline then
print("No timeline selected.")
return
end

local videoTrackIndex = 1 -- Example: using the first video track
local trackItems = timeline:GetItemListInTrack("video", videoTrackIndex)
if trackItems then
for _, item in ipairs(trackItems) do
local mediaPoolItem = item:GetMediaPoolItem()
if mediaPoolItem then -- Check if the timeline item is linked to a media pool item
local clipProps = mediaPoolItem:GetClipProperty()
if clipProps then
local offlineStatus = clipProps["Offline"]
local name = clipProps["Clip Name"]
local duration = tonumber(clipProps["Frames"])
if offlineStatus then
print("Attempting to relink: " .. name)
local matchingClip = findMatchingClipInMediaPool(name, duration)
if matchingClip then
-- Attempt to replace the media pool item of the timeline item with the matching one
if item:ReplaceMediaPoolItem(matchingClip) then
print("Successfully relinked offline clip: " .. name)
else
print("Failed to relink clip: " .. name)
end
else
print("No matching clip found for: " .. name)
end
end
end
else
print("Item does not have an associated media pool item or is offline.")
end
end
else
print("No items found in the specified track.")
end
print("Finished attempting to relink clips.")
end

relinkOfflineClips()
Attachments
Bildschirmfoto 2024-03-28 um 22.57.50.png
matching clip is there, why confused?
Bildschirmfoto 2024-03-28 um 22.57.50.png (226.67 KiB) Viewed 756 times
Offline
User avatar

Uli Plank

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

Re: Relinking Graphics

PostFri Mar 29, 2024 3:19 am

Can't help with this, but you may get more answers in the DaVinci Resolve subforum.
Now that the cat #19 is out of the bag, test it as much as you can and use the subforum.

Studio 18.6.6, MacOS 13.6.6, 2017 iMac, 32 GB, Radeon Pro 580
MacBook M1 Pro, 16 GPU cores, 32 GB RAM and iPhone 15 Pro
Speed Editor, UltraStudio Monitor 3G
Offline
User avatar

Marc Wielage

  • Posts: 11059
  • Joined: Fri Oct 18, 2013 2:46 am
  • Location: Hollywood, USA

Re: Relinking Graphics

PostFri Mar 29, 2024 4:30 am

Krejue wrote:We have some graphics, who do relink wrong or don't want to link. Its seems, Resolve does not check the filename or is confused about something. Most of our lower graphics do work, but some are completely wrong. That is very bad with a 50min documentary with 40 lowers, graphics, maps, titles, subtitles and more.

We had a 10-episode documentary series a few years ago where every episode was about 45 minutes long and had dozens and dozens of graphics in each episode (TIFF, PNG, JPG, maps, text, you name it). We ran into some workflow issues and finally decided that the problem was that these file formats didn't support timecode, so the lack of unique file names and the lack of timecode was a disaster waiting to happen.

Our solution was to transcode all the graphics to ProRes 444 (we have Mac systems), which supports an Alpha channel, and made sure the graphic file clips were longer than we'd ever need (say, :30 seconds for a :10 second shot), and it worked fine. We were then able to Media Manage, and nothing ever became unlinked or disconnected for any reason.

Now, this was back in the Resolve 17 days, and perhaps things are better now with Resolve 18.5 and 18.6. But that's my immediate suggestion and I know for a fact it can work.
marc wielage, csi • VP/color & workflow • chroma | hollywood
Offline
User avatar

Krejue

  • Posts: 8
  • Joined: Wed Feb 08, 2023 10:37 am
  • Real Name: Jürg Krebs

Re: Relinking Graphics

PostTue Apr 09, 2024 7:23 pm

Thats a good point- we will check that. In our case we have unic filenames who would fit perfectly with the missing media- but resolve ingnores them. And otherways does link it to some completely other media. Lets say: map_usa.mov gets linked to opener.mov

I assume in this case it ignores the filename and just compares the cliplengths.

Return to Post Production

Who is online

Users browsing this forum: IainPennington and 39 guests