Export failing on 2.5 hour project with 8 video tracks

The log says this:

[filter swscale] sws_scale_frame failed with -12 (Cannot allocate memory)
[filter swscale] Cannot allocate output frame buffer
[filter avfilter.hue] Cannot get in frame buffer
Failed with exit code -1073741819
Failed with exit code -1073741819

You are running out of memory. Did you monitor your computer memory utilization like I suggested? There is common advice on this forum that it can be good to close all other applications when performing an export.

During export, the memory utilization will steadily climb until it eventually levels off until the end of the export job. It is possible that you have exposed a memory leak in Shotcut. If that is the case, you will see that the memory steadily climbs and never levels off. That can result in all of the memory being exhausted. If that is the case, you might need to systematically subtract features from your project until you get it to export without consuming all the memory. Then, we can focus on what feature was removed that used all the memory.

Can you provide your system specifications and check what memory is used during export?

The RAM climbs to 85 per cent and then stops at some point.
I haven’t opened any other apps. But the project is extremely demanding and has many transitions, colour correction, image size changes, etc. It also has 8 video tracks, a track with a black background and an audio track.
When I accidentally exported the entire project earlier, it probably only worked because I had forgotten to switch on two video tracks. I just did a test with only 4 video tracks and it worked straight away. But it would be incredibly time-consuming to drag all the camera tracks onto one track afterwards. Especially as they all have a different colour correction. I could only do this if I applied the colour correction directly to the video stream itself and not just to the track.
Do you think it would help to install a graphics card so that I can use the hardware acceleration?

I will deliver the computer specifications tomorrow. It’s half past three in the morning here in Germany and I’m lying in bed by now :wink:
But thanks for your help in any case.

For each video track that is in a project, Shotcut consumes more memory. So reducing the number of tracks could be a good solution. Even if you could reduce it by one track, that might tip the scale in your favor.

I think that is unlikely to help. Could you add more RAM to your computer?

Thanks for the advice.
I’ve made a few more attempts, including hiding a track. The three-minute test file was then imported correctly. However, I had also switched on the hardware encoder for this. So I didn’t really know, what the reason was, that it now worked.
Three further tests, for each of which I had increased the quality (Lanczos: better, then best, quality: 65, then 75), were also successful. In each case with all tracks activated. Duration between 13 and 16 minutes. I think it now works, because hardware encoder is on. But I am not really sure und unsure every time I try to export a project.
I am currently testing importing a 23-minute track. Stands at 4%, remaining time 5:30 hours.

The specifications of my PC are
Processor: 12th Gen Intel i5-1240D
RAM: 16 GB
Win 11 23H2

It’s difficult when the video is so long. Have you tried breaking it up in pieces?

1 Like

Mentioned here (could be found through links already provided or as the first result when searching for “memory”):

I think there are several reasons why it is not working.
I have now merged 4 tracks that contained 4K footage onto one track so that I can hide the four individual tracks when rendering.
The first attempt with a 30-minute piece did not work. I didn’t change anything in the settings for the export. The second attempt is currently running.
I always restart the PC beforehand (I have to anyway).
When I accidentally tried to render the project with the proxies, it would have taken 1.5 hours. However, it went without a hitch.

I have no problems at all when editing. The system runs completely correctly. However, I also work with proxies.
I had also thought about splitting the file into individual parts. But some of the songs in the concert are very long. On average 8 minutes, one even 25.
It would be very disappointing if the project failed because the export didn’t work. Then all the work would have been for nothing.
What I understand least is that the entire 74-minute video was rendered yesterday, although only two tracks with 4K material were (accidentally) switched off. Now I have switched off 4 for rendering. Or does it not matter because the material from these tracks is still included in the project, even if only on one track?
In any case, I don’t know what to do. My PC is probably not powerful enough, even though I only upgraded it 2 months ago.

can we setup to use like 90% or any number below 100% of memory to avoid this memory crash issue ?

In this case (the one with the log), it was not a crash but an exit with failure. It is not clear what you expect by “setup to use… % of memory.” We have already made numerous changes and fixes over the years to reduce memory usage. That is a continual battle just like bugs and features. I do not know how to make something that will let you work with unlimited tracks of unlimited video resolution in a small amount of memory. I guess one could write it to process one pixel at a time if you are willing to wait days or weeks for your export to finish.

1 Like

if you want, I can render your project for you on my computer (64gb of RAM).

That would be great. Thank you very much for your offer :upside_down_face:.
I haven’t finished editing yet. It will take some more days to edit the whole project.
I’ll see tomorrow if I can install more RAM for my PC.
If I can’t manage to export the songs individually and put them together so that there’s no interruption, then I’ll be happy to come back to it.
Many, many thanks.

1 Like

After you mentioned your 64 GB RAM, I invested more money and also ordered 64 GB RAM today. It’s difficult for me financially at the moment, but it’s even more annoying when you don’t know after hours of editing whether your work was in vain because you can’t render it.
I also didn’t know how to get the 500 GB files from Germany to you. That would have been very difficult and time-consuming online. Nevertheless, thank you for your great offer. In two respects: You gave me the idea to upgrade the RAM again.
Now I just hope that the DDR4 modules will fit into the motherboard. But since it’s only 2 months old, it should work :grin:

I meant shotcut check memory use and when get 90% or higher usage Shotcut could auto pause the export till memory get 70% usage or lower then resume to prevent crash or other issues … not sure how difficult it is to code this idea … just an idea !

OK, that is an interesting idea to consider. I have thought about how today there is no way to pause and resume jobs. Also, I have thought about how the low memory warning dialog does not dismiss itself because the problem could go away before the user notices the dialog and takes action.
But this would not be foolproof because low memory checks only occur once a minute, and the memory could consume faster than that and still lead to a memory allocation failure. I guess that is a case of something is better than nothing.

1 Like

Implementation suggestion:

Override the direct memory allocation with try memory allocation with wait loop which tries to allocate the memory all 0.1 seconds if it previously had failed, and abort this after e.g. 5 minutes for the export and 10 seconds for the editing part in the export process.

This strategy is platform independent and it should perform well.

From your Faillog.txt
I:/Giant Hogweed/Giant Hogweed Videos/Giant_Hogweed_Rex2023/°Videos Proxy/Set1_Gesang_Proxy.mp4

Is your I drive a USB, HDD (hard disk drive), or an internal SSD?
Are you exporting to the same drive? If not, what type of drive are you exporting to?
Is this drive getting hot?
Have you tried a different drive?

I can’t seem to find any information on this chip.
I found a i5-1240P, and that is for a laptop.
How hot is your CPU getting during exporting?
What are you doing to cool the CPU?

See, this is why I read the ShotCut forum summaries! Never knew that.

You could try exporting just the top two tracks, then add the third track to the exported video and export again…and the 6th export will have all the tracks.

@hudson555x

I have experimented both on the hard disk on which the data is stored and on a USB stick.
The hard disk gets warm, but not hot.
I can’t say whether the CPU gets hot. At least the fan is not louder than usual.
I have just installed 64 GB RAM. It worked right away. Probably 32 would have been enough, because the utilization was at most 29% (i.e. just under 20 GB).
I’ll keep testing, as I’ve only exported “well” with interpolation so far. But I think more RAM is the solution.

1 Like

The log is crystal clear on that. Get more RAM or use fewer tracks.