How to solve the issue of high memory usage when writing too many frames using FFmpeg as the API Backend for OpenCV 4.7 VideoWriter on Linux[CANCELED]

that pseudo code contains no issues.

you’ll need to present actual code, a MRE, that is debuggable. also all relevant information you have about the environment.

and especially quantify “high memory usage”/“larger and larger” in space and time.