antiboredom / videogrep

automatic video supercuts with python
https://antiboredom.github.io/videogrep
Other
3.35k stars 256 forks source link

XML Compatibility and Combining CL Args? #118

Open jet3004 opened 1 year ago

jet3004 commented 1 year ago

As a FCP editor, I was very pleased to see videogrep's xml compatibility as mentioned. However, I have never been able to import any of its generated files.

  1. I cannot use the generated xml files from --output xyz.xml with FCP X 10.6.5, they are simply grayed out when trying to import them. Are they compatible or am I missing something?

  2. How do I, if possible, generate the .xml alongside, say, a .mp4? Trying --output xyz.mp4, --output xyz.xml doesn't work.

  3. Not exactly related to the above but might as well ask alongside – can I use multiple search types in one command? If I wanted to combine both fragment and sentence based commands in one. Though I might out them put them in the order I want like this but doesn't seem to produce that: videogrep --input xyz.mp4 --search 'x box' --search-type fragment --search 'x box' --search-type sentence --randomize --output xyznew.mp4

Bonus Q: How does one use 'randomize' when using videogrep as a module? Trying to add it to scripts like 'only_silence.py' etc

Thanks!

antiboredom commented 1 year ago

Hi!

  1. It's possible that it's just not working on FCP. I've tested on Premiere and Resolve but don't have FCP on my computer (funny just assumed it would be OK!). I'd love to figure out what's going wrong though. If you have any thoughts please let me know!!
  2. You can't export them at the same time right now, you'd need to run the command once for each type of output
  3. At the moment you can't combine search types...

Bonus: see the answer here: https://github.com/antiboredom/camera-motion-detector/issues/2

jet3004 commented 1 year ago

Thank you so much! Appreciate your time but also the instruction, really helps to learn.

  1. I did some digging and, in short:, found out: “ FCPX doesn’t support the legacy XML format used by Premiere
Note: Final Cut Pro XML version 1.10 or later is required for the [object tracking](https://support.apple.com/guide/final-cut-pro/intro-to-object-tracking-vera2cbb5ce9/10.6.2/mac/11.5.1) and [Cinematic mode video](https://support.apple.com/guide/final-cut-pro/intro-to-cinematic-mode-video-verfbc56356d/10.6.2/mac/11.5.1) features introduced in Final Cut Pro 10.6. When you export FCPXML using version 1.10 or later, Final Cut Pro uses FCPXML bundles, which have the filename extension .fcpxmld.
From: https://support.apple.com/guide/final-cut-pro/use-xml-to-transfer-projects-verdbd66ae/mac

https://developer.apple.com/documentation/professional_video_applications/content_and_metadata_exchanges_with_final_cut_pro

This is a thing so I guess it’s pretty known — Bummer!

2 & 3. Good to know! Inspired by a bunch of times I thought both fragment + sentence outputs were better paired together.

Bonus: Ok, this was helpful -- going to try it now on some patterns! Makes sense on that (appreciate you answering there) but, to keep it in its respective repos – how then would it differ in, say, pattern_matcher.py when using videogrep directly? I assume you don't need to import random because you have already called videogrep. So then, how do you '--randomize' as a module, presumably here:

videogrep.videogrep(
    videos, searches, search_type="fragment", output="pattern_matcher.mp4"
)

Appreciate it!

antiboredom commented 1 year ago

Interesting! Maybe I can add an option for the newer format...

For pattern_matcher.py you are correct, you can just tell videogrep to randomize them directly by changing that line to:

videogrep.videogrep(
    videos, searches, search_type="fragment", output="pattern_matcher.mp4", random_order=True
)
antiboredom commented 1 year ago

note to self: for making finalcut pro work, take a look at:

https://github.com/WyattBlue/auto-editor/blob/441307b4d37fea9c3b9569a51598e1c44c289674/auto_editor/formats/final_cut_pro.py