Command line / script control for batching videos

I am batch generating 100s of videos and wonder if there’s a way to control shotcut from the command line or python script / API etc?
Ideally i want to do simple cuts and cross fades between two videos, basic effects.
I’ve been using ffmpeg but it’s quite limited in what can be done.

Or any other similar tool recos, thanks!

/dc

It would be possible but you’d have to specify more details of exactly what you want. “Hacking” the .mlt files might not well supported at the moment and you might get ignored.

Whilst the .mlt format is technically xml, it isn’t that easy to work with at the moment although it is possible to do some rudimentary tasks with the python library bs4 if you know what you are doing.

What are you thinking you want to do? drop all the videos in a directory then add them together using a predefined transition ?

Hi and thanks!

So .mlt is some type of config format for an animation you can pass to shotcut? is that documented anywhere?

some of the things I want to do are:

  • combining still images with a fade/wipe/zoom or other transition. basically richer slideshows
  • take a still and apply a motion, like a zoom out or pan left to right
  • use a mask layer to combine two images

but basically this is for creating cool video effects for an app, so I’m also just interested in what low-hanging fruit I can do without too much complexity.

I guess ffmpeg with xfade has quite a lot of options but i was looking for a bit more headroom in what I could create
https://trac.ffmpeg.org/wiki/Xfade

Hi @D_C

Did you try the Slideshow Generator?

hi @MusicalBox !

while Slideshow Generator sounds promising, that looks like some kind of GUI?

I’m looking for an automated way to do all this from scripts on a server. eg a user uploads some photos and we send them back a cool animation/video with no human editing. Quite comfortable with various programmatic ways to do things, but looking for a tool I can invoke with params that will handle rendering such animations.

thanks!

1 Like

Like chatgpt ?

From what I can tell, Shotcut is very closely integrated with Qt which is a desktop framework. I don’t know how well that will play with Web Servers.

It’s a good idea but Shotcut typically presents itself as a front-end tool with a GUI rather than a backend tool for delivering videos.

Shotcut uses the MLT Framework under the hood. MLT includes a command line player called Melt. Shotcut actually uses Melt to export files. If you right click on an export job, you can see the MLT command line.

Melt works in two ways. You can either pass it an MLT file, or you can give it various command line options to implement tracks, splits, filters, etc.

If you want to do some scripting, I would recommend to write a script that authors MLT XML files and then pass those files to Melt to render them.

Not sure how to accomplish something you want in XML? Make a simple project in Shotcut and then inspect the XML to learn how it works.

MLT has SWIG bindings for Python and many other languages. There is very little documentation and no support. So it would be a self-taught learning process. In some cases, you have to inspect the underlying C code to understand how the API works.

This topic was automatically closed after 90 days. New replies are no longer allowed.