Determined by export but I want a mp4 automatically :-)

Hello,

I customized and custom export to my youtube videos … when I ask to export and choose file name but I want to have the extension as .mp4 and not determined by export as the screen shot below

thanks in advance for any help !

Yes, this is very frustrating.
A few weeks ago I spent several days in vain attempting this.

I tried many different things, settings in preset files and profile files, nothing worked (but I did learn many new and curios ways to break Shotcut).

It would be very nice if, when one created a custom preset or profile that is explicitly .mp4, that Shotcut would default the Export extension to .mp4, and that when one created a custom preset or profile that is explicitly .mov, that Shotcut would default the Export extension to .mov, etc.

It probably already works the way you want.

When creating a custom export preset, add this line to the text box before saving:

meta.preset.extension=mp4

When the project is exported, the file name dialog will say different things in the Type field depending on the operating system. On Linux for example, it always shows the FFmpeg short name of the container format rather than the meta extension. Windows just says “Determined by Export”. I’m pretty sure this has more to do with the difficulties of invoking platform-specific Save-As dialog boxes than it is an actual bug in Shotcut functionality.

Regardless of the platform, if you supply a file name without any extension and hit Save, the exported file will have the extension specified by the meta line in the export preset. Just ignore the semantics of the Save As dialog box. It does actually work as expected after you hit Save.

No, actually it does not, using the line given above, copy-and-paste, in Shotcut 21.05.01 under Kubuntu Linux (Ubuntu with KDE UI).

The exported file is a playable mp4, but the extension is blank.

This was one of the great disappointments in my experiments several weeks ago; it seemed that should work, but no…

So I tried again just now.

No joy. :frowning_face:

Not sure what to tell you. Just tested on Linux Mint with AppImage 21.03.21 and it does.

Bookmarked for more research. (And a demo video, later.)

1 Like

Specifically, I used Linux Mint 20.1 XFCE. Not sure if the choice of desktop environments affects the behavior of the Save As dialogs.

Perhaps it does.

But…

The choice of Custom vs Stock Export should not affect the Save As dialogs. The same feature used by the developers in making the Stock Export options which default the extension should be available to the users for our Custom Exports.

Any problem with desktop environments should be the same for both Stock and Custom.

What happens if you create a custom preset that includes the meta line, exit Shotcut, restart Shotcut, and try a new export using a filename with no extension? I am able to export with the extension of “HelloWorld” coming from the meta line which doesn’t match any container format. I did have one instance in testing where creating a custom preset did not export with the custom extension, but then did after a restart.

EDIT: Possible explanation… When I create a custom preset, if I immediately export, I don’t get the custom extension specified by meta. But if I create a custom preset, click on the custom preset in the list to reload it, and export, then I get the custom meta extension. This kind of makes sense. When we create a custom preset and add additional lines to it, those lines are added to the new preset, not to the current configuration already loaded in RAM. As in, RAM is not updated with the changes we made to the saved preset. We would have to specifically load the custom preset to pick up the meta extension.

Curiouser and curiouser.

  • Load existing tiny mlt project.
  • Set video mode Stock:H.264 Main Profile
  • Click +, create new profile named “a6” with meta… …mp4 added
  • Export
  • In 33 seconds, a good video with no extension
  • Exit Shotcut
  • Open Shotcut
  • Choose the same project
  • Choose Custom:a6
  • Export
  • In 7 seconds, a video with the correct extension, black, no audio
  • Turn off Hardware Encoding
  • In 111 seconds, a good video with the correct extension
  • Turn on Hardware Encoding
  • Export
  • In 33 seconds, a good video with correct extension.

Curiouser and curiouser.

2 Likes

Creating a custom preset does not apply it; it only creates it. When you add the line meta.preset.extension=mp4 in the custom preset dialog, there is nothing that is reading that to apply it until you click it (even if it shows as selected). Everything is already applied from your current options except for that because they have been set.

1 Like

I also left out the part where I types the numerals “1” and “2” after the suggested name and before the dot before the extension, to give it a unique name.

I am very sorry that I did not include all the details in my explanation.

Of course I clicked it.

thanks a lot …
worked fine in windows version
Do you know any documentation regarding this command line to use on other tab from export options ?

Have a look at the files (e.g. YouTube) in the installation folder/directory, e.g. on a Windows system:

C:\Program Files\Shotcut\share\mlt\presets\consumer\avformat
1 Like

Back a few weeks ago when I wasted three days trying to make this work, that is what I did. Most of my failures, and certainly my most frustrating failures, came from copy-and-paste from those files, such as the YouTube profile.

It works fine. The trick is to click a new preset to load it before attempting to export with it. The stock presets have been used to construct new presets for years (including new stock presets). If meta.preset.name is used, it takes a Shotcut restart to sort it correctly in the list. Same for meta.preset.note.

1 Like

Documentation.

At long last.

Thank you.

Granted, documentation is a little sparse in areas. :smile: Maybe this is worth adding to the wiki.

1 Like

I knew there was some difference that was not in the “meta.preset.extension=mp4” itself, that was causing a behavior difference between Custom presets and the Stock presets.

Now that difference is found:

The user cannot get to the Stock presets unless a Shotcut restart has intervened since the preset was created.

The user can get to a Custom preset without an intervening Shotcut restart from the preset creation.

1 Like