mifi / lossless-cut

The swiss army knife of lossless video/audio editing
https://losslesscut.app/
GNU General Public License v2.0
27.9k stars 1.35k forks source link

Issues importing EDL and XML files from Davinci Resolve #811

Closed jaaaamIron closed 2 years ago

jaaaamIron commented 3 years ago

Hi. This looks like an amazing piece of software. I'm having issues using the EDL or XML import.

Here is what I am doing.

Davinci Resolve 17 -> File -> Export -> TImeline, and then choosing .edl

When I try to import I get the message, "Failed to load segments (Invalid EDL data found)". I've had a look at the EDL and here is what it says (looks fairly standard to me, and loads elsewhere).

TITLE: Timeline 1 selects
FCM: NON-DROP FRAME

001  AX       V     C        00:00:00:00 00:00:07:17 01:00:00:00 01:00:07:17  
* FROM CLIP NAME: Flowers.mov

002  AX       V     C        00:00:07:17 00:00:13:00 01:00:07:17 01:00:13:00  
* FROM CLIP NAME: Flowers.mov

I've also tried the same with XML import, both with the old style .xml (Final Cut Pro 7), which gives me the error "Failed to load segments (Cannot read property 'children' of undefined)", and with the more recent .fcpxml file.

It's probable I am just doing this wrong, but I can't really find anything in the documentation much about these features. Can you give me some pointers? Thanks!

mifi commented 3 years ago

I don't know what is that format you posted, so I don't think that is supported. You can see a sample Final Cut XMEML file here: https://github.com/mifi/lossless-cut-fixtures/blob/master/Final%20Cut%20Pro%20XMEML.xml

Maybe you could share one of your XML files, then I can see if I understand why it can't find children.

mrolappe commented 3 years ago

regarding the FCP XML import: I had the same problem/error message. Looking at the Apple documentation that was linked in the source (edlFormats.js/parseXmeml) I saw that the problem is the function unconditionally expecting the sequence element as child of a project.children element hierarchy.

After inspecting a sample export from DaVinci Resolve I saw that the exported XML did not contain the project.children element hierarchy but a sequence element as direct child of the xmeml element.

According to the documentation the sequence element as direct xmeml element child is also valid.

To cut a long story short: The timeline import seemed to work fine after adjusting the access path for the parse XML result (i.e. change to xml.xmeml.sequence.media.video.track.clipitem).

It might be sufficient to just conditionally handle these two paths in the code.

mrolappe commented 3 years ago

One more thing: parseXmeml should use the clipitems' in and out attributes instead of the start and end attributes. Otherwise deleted parts/clips are not considered and the clips resulting from the import are wrong.

mifi commented 2 years ago

I think this can be closed