Create an mp4 clip with transparency

I am trying to create a white box in Shotcut with a transparent background which can be exported as and mp4 file and then used in other projects. The result in the new project should be a white box sitting over the project’s background. When I try this, the mp4 file has a black background which covers up the new project’s background.

Any suggestions?

You need to use an export preset from the alpha category. MP4 does not support it.

Hi, sorry to be dim, but would you mind explaining that in little more depth? It looks like you are saying I can export my timeline to create a clip within Shotcut but not as an mp4 file.

A transparent background requires an alpha channel, but MP4 does not support an alpha channel.

Click Export on the main toolbar.

On the left side of the Export panel is a list of Presets. There is a category named “alpha” you need to choose one of those. Consider VP9 for good quality for video with variety and detail, and it will
still compress a lot. Choose Ut Video if you know wherever else you plan to use it can read it because that will compress well with simple images only but with best quality.

OK, I have worked this out now. It works for png files with transparency and also layers within Shotcut that have transparency, such as applying the rectangular crop filter to a colour layer.

1: Click on Export. Use preset alpha: WebM vp9;

2: Click Advanced button (at bottom) and set Codec=libvpx-vp9;

3: Click Other and make sure that there is a line that says pix-fmt=yuva420p. If it is not there, enter it manually.

4: Export video. Open the video in the Jobs list so that it appears in the source window. Drag it into the timeline over some background to see it in action.

The alpha/WebM VP9 with alpha channel preset already does those things.

I forgot to mention that if you do not need audio and especially if you want to use it in HTML, the WebP Animation preset (not in the alpha category) also supports alpha channel.

Thanks for that.

I have discovered another challenge. If you take the webM video you have produced and use Properties>reverse, to make the video run backwards, it creates an mp4 file and you lose the transparency in the copy. Any suggestions?

Reverse before exporting with alpha or use a Time filter to reverse it.

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