xmlmlt

how to apply consumer info to a mlt file as shotcut does


I'm using both melt command line and shotcut to do video editing.

I'd like to check the xml by right click on the Jobs window, which sits on the right side of shotcut Application window, and click the "View XML" after the job has been done. Here is my xml. here is the xml

As you can see above. There are some information about consumer. So I save this as a mlt file named stackoverflow_1.mlt.

And I can get the same video file output as shotcut does if I do the command:

.\melt.exe .\stackoverflow_1.mlt -progress

This is absolutely fantastic! Because the mlt file generated by melt.exe directly doesn't has these message, so I needed to call melt twice to do the same thing before.

So I will show you how to do the same thing with melt.exe. Here is the thing, I prefer to generate a mlt file before exporting video. so I would type these commands:

The first step:

.\melt.exe .\buck_20s.mp4 in=00:00:04.160 out=00:00:09.440 -consumer xml:buck.mlt

here is my mlt file. The mlt file doesn't has the message about consumer.

The second step:

.\melt.exe .\buck.mlt -consumer avformat:buck_5s.mp4  

And you may ask why not just do it like this?

.\melt.exe .\buck_20s.mp4 in=00:00:04.160 out=00:00:09.440 -consumer avformat:buck_5s.mp4

Okay,that's definitely right. But that will generate nothing except the final video file and I want to the xml file to store the video-editing information.

the mlt file doesn't has the consumer info, So I can't just type like this:

.\melt.exe xxx.mlt  

So my question is how can I apply consumer info to mlt file use melt command line as shotcut does. I hope I have make it clear.


Solution

  • So my question is how can I apply consumer info to mlt file use melt command line as shotcut does.

    You can't. This is currently not implemented/supported by the melt command line utility.

    Shotcut adds the "consumer" element manually after creating the XML document: https://github.com/mltframework/shotcut/blob/master/src/docks/encodedock.cpp#L749