Exporting using the commandline

can someone from meltytech explain how i can use melt to export video? using my own preset on the command line, or point me to a place that?

am thinking something along the line of

melt --encodepreset=nwgatwebm --project=D:/Projects/nwgat-shotcut-project.mlt --export=D:/export/video.webm

I recently started using Shotcut and I think it is a great application. Thanks and congratulations to the Shotcut team!

Now I’m trying to make more use with Shotcut in an automated way from the command line. I want to export a video of a certain format, .mov, and only change one parameter, the frames per second (fps).

From what I’ve seen in a previous release, exporting from the command line using Shotcut is supposed to work. But it seems like it has to be done with melt. I’m able to export while in Shotcut using the various tabs like “Export File” and “Advanced”. This produces a .mp4 file which is fine, and I’ve been able to save the .mlt file.

I’m working with Macos 10.13 and 10.15. I can also use Linux, such as CentOS. I’m looking to be able to do something like this:

melt mysourcevideo.mov -fps=30.0 outputvideo.mp4

I’ve searched both in Shotcut and the the MLT site but I still haven’t found instructions or a working example. Thanks for any help.

There are detailed instructions to use the melt command line here:

Shotcut does NOT use the melt command line parameters to modify the export parameters. Rather, the MLT XML structure has a feature to embed the export parameters into an XML file that is passed to melt. The export XML looks exactly like the project file, but it has an additional <consumer> tag.

As a first step, export a project from Shotcut. In the Jobs panel, right click on the completed job and choose “View XML”. That will open a window that shows the contents of the export file. Compare the export file to the project file and you will see the subtle difference.

The command to export from the export file is simply: melt exportfile.mlt (of course, the name of the file is not actually “exportfile”).

1 Like

Thanks for the info. However, I had already reviewed the page with the melt command line instructions and there is no mention of “export” anywhere in the page. So that’s why I joined this forum.

And I did already export a project in Shotcut, then used the XML code to create a separate .mlt file, which I then used to pass to melt on the command line. This works.

But it only works for that particular input video file that was exported in Shotcut. Each video file might have a different parameter such as the dimensions, i.e. width and height.

So, can you tell me if it is possible to run the melt command on any given video file, and have it create an exported file with one different parameter such as the fps? As I wrote previously, I’d like to be able to do something like this:

melt mysourcevideo.mov -fps=30.0 outputvideo.mp4

Or does melt REQUIRE a .mlt file to be given on the command line as you wrote? If this is the case, then melt is not generally useful without some intervening code to modify a template .mlt file. I can do this, but I’d rather not, if melt can just figure out the needed parameters from the input video file.

FYI: To create the “export.mlt” file you do not have to wait for Shotcut’s export job to complete. You can start the export then Right-click the job and STOP it. The XML data will already have been created and you can then copy this to to the “export.mlt” file.

I think that editing MLT files is fraught with danger, so personally I would do it the way suggested.

If you are just looking for a video converter then Shotcut/melt isn’t necessarily the way to go. You could try using FFMPEG directly e.g.

ffmpeg -i mysourcevideo.mov -r 30 outputvideo.mp4

1 Like

Use the “-profile” flag to specify a video profile. You would have to redefine a profile for each configuration that you want.

That is not possible with melt. The profile is the only way to specify the fps

I agree. It sounds like the OP just wants FFMpeg.

Thanks to everyone for their feedback. It seems like the use of ffmpeg is the available solution. I was already thinking that melt did not have the general functionality for what I was trying to do. It would be helpful if this information were in the documentation of melt. And not just in forum comments.