Manually changing Resolve’s Media Pool file paths?

Recently I migrated a very big project from Resolve on Mac to my PC setup and needless to say the paths didn’t match up again. Because they were scattered among many subfolders, manually changing the source folder in the Media Pool wasn’t an option, even for “just” 76 source clips:

Changing the Source folder in Resolve
Changing the Source folder in Resolve

As you can see in the screenshot, Resolve still has the Path in a Mac fashion, namely /Volumes/[Disk Name]/ in front of it, whereas I need it the Windows format with the mounted drive letter instead, e.g. E:/. At least, the direction of the slashes (forward slashes in Mac paths, backslashes on Windows) doesn’t matter.

So I thought I’ll do it semi-automatically with a search/replace operation on the project file instead.

Creating a Resolve Disk Database
Creating a Resolve Disk Database

You see if your Resolve database is not a PostgreSQL or QPSQL but a disk database instead, it is possible to easily manipulate Resolve project files manually. A downside of this is a slightly slow performance when compared to the database solutions, but I am happy to wait a few seconds longer to save when I know that I can repair broken projects.

A typical Resolve project on disk
A typical Resolve project on disk

If you navigate to the project disk-database directory, users and projects are organized in a straightforward folder hierarchy. Each project folder consists of a couple of subfolders and XML-files that can be opened and edited in pretty much every text editor.

“Easy-peasy!”, I thought, “Just change the file-paths in Project.xml and I’m done!”, I thought. Sure enough, there were the paths in that file and a quick search-‘n’-replace run later, every /Volumes/ARPEGGIO B was substituted by E: (Arpeggio being the name of the project and respectively also the disk with the raw footage on it.)

By the way, my Project.xml file was 80 megs in size which is pretty hefty for just text, and your standard Windows notepad probably craps out trying to load such a huge file. I use Notepad++ for all my text-editing needs, no matter the file size.

Opening up my project again in Resolve still had all the files in the Media Pool connecting to the Mac path. So I opened up the other XMLs in the project database directory, looking for more occurrences but to no avail. In my desperation, I even ordered a batch search/replace run on all files in the project’s folder (165 files in my case) yet still without the desired result.

I’ll spare you with the details of my search for the solution, interesting is only that I found out where the Media Pool files’ path is stored. Here it goes:

Media Refs

In your project source folder, there’s a folder titled Media Refs which holds another folder, MpVideoClip in which you’ll find as many XMLs with funky UUID file names as you have media files in Resolve. Bingo!

However, on closer examination of any XML’s content there’s no entry for a media-clips’ file name or path to be found, only a bunch of other referenced UUIDs and long strings in hexadecimal:

Media-Ref XMLs
Media-Ref XMLs

And here’s the Kicker:

A clip’s file path (and other meta data) is actually encoded in these strings. Out of curiosity I pasted the content of the <Clip> tag into my trusty Hex Editor and, lo and behold, the file path showed up in the ASCII field:

The file path encoded as ASCII inside an XML (!)
The file path encoded as ASCII inside an XML (!)

Also worth mentioning the odd fact that every ASCII character is followed by a blank (“00”) which makes it even more annoying than necessary.

*Sigh*

In my Google research, I haven’t found a tool or any easy way to batch-edit the Media Refs XMLs to just change a clip’s path, the problem is just too darn particular. I mean, who would think to read a string of an UTF-8 XML and decode the numerals to ASCII?!

For now, as annoying as it might be, the easiest way is to manually edit the path names inside Resolve, at least it’s smart enough to detect the parts in file paths that are shared among media source files, so it’s not a big tragedy, at least.

However, if I come across this problem more often in the future, I might get busy programming a tool that lets you manipulate a clip’s path information quickly — and offers a batch functionality to just replace certain parts of a path automatically…


Posted

in

,

by