Video file size from Kdenlive

Does anybody have recommendations for keeping file size relatively small while rendering from Kdenlive? I’m screen recording tutorials using OBS Studio with MP4 or MKV formats, but when the same file is rendered on Kdenlive the file size more than doubles with no increase in quality. The smallest renderings are in WebM, but it’s still much larger.

With a bit more googling, it looks like the solution is to run the final rendered file through a tool such as VLC, Handbrake or ffmpeg to reduce the file size while maintaining decent quality. VLC seems to do a good job, but haven’t tried the others yet. Any recommendations?

MP4/MKV/WebM/MOV are just containers - what codecs are in your input and output?

I’m fairly certain kdenlive supports x265 for H.265 encoding - that will be one of your best choices as far as quality vs. size tradeoffs. Not sure how VP9 or AV1 will compare - last I checked AV1 was slower and often not present in distro-provided ffmpeg builds, but it’s theoretically not patent encumbered and should perform similarly to H.265 in bitrate/quality tradeoffs - AV1 - Wikipedia

Last I checked it was really difficult to use hardware encoding with kdenlive, but it’s been a while since I gave up on it in favor of Davinci Resolve.

Thanks Andy, I’ll try DaVinci Resolve after I’ve finished this client project, which is a fairly simple software tutorial that I just want to finish up without learning another app. Are you using the free version? Any serious limitations with it?

I’m using the paid version myself - but the main reason I ditched kdenlive was that working with Sony S-Log2/3 video was really problematic in kdenlive - it’s been well known for years to handle full-luma-range video poorly/unpredictably, making it difficult to properly use the lut3d filter to do colorspace conversions. I wanted to move to something that had better color management. If you’re not doing color grading/colorspace transforms/anything that requires more than 8 bits per color channel and such, kdenlive will probably do OK for you.

kdenlive (and nearly all other FOSS video editors since MANY of them rely on MLT) are an outlier in terms of still being stuck in the int8 world.

For your use cases, that’s probably OK, and you probably just have to tweak the codec settings on export a bit more to get the right bitrate vs. quality tradeoff. To help you more, it would be useful if you ran mediainfo on whatever kdenlive exported by default to see what codec and codec settings it was using. Also, for reference, running mediainfo on your source recordings would be useful.

I personally prefer H.265 in “constant quality” mode, but this can sometimes not play nice with certain playback systems. I’ve seen, for example, that H.265 in CQ mode will cause YouTube to treat HDR video as SDR, but the same exact video rendered in VBR mode will be handled properly by YouTube.

1 Like

Thanks Andy, this is really good info. At this point Kdenlive will probably work for me, but if I get into this in a more serious way, I’ll definitely look at Resolve. I’ve been a professional stills photography for years, but with video I’m a newbie.

One thing I learned in this process is that vokoscreenNG is unsuitable for my purposes of screen recording, and I needed to switch to OBS Studio. The main issue with vokoscreen was that the info boxes just showed black, but now that I’ve taken the time to learn OBS (with the help of my teenage kid), I find it much better.

OBS is pretty solid. You should also be able to see what codec settings are in use by OBS. Chances are likely it’s using hardware acceleration, so for a given codec, quality for a given bitrate won’t be quite as good as x264 or x265 (but still pretty good)

1 Like

Hello @troodon,
why do you want to render the files with Kdenlive? Do they only need to be cut at the beginning and end? Then would be the best solution: fast and without quality loss, because it doesn’t need to be re-rendered.

But if you need to do more in editing, then of course Kdenlive is excellent. There are many ways to determine the size of the file.

Video 30 makes medium quality, you can experiment there. Also, there are many codecs above that you would have to try.

1 Like

@micha Thanks for the tip on Losslesscut. It looks like a fast and useful program.

Hello @troodon,
Yes, I used losslesscut quite often in my Windows days and it worked perfectly. I haven’t installed it on my Manjaro Linux yet (because I haven’t needed it so far). But I don’t know exactly how to install it there.
Describe whether you get along with it and with which system you work.

Wow, it recommends VP8+Vorbis for non-4k content?

VP8 and Vorbis are kind of old vs. AV1+Opus (which are still libre)

Looks like for H.264, it maps the “quality” setting to the CRF option - which is a variation on CQ.

I usually use a CRF value somewhere in the low-mid 20s for H.264 and H.265 - it is counterintuitive, but for CQ and CRF, lower is higher quality…

@micha My system is Kubuntu 20.04 LTE and I’m using the appimage, which is available by scrolling down this page.

It seems to work well. They do give warnings that the cuts may not be accurate and might need some trial and error but I haven’t played around with it enough to test that. I wish it operated more like a non-linear editor where you can use the razor tool to cut a portion you don’t want, then just eliminate the space. Instead it seems you need to mark the portions you want (or don’t want, there’s a toggle), then create a new video file before you can view how well the cut worked, unlike Kdenlive, or other non-linear editor, where you can immediately view it on the timeline and fine tune the cut. And of course, you can also just drag the ends of a clip to get to the start or end you want.

Back in my Windows days, maybe 2005ish, I used another program to cut commercials from TV documentaries, which worked like the razor tool. I can’t remember the name of that program.

For these reasons, I’m leaning toward staying with Kdenlive or maybe eventually DaVinci Resolve, even though the speed and file size of Losslesscut is tempting.

Yes, not only the speed and file size are tempting, but especially the cutting without re-encoding. There, in my opinion, the desired parts are preserved unchanged, the rest is cut off. This implies that it is not possible to cut to half a second. There are certain in and out points that must be observed.
DaVinci? The dream of every video editor. But it’s a huge software that doesn’t work for me because I want to work without a graphics card.
If you want to learn Kdenlive, I can guide you a bit. Until a year ago I worked with Vegas Pro on Windows - the loss of which was and is the hardest thing for me in my move to Linux. But now I can do all my videos pretty well on Linux with Kdenlive.

Translated with (free version)

I did some screen recordings while using darktable and reduced the frames per second to 14fps. With this setting I was able to stay at high image quality while keeping the filesize low. In the video below you see the low fps only in the mouse movements.
You can download the video, it is approx. 10 minutes in full-HD with a filesize of 20MB and good image quality.

Good point regarding Resolve and hardware - it does NOT play well unless you’re running NVidia. Intel integrated graphics is too weak, and AMD’s drivers are too unstable (there’s a very loooong discussion of AMD’s lack of regression testing, including the impact that lack of regression testing has for Resolve users, somewhere that got linked indirectly from these forums a week or two ago). Driver quality issues are why I switched to NVidia over a decade ago and haven’t gone back.

For modern codecs with predictive/bidirectional frames (difference encoding), changing FPS should not affect file size significantly unless the codec is very broken/configured improperly.