PRESETS Incomplete? (Affects YouTube Video Export Function)

Hello Everyone,

I am preparing an article on Shotcut for my blog, and I have come across what seems like a strange behaviour with respect to the Shotcut PRESET for YouTube, so I’d like to ask your input/advice on whether I am missing something?

I am the first to admit that I am new to Shotcut, and this may be simply a function of me not knowing something obvious. Here’s what happens. When I (browse, load or save) the Shotcut PRESETs, I notice the following:

  • Not all of the configuration information is being captured. This creates a “mix and match” situation for the Export function when I browse through several PRESETs that sometimes results in undesired behaviour.

  • The PRESET information is not presented in the order that it appears in the tabs, which caused me some confusion until I figured out what the parameters meant (and re-ordered them).

Unfortunately, not all of the information presented in the Advanced tab is captured in the corresponding PRESET, which I find unfortunate and a little disappointing.

I have taken the liberty to enumerate the values in all of the tabs (Video, Codec, Audio, Other) that appear normally in my installation, and I also noted which pieces of information do not seem to be captured in the PRESET and therefore not repeatable across Shotcut installations (or even Shotcut sessions on the same machine):

0 Format f=mp4
1 Resolution (Width) width=1920
2 Resolution (Height) height=1080
3 Aspect ratio aspect=1.77778
4 Frames/sec NOT CAPTURED IN YOUTUBE PRESET
5 Frame Density (virtual) NOT CAPTURED IN YOUTUBE PRESET
6 Scan mode progressive=1
7 Field order top_field_first=2
8 Deinterlacer deinterlace_method=yadif
9 Interpolation rescale=bilinear
10 Parallel Processing NOT CAPTURED IN YOUTUBE PRESET
11 Codec vcodec=libx264
12 Rate control (video) NOT CAPTURED IN YOUTUBE PRESET
13 Quality crf=23
14 GOP g=15
15 Fixed GOP NOT CAPTURED IN YOUTUBE PRESET
16 B frames bf=2
17 Codec threads threads=0
18 Disable video NOT CAPTURED IN YOUTUBE PRESET
19 Channels channels=2
20 Sample rate ar=44100
21 Codec acodec=aac
22 Rate Control (audio) NOT CAPTURED IN YOUTUBE PRESET
23 Bitrate ab=256k
24 Disable audio NOT CAPTURED IN YOUTUBE PRESET
25 (no idea) movflags=+faststart
26 (no idea) preset=fast

Can you please take a look at the above and give me some input/advice on how I might capture ALL Shotcut configuration information in a PRESET “recipe” that I can then save?

Thanks!

If I have any of the above wrong, please let me know.

I would very much like to start publishing YouTube PRESET “recipes”. It seems to me that PRESETs in Shotcut are akin to “recipes” and that it would be very instructive to be able to trade “recipes” between Shotcut users to see what configurations work best at different times, and to help troubleshoot the configurations of others.

Thanks!

Graham Leach

UPDATE: 2019-12-31@23h00:

Hello Again!

After doing a little bit of research on the last two parameters (#25, #26) I found out the following:

movflags=+faststart

It seems that this setting is

  • Requested by YouTube (faststart)
  • No longer formatted that way when using ffmpeg 3.x & 4.x
  • The correct format for ffmpeg 3.x & 4.x is movflags=faststart (no + sign)

(from https://superuser.com/questions/856025/any-downsides-to-always-using-the-movflags-faststart-parameter)

preset=fast

It seems that this setting optimizes for speed over quality, and for people with faster machines a setting of preset=medium (the default) may be more appropriate.

(from: https://trac.ffmpeg.org/wiki/Encode/H.265)

I tried to reproduce this, but could not. Could you provide us with the version of Shotcut you are using and exact steps to reproduce?

I want to thank you for reaching out to the forum first before publishing a blog that describes Shotcut in any disappointing light. I am not a Shotcut developer; I’m just a generic but enthusiastic user because Shotcut provides an extreme level of encoding control that few other video editors allow. This is one of Shotcut’s killer features. The people in this forum include television broadcast users, professional production house users, and knowledgeable hobbyists who choose Shotcut in part because of the control it provides over the final output. But as you’ve noticed, once a user steps outside the safe harbors of built-in presets, this level of control does require a good degree of video encoding knowledge (specifically FFmpeg) to be handled productively.

To address your concern, Shotcut leaves certain details out of the encoding preset on purpose. There is a second place some settings are stored called a “video profile” (or “profile” for short) which describes the video settings of the timeline. Details like width, height, frame rate, color space, and progressive vs interlaced are stored in the profile, as these details are needed for the timeline to operate long before any exporting is done. Eventually, when it’s time to export, the preset is able to look up these settings from the profile at run-time, which is why they are not explicitly specified in the preset. Otherwise, a custom preset would have to be created for every hard-coded resolution rather than simply looking up the resolution from the project timeline/profile. If you do create recipes for other users, take into consideration whether you want to explicitly force a user’s video to a specific resolution, or whether you want to encode at whatever resolution their source happens to be. As in, if you force 1080p, you will make the 4K guys unhappy. :slight_smile:

The next topic is the list of encoding options that were not saved with the preset. Shotcut was correct to leave them out given the example you provided – some settings are mutually exclusive (such as variable bitrate vs constant bitrate). If you want to find the settings that influence each field, here’s a way to do it:

Choose any preset, fill it out with the information you’d like to see in a new preset, then click the “+” button directly below the list of presets to add a custom preset. A dialog box will pop up with the settings that will comprise the preset you’re about to save. (You can click Cancel if you are only here for exploratory purposes.) You can quite easily determine which settings go to which encoding features from here. For instance, if you changed the YouTube preset to Interlaced then hit the “+” button, you’d find progressive=0 and top_field_first=1 added to the list. (Obviously, YouTube doesn’t prefer interlaced video being uploaded to it.) You’ll be happy to learn that every encoding setting is captured in that list except hardware encoding configuration and parallel processing, and those aren’t really something for a preset to be enforcing anyway, and definitely aren’t shareable.

I have filled out the missing settings in your list to get you started, noting that some of the settings are best retrieved from the profile rather than being hard-coded:

0 Format f=mp4
1 Resolution (Width) width=1920 ← Profile
2 Resolution (Height) height=1080 ← Profile
3 Aspect ratio aspect=1.77778 ← Profile
4 Frames/sec ← Profile
5 Frame Density (virtual) ← Profile
6 Scan mode progressive=1
7 Field order top_field_first=2
8 Deinterlacer deinterlace_method=yadif
9 Interpolation rescale=bilinear
10 Parallel Processing ← Not captured by preset
11 Codec vcodec=libx264
12 Rate control (video) ← vb/vminrate/vmaxrate/vbufsize (incompatible with VBR/CRF/QP)
13 Quality crf=23
14 GOP g=15
15 Fixed GOP ← sc_threshold=0
16 B frames bf=2
17 Codec threads threads=0
18 Disable video ← video_off=1 plus vn=1
19 Channels channels=2
20 Sample rate ar=44100
21 Codec acodec=aac
22 Rate Control (audio) ← aq=250 or vbr=3 (incompatible with bitrate modes)
23 Bitrate ab=256k
24 Disable audio ← audio_off=1 plus an=1
25 movflags=+faststart
26 preset=fast

As for #25, the +faststart option is correct as-is. We want Shotcut/FFmpeg to apply whatever MOV/MP4 flags they feel are appropriate for the video being created, with the addition of faststart. Using faststart without the “+” would force the other settings to defaults, which could have unexpected consequences (but probably wouldn’t due to how little these flags are used for most MOV/MP4 files). If you read further into that SuperUser page you linked, you’ll find that the answer you’re quoting is incorrect and given further explanation by others.

As for #26, yes, the preset is an adjustable quality level. Tests confirm that medium generally provides better visual quality if a user can afford the encoding time.

Glad to have a contributor! I hope this doesn’t deflate your balloon, but the topic of best export settings has been discussed at length in the forums already. YouTube is such a known entity that only a handful of export options make sense (as in, I’d be surprised if more than five recipes were necessary). Here’s an example thread with recommendations given for users that want the highest quality possible out of YouTube playback yet with reasonable file size and export time:

Let us know if you have any additional questions. Could you provide a link to your blog? Thanks!

Not every option has a direct and obvious line in the export preset.
Here is the source code for reading an export preset:

I think the only thing not really captured in a preset is the hardware encoder and parallel processing checkboxes.

Documentation for the encoding parameters in the preset files are here and on ffmpeg.org.

Hello,

@Austin - Thanks for such a comprehensive and wonderful answer. Much obliged.

@shotcut - Thanks also for a great s/w and a superior level of response for a FOSS project owner.

The Shotcut community responsiveness and depth is really amazing! In my eyes, you are heroes of Open Source.

Here’s some information on my setup:

SOFTWARE:

  • I am using Shotcut 19.12.16

HARDWARE:

  • I am using a Dell PRECISION M4700
    • Windows 7 (64-bit)
    • i7-3940XM @ 3.2Ghz
    • 32Gb Ram
    • 500Gb mSATA SSD (Samsung EVO 860)

PRESETS Issue?:

I noticed this:

If the Resolution parameters are specified in a PRESET (width=XXX, height=YYY), those values are “carried over” to any subsequent PRESET where those values are not specified.

In other words, it seems to me that if you specify something in PRESET A (frame_rate_num=60000000), then CLICK on PRESET B where that parameter is not specified in the recipe, the (frame_rate_num=60000000) parameter from PRESET A will affect PRESET B.

I noticed this behaviour specifically with respect to the YouTube PRESET, which was affected in this way after I had clicked on some of the other PRESETs.

If I got this wrong, I apologize. I have been messing around with Shotcut a LOT in an attempt to get YouTube to accept my exported files (which it was rejecting for many days, while Facebook would accept them - the source of a lot of frustration). I have NOT read much of the documentation (obviously) and just jumped onto this software “cold”, so I am probably re-inventing the wheel in some places (like proposing Shotcut “recipes”)

My website is at www.mymanthemaker.com

My blog is at mymanthemaker.blogspot.com

Many thanks,

Graham Leach

1 Like

Resolution rarely belongs in an export preset unless it is tied to a device like a camera format or DVD. Normally, the project dictates the resolution. When you click a preset, it resets to defaults first, which should be project resolution, and then any preset supplied resolution if included overrides it.

Hello @shotcut,

Shotcut automatically populated one of my presets with the following information:

frame_rate_num=30000000
frame_rate_den=1000000

Why would it have done that?

I did not ask for this, but it got it - and somehow I like it.

P.S. Where in Shotcut would I find the “Project Resolution” you mention in your post?

Do you mean Settings -> Video Mode?

Graham Leach

When you add a custom preset it includes just about everything. If you read the instructions at the bottom of the add custom preset dialog, it instructs you to remove things you do not want.
There is info in the documentation category about video mode and projects you can find and read.

Yes.

Thanks @Austin for the clarification.

Most helpful!

Graham Leach

I would be interesting in seen screenshots of this. I’ve uploaded a lot of videos and streamed to YouTube for a few years now. I have yet to experience youtube rejecting a video.

Hello @Hudson555x,

Perhaps “not accepting” would be a better description…

…take a look:

see-saw, see-saw

Best Regards,

Graham Leach

What file types are these? It’s not clear enough to read.
2020-01-02_04-41-44

Have you tried renaming them with the “.mp4” extension? (If they are mp4 files)
2020-01-02_04-41-04

You have renamed your files after export and/or removed the mp4 extension for some reason or another, but yet failed to tell us.

Shotcut forces the mp4 extension, even from an project not saved.
shotcut_2020-01-02_05-07-45
shotcut_2020-01-02_05-15-10
shotcut_2020-01-02_05-15-25
explorer_2020-01-02_05-19-24 explorer_2020-01-02_05-19-02

And Windows gives you a clear warning what happens when you do eliminate the .mp4 extension.
explorer_2020-01-02_05-21-09

I see what you’re talking about, and I don’t experience this. This could be your internet speed - WiFi interference, YouTube server related, etc… nothing to do with how Shotcut prepares your files.

Despite me taking off the mp4 extension, YouTube still uploaded the video and processed it as normal.
There are deep inherent bugs with YouTube’s new UI and has nothing to do with Shotcut.
chrome_2020-01-02_05-34-38 chrome_2020-01-02_05-35-04

Hello @Hudson555x,

Thanks for putting in so much effort! I am very grateful!

If I provide you with a copy of the file, will you try to upload it from your side?

That way we can narrow down the possible inputs and see what happens.

Graham Leach

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