Memory Leak with Hardware/GPU Encoding

When using hardware accelerated video encoding (h264_qsv) with non standard video resolutions the memory usage of shotcut increases second by second until all the memory is used and the system becomes unstable.
I was using shotcut to convert an old style VCD video in dat format to mp4. The video resolution was 352x288 at 25fps. I watched the memory usage in task manager and it steadily increased but did not create any problems because the memory usage only got to about 86% for this project. When I doubled the resolution to 704x576 the memory usage was much more rapid and it caused the system to become unstable before the project fully exported. When I cancelled the export the memory usage returned to normal. If I do the export at 1280x1024 the memory usage is stable.
Using the software libx264 encoder does not create the same problems but is a lot slower.
Has anybody else noticed this and is it a bug or just a side effect of GPU encoding?

Here is some basic info about system etc.
Shotcut Portable 64bit - Shotcut version 19.08.16
Windows 10 64 bit. 16GB RAM Intel HD Graphics 4000
Intel core i5 3337u SONY VAIO laptop model SVF1421X2EB

Here is part of a log for an export which I stopped before the computer ran out of memory
There seems to be quite a few errors at the start.

plugin_mgr_get_object_file_plugins: error opening shared object file ‘C:\Portable Programs\ShotCut1803-64bit\lib\ladspa/AUTHORS’: “C:\Portable Programs\ShotCut1803-64bit\lib\ladspa\AUTHORS”: The specified module could not be found.

plugin_mgr_get_object_file_plugins: error opening shared object file ‘C:\Portable Programs\ShotCut1803-64bit\lib\ladspa/COPYING’: “C:\Portable Programs\ShotCut1803-64bit\lib\ladspa\COPYING”: The specified module could not be found.

plugin_mgr_get_object_file_plugins: error opening shared object file ‘C:\Portable Programs\ShotCut1803-64bit\lib\ladspa/readme.txt’: “C:\Portable Programs\ShotCut1803-64bit\lib\ladspa\readme.txt”:

[h264_qsv @ 00000000050cc500] [Eval @ 000000000925eec0] Undefined constant or missing ‘(’ in ‘dct8x8’

[h264_qsv @ 00000000050cc500] Unable to parse option value “dct8x8”

[ac3_fixed @ 00000000050dd980] [Eval @ 000000000925ee50] Undefined constant or missing ‘(’ in ‘dct8x8’

[ac3_fixed @ 00000000050dd980] Unable to parse option value “dct8x8”

[h264_qsv @ 00000000050cc500] Initialized an internal MFX session using hardware accelerated implementation

[h264_qsv @ 00000000050cc500] Using the constant quantization parameter (CQP) ratecontrol method

[h264_qsv @ 00000000050cc500] profile: main; level: 30

[h264_qsv @ 00000000050cc500] GopPicSize: 125; GopRefDist: 4; GopOptFlag: closed ; IdrInterval: 0

[h264_qsv @ 00000000050cc500] TargetUsage: 4; RateControlMethod: CQP

[h264_qsv @ 00000000050cc500] QPI: 11; QPP: 14; QPB: 18

[h264_qsv @ 00000000050cc500] NumSlice: 1; NumRefFrame: 2

[h264_qsv @ 00000000050cc500] RateDistortionOpt: OFF

[h264_qsv @ 00000000050cc500] RecoveryPointSEI: unknown IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0

[h264_qsv @ 00000000050cc500] MaxFrameSize: 304128; MaxSliceSize: 0;

[h264_qsv @ 00000000050cc500] BitrateLimit: ON; MBBRC: OFF; ExtBRC: unknown

[h264_qsv @ 00000000050cc500] Trellis: auto

[h264_qsv @ 00000000050cc500] RepeatPPS: ON; NumMbPerSlice: 0; LookAheadDS: unknown

[h264_qsv @ 00000000050cc500] AdaptiveI: unknown; AdaptiveB: unknown; BRefType: off

[h264_qsv @ 00000000050cc500] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0

[h264_qsv @ 00000000050cc500] Entropy coding: CABAC; MaxDecFrameBuffering: 2

[h264_qsv @ 00000000050cc500] NalHrdConformance: OFF; SingleSeiNalUnit: ON; VuiVclHrdParameters: OFF VuiNalHrdParameters: OFF

[mpeg @ 0000000005043980] max_analyze_duration 5000000 reached at 5000000 microseconds st:0

[mpeg @ 00000000050cbb00] max_analyze_duration 5000000 reached at 5000000 microseconds st:0

[mpeg @ 000000000dca13c0] max_analyze_duration 5000000 reached at 5000000 microseconds st:0

[producer avformat] audio: total_streams 1 max_stream 1 total_channels 2 max_channels 2

[AVIOContext @ 00000000050c4000] Statistics: 1331344 bytes read, 2 seeks

[producer avformat-novalidate] C:/temp/Stuff to Burn to BluRay/Babylon 5 and Other Stuff/Babylon 5 Red Dwarf 01/MPEGAV/MUSIC02.DAT

checking VFR: pkt.duration 3600

[filter swresample] 2(stereo) s16 44100Hz -> 2(stereo) s16 48000Hz

[filter swresample] 2(stereo) s16 48000Hz -> 2(stereo) s16 44100Hz

[mp4 @ 00000000050440c0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.

[mp4 @ 00000000050440c0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.

Stopped by user at 00:01:21

Intel Spec Sheet: 2-Core 1.80 GHz

Shotcut’s minimum system requirements: CPU: x86-64 Intel or AMD; at least one 2 GHz core for SD, 2 cores for HD, and 4 cores for 4K.

@Hudson555x
Dude, this has nothing to do with memory leak.

1 Like