Memory leak when dragging video to timeline

What is your operating system?
Windows 10 x64

What is your Shotcut version (see Help > About Shotcut)?
24.06.26

Can you repeat the problem? If so, what are the steps?
I have used shotcut for years now never a problem, my friend needed to edit some videos and I told them to install it.
The problem is as soon as s video is dragged to the timeline the memory usage starts climbing 1GB, 2GB, 3GB…10GB+ until the machine runs out of memory.
I uninstalled it and tried the stand alone zip, same thing.

If we do “file > Open” it opens the video just fine rather quick. But as soon as that video is dragged to the timeline, again the memory starts raising until the process has to be killed to be able to keep using the computer.

I don’t know what I could possibly say that would help solve this, that’s just what happens, the video is a 700MB file is a very common h264 mp4 60fps 1440p nothing weird just gameplay footage not variable frame rate or anything.

1 Like

Weird, but I cannot reproduce it. When adding to the timeline, it needs to generate thumbnails and waveform. Here I dragged a 4K60 clip to the timeline with 4K60 automatic video mode and no preview scaling or proxy (these would use less RAM), and you can see it still generating waveform with about 80% done, but it only goes near 2GB memory usage

Is the problem specific to the file or the computer?

Seems to be the file!!!, Is there anything I can send you to help determine the cause?

Here’s a video, sorry about the poor camera work…

I think i solved it.

After realizing it was that specific video and not all of them i recreated it and it loaded in a second.

Let me explain, we record with GeForce Experience, which generates variable framerate videos. To avoid having to manually convert each video we use this script:

@echo off
setlocal enabledelayedexpansion

REM Create the "fixed" directory if it doesn't exist.
if not exist "fixed" mkdir "fixed"

REM Initialize counters.
set totalVideos=0
set skippedVideos=0
set convertedVideos=0

REM Count total videos and check which ones will be skipped or converted.
for %%i in (*.mkv *.mp4) do (
    set /a totalVideos+=1
    if exist "fixed\%%~ni.mkv" (
        set /a skippedVideos+=1
    ) else (
        set /a convertedVideos+=1
    )
)

REM Display the counts.
echo Total videos found: !totalVideos!
echo Videos that will be skipped (already present in "fixed" dir): !skippedVideos!
echo Videos that will be converted: !convertedVideos!

REM Process the videos.
for %%i in (*.mkv *.mp4) do (
    if not exist "fixed\%%~ni.mkv" (
        ffmpeg -i "%%i" -vf "fps=60" -c:v h264_nvenc -cq 19 -preset fast -c:a copy "fixed\%%~ni.mkv"
    )
)

pause
endlocal

So i just deleted the video ran the script above again and it worked fine, no leaks.
You may think the script is at fault, but I converted and edited in shotcut several thousands videos with it and never got a any issues.

Glitch in the matrix?

There is no obvious problem with the script. It seems it was an anomaly. Can you upload the problematic file to a cloud drive and share it with me privately?

Sadly the bin was already cleared when i got to it.
Don’t worry must have been a faulty file.