'FFmpeg memory usage increases indefinitely when trying to lower the FPS of a video
I have a certain process (loop) where I combine frames into a video with opencv and then change its FPS from 45 to 5 with FFmpeg, save it as a new video, delete the old one, split the new video into frames and finally delete the frame-reduced video.
It seems that with every iteration of FFmpeg, which is this line:
os.system(f'ffmpeg -i {original_vid_path} -r 5 -y {new_vid_path}')
My RAM usage goes up by ~400MB or so with each video until it reaches the maximum of 16GB.
The videos themselves are around 30 seconds to 3 minutes long.
Is this behavior intended? is there any way to free up memory after each frame reduction? I prefer not to stop & resume each time since I have around 1400 videos.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
