Bug 512578

Summary: "Lossless" render option does not actually render lossless
Product: [Applications] kdenlive Reporter: lras916
Component: Rendering & ExportAssignee: Jean-Baptiste Mardelle <jb>
Status: REPORTED ---    
Severity: normal CC: ilikefoss
Priority: NOR    
Version First Reported In: 25.08.3   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: a short yuv444p sample highlighting the benefits of the 4:4:4 pixel format.
an even shorter bgra sample highlighting the benefits of the 4:4:4 pixel format.
observed vs expected result

Description lras916 2025-11-25 02:17:56 UTC
Created attachment 187141 [details]
a short yuv444p sample highlighting the benefits of the 4:4:4 pixel format.

SUMMARY
When working with yuv444p or bgra color format video (and likely other 4:4:4 formats), the rendered/exported output video is downsampled to the 4:2:2 chroma subsampling format, even though a "lossless" output preset was chosen.

STEPS TO REPRODUCE
1. Start a new project and insert either a yuv444p or bgra color format video onto the timeline. I have included sample videos in both formats as attachments. The bgra sample is just a few frames, due to the format not being compatible with h264 lossless compression. (The videos starting points are identical).
2. Go to the render page, and choose any of the 4 default presets under the "Lossless/HQ" folder.
3. Export the video and notice how the image has changed.


OBSERVED RESULT
Lossy chroma subsampling has been performed, giving the image a 4:2:2 look, and sometimes (depending on different variables) the color format has been converted to yuv422p. Some of the text in the video example has lost color, and the color is blurry.

EXPECTED RESULT
The exported video should look identical to the source, retaining the 4:4:4 color format characteristics. The input video in this example looks identical to the exported video.

SOFTWARE/OS VERSIONS
Windows: 11 Home 25H2 build 26200.7171

ADDITIONAL INFORMATION
I found that recreating one of these formats and adding the additional parameters "mlt_image_format=rgba" AND "pix_fmt=bgra" or "pix_fmt=yuv444p" (depending on whether the target bgra or yuv444p) solved the issue. While this is a workaround, I believe the exported video should be in one of these formats by default, since the current implementation of the lossless presets are by definition not lossless.
Comment 1 lras916 2025-11-25 02:22:51 UTC
Created attachment 187142 [details]
an even shorter bgra sample highlighting the benefits of the 4:4:4 pixel format.

it is just 5 frames because of the nature of it being lossless and in bgra format, making it huge on larger lenghts
Comment 2 lras916 2025-11-25 02:24:21 UTC
Created attachment 187143 [details]
observed vs expected result

I'm just adding this attachment so people can see how the issue looks without downloading the samples and going through with reproducing it.