Export failed after Mask: From File filter

Hi, I am struggling with the Mask: From File filter with a custom file loaded.
In the timeline simulation it looks fine, but export fails with exit code -1073741819.

Windows 10 22H2 Build 19045.6093
Shotcut version 25.05.11

Normalized procedure to reproduce:
Start with clean project.
Add a 4 second WHITE color clip to track V1, using the generator.
Add a new video track V2.
Add a 4 second BLACK color clip to track V2.
Add a Mask: From File filter to V2, choose ‘Iris Circle’
You should see a black disk on white background.
Export a frame as a TIFF.
Now, still with V2 selected, edit Mask: From File and choose ‘custom…’ and load the TIFF.
The picture should look unchanged, but now you have a custom b&w mask from a bitmap file with proper resolution.
Export the 4 second video using the H.264 Main Profile. As filename type ‘fail’, because it should fail.

The problem occurs with custom picture files, regardless of B&W or grayscale, TIF or PNG or JPG format, the mask beeing at the start or in the middle of the video.
The files have a resolution equal to the video.
No problem with stock patterns, which seem not to come from a bitmap file, at least I did not find any stock files.

Job log:
mlt_repository_init: skip plugin C:\Program Files\Shotcut\lib\mlt/libmltqt.dll

[libx264 @ 0000028661536e40] [Eval @ 000000f040dfe940] Undefined constant or missing ‘(’ in ‘dct8x8’

[libx264 @ 0000028661536e40] Unable to parse option value “dct8x8”

[aac @ 0000028661538380] [Eval @ 000000f040dfedb0] Undefined constant or missing ‘(’ in ‘dct8x8’

[aac @ 0000028661538380] Unable to parse option value “dct8x8”

[libx264 @ 0000028661536e40] using SAR=1/1

[libx264 @ 0000028661536e40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX

[libx264 @ 0000028661536e40] profile Main, level 3.2, 4:2:0, 8-bit

[libx264 @ 0000028661536e40] 264 - core 164 r3161M a354f11 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - x264, the best H.264/AVC encoder - VideoLAN - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=125 keyint_min=12 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00

Failed with exit code -1073741819

Failed with exit code -1073741819

I reproduced it. This is the same bug as

and

There is a new build-related problem with a project that uses only generator clips on Windows x64. It is not yet solved. If you replace the clip on V1 or V2 with a video or image (anything except a generator) it works.

Yes, my Windows is 64bit.
But I have new reserch data for you:

Today I tested in which of the 3 involved roles (V1/V2/Mask) the generator causes the export error.

Today, somehow I created the same project setup as yesterday, but without getting the export error (repeatible). Now I have 2 close to similar MLT files, one causes the export error, the other not.

Both projects have the same structure:
V2: generated + Mask: From File
V1: generated
Custom Mask file: same exported frame from the “Iris Circle” mask

In both projects I experimented to exchange the generated clip on V2 and rebuilt the filter, but the projects did not change their behaviour.

I am not able to tell where I made the the crucial difference when building the projects. But probably you can further drill down the error, when you analyze the MLT files I upload for you. The working directory was d:$ SAVE AS\

$ SAVE AS.zip (19.8 KB)

The difference is the working one has a TIFF image in the Playlist.

True, but the TIFF ist not used in the project, the playlist is not touched at the export (?), and, if I could heal the error just by adding a TIFF to the playlist, this would be too simple :smirk:

The playlist is saved with the project, including the job XML. It is the difference.

Another difference is the clip on V1 has a Sepial filter.

You hit the spot - I deleted the TIFF from the playlist and the project fails to export … spechless

So, this is the workaround?

I just added a TIFF to the playlist of the faulty project (first line), and indeed, the faulty project has been healed :clap:

Why don’t you hardcode a TIFF to the playlist and all set :laughing:

Just discovered another faulty effect of the generator (possibly already known):

The ‘Mask: From File’ filter becomes persistent, even if removed.

My setup is:
V2: movie + Mask: From File
V1: generated color

If you split V2 in two clips and remove the filter from the 2nd clip, the filter stays active.

I suspend now experiments with the generator.

My workaround for the generator is that I only use it to export the generated frame. Then I use the bitmap frame instead of the generator.

I have now a project without any use of the generator, but with the 'Mask: From File’ filter, which failed to export. Again, I overcame the problem by adding a TIFF to the playlist. Just to report …

This is fixed for the next version 25.07. A new beta will available tomorrow.

1 Like

Works great, thank you!

1 Like

Is it possible that Mask: Appy changed it’s behaviour through the beta update?

Pls. have a look at the project attached and play with the filters on V2. As far as I remember, previously Mask: Appy was required to combine masks and other filters. Now it is not required any longer, but if activated, it has unexpected results. At least in this project it should not apply the Color grading filter on V1, but I can be wrong.

Mask apply (V1 V2 generated).mlt (8 KB)

As a newcomer, I have not yet fully understood the function of masks, and in which way they make the track transparent for the track below or just apply the filters following, and how this all depends of the track properties. Is there a comprehensive verbal description somewhere to read?

EDIT: I just re-uploaded the MLT file, because it was not the latest version saved.

No change to behavior and there’s a documentation link at the top of this page.

I downloaded your project, and it works exactly as expected. Well, I do not have your custom mask so I changed it to Iris Circle.

Color Grading is confined to the combined alpha channel on V2 only.

previously Mask: Apply was required to combine masks…

No, what is required are filters that affect know how to respect the current alpha channel and not simply overwrite it. Mask Simple Shape’s Operation does that in this project.

…and other filters

Yes, it is needed to Apply the Color Grading filter.

it should not apply the Color grading filter on V1

It doesn’t whether Mask Apply is enabled or not.


You might be confused by a broken behavior in version 25.05. If you are using a beta, you should read the release notes.

Fixed Mask: Apply with multiple Mask: Simple Shape (broke in v25.05)

I am not going to add an option to keep the broken behavior in version 25.05.