3

I'm trying to translate metadata I have on video and audio files into an FCP XML file, that would be readable by most NLEs (though my main target is Premiere Pro). The PP SDK is terribly documented and confusing as hell, and I don't really need to create a panel, but rather to run a python script that would create an XML file that details the necessary bins, the relevant files in each (video and audio) and create some sequences from those files with specific start time (I know the sync point of the seperate audio and video). It's simply XML but I can't find a decent specification of how that XML should look like.

I know this might be kind of a big question for SO, but I really don't know where to start. There's a lot of things about this subject as far as extracting and reading FCP XML files with scripts, but building one is a different animal altogether. The official FCP XML docs don't mention anything about bins and general project hierarchy.

I tried creating my required result in Premiere Pro and then exporting an FCP XML, hoping to reverse engineer it, but it's filled to the brim with confusing information. You can see the whole thing here: https://codebeautify.org/xmlviewer/cb9a1a1f

I can't tell what's needed here, what I can get rid off, and how to rebuild this with a simple python script in a way that Premiere would understand.

What am I to do? I just need a hint of the right direction. I've been banging my head at the wall for so long now. I need some help. Please.

2
  • did you ever make progress with this? I"d love to hear more if you have. I'm in a similar boat and have been trying to reverse engineer Premiere's FCP7 use and it's just filled with gotchas. Commented Nov 30, 2020 at 5:06
  • @russellaugust No, I thought about trying to create a python library to manage it, but the example XML I exported from the video editor was so obtuse, and the docs are pretty much non-existent it was very frustrating. If you have fresh ideas I'm open to hear them Commented Dec 6, 2020 at 19:54

1 Answer 1

1

For the python modules I would go with: "xml.etree.ElementTree" and "re"

check this link for more detailes: How to convert .txt file into xml file using python?

I would start small. Create a very simple timeline in PP with only 1 track and 2 video clips (no audio). Export this data to xml and find out how PP builds the timeline as an xml.

In the file you added you can see under the "clipitem" tag there's some metadata which you can change. try changing the duration for example. play around with this until you will get a better understanding of the xml structure.

Then you can start using python's ElementTree to parse the xml elements and replace the data with re.

Its a tedious job and there is no short way about it. In fact if your goal is to build complex timelines using xml edits I really think its an endless task, that's why GUI's are for. but to extract data and maybe building some simple edits, it is worth a try.

I have just finished a small project with BMD Resolve where I had to insert titles with an xml and got good results using this method.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.