How to Optimize Playback?
Hello, I recently gave Cinelerra-GG a real shot, and was very impressed with it on multiple fronts. It has a lot of great features that other FOSS NLEs don't have, chief among them being hardware decoding. It has the smoothest playback between Kdenlive, Blender, Olive, and Pitivi, and has no lag whatsoever for 4K video. Even for codecs like Quicktime which NVIDIA doesn't support hardware decoding for. It has the best documentation by miles compared to the other FOSS NLEs. Amazing job on that, by the way; it's unfortunate that most projects don't have documentation this thorough and in-depth. I learned a lot about video in general from reading some of it, even.
However, when I have two video tracks playing at once, the framerate is cut in half. When I add an effect like Color 3 Way to a clip, it cuts the framerate in half again. I've tested this by enabling/disabling the effects, and enabling/disabling Play Track in the patchbay and looking at Preferences for Playback A. I'm not sure if this is typical behavior, which is why I'm mentioning it. I'm not sure if this has something to do with driver support for GNU/Linux. I get framerates of 3-5fps or 11fps instead of 25fps.
So, here are some things I've tried to optimize media, which work, but none of which provided a complete solution for me:
- Turning on background rendering—this worked very well, but it changes the color space when rendering the JPGs so I don't get an accurate impression of the color. It also takes quite a bit of time to work through the entire track. The only way to turn it off is to toggle background rendering again, which starts all over from the top, despite there being thousands of frames in my /tmp folder generated already.
- Tried proxy clips with mpeg codec. This actually resulted in worse framerates without the scale factor. Additionally, mpeg does not include an alpha layer, which is necessary for some motion graphics I have added to the timeline. Otherwise I don't get a clear picture of the playback I attempted to change the proxy container to webm and used yuva420p pixels, but this didn't produce transparency either. I then read that VP9 does not account for transparency and to use VP8 with yuva420p pixels, but when I tried this, I got an error. I tried mov as well, the only other codec I know supports alpha, and it gave me a very similar error:
int FFMPEG::open_encoder(const char*, const char*): open failed libvpx:/path/to/file.proxy-MP4.webm int ProxyRender::create_needed_proxies(int): Error making proxy
I'm not sure if this just means it's not possible to create proxies with transparency.
- Rendering out the motion graphics files to a .tiff sequence with LZW compression and importing that—this produced worse results than the .mov file. By the way, the JPEGLIST example in the documentation didn't work without tweaking it to use absolute paths rather than relative paths to the images in the sequence; Cinelerra-GG couldn't find the files.
Additionally, it's strange, but whether vdpau is on or off doesn't seem to make any significant difference to the playback speed, even for H.264 media.
Is there anything else I can try? Or is there something that I screwed up when trying these things?
I increased Cache size from 256MB to 8192MB, but it didn't seem to make any difference, even on the system monitor. It only uses as much as 6GB of RAM at any time.
By the way, these are my system specs:
Arch Linux, X11, GNOME 41.3, NVIDIA RTX 2060 Super, AMD Ryzen 5 3600x 6-core, 32GB of RAM, using Linux-Zen with proprietary NVIDIA drivers (nvidia-dkms) Using 3840x2160, RGBA 8-bit settings for project, YUV color space in Preferences is set to BT709 instead of the default BT601_NTSC
My system monitor reports that normal playback uses about 65% of my CPU, while Nvidia X Server Settings reports about ~20% of my 8GB of my dedicated memory, at most 30% of GPU Utilization, and sometimes 50% of Video Engine Utilization.
Thank you for any help.
EDIT: Also, I built Cinelerra-GG from the cinelerra-gg AUR package instead of using the AppImage. I've used both with identical experiences but just found the AUR an easier way to manage updates.