Bug 462018 - Rendering a video in H.265 with 10-bit color using libx265 always results in a video with 8-bit color, no matter what settings are used
Summary: Rendering a video in H.265 with 10-bit color using libx265 always results in ...
Status: RESOLVED WORKSFORME
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Display & Export (show other bugs)
Version: 22.08.3
Platform: Appimage Linux
: NOR major
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-19 05:51 UTC by fuza-kde
Modified: 2023-12-14 03:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fuza-kde 2022-11-19 05:51:19 UTC
SUMMARY

Rendering a video in H.265 with 10-bit color using libx265 always results in a video with 8-bit color, no matter what settings are used.

Based on documentation, recommendations, examples, and shots in the dark, different combinations of parameters & values like mlt_image_format (rgb | rgba | rgb24), pix_fmt (yuv420p10le | yuv422p10le | yuv444p10le | p10le), and colorspace (rgb | 709 | bt709) have been tried without success, with the appropriate combinations working as intended in other codecs.

Aborting mid-render in the Job Queue tab to bring up the error log box (from 22.08.3 onward) always shows that libx265 only has 8-bit support, e.g. "x265 [info]: build info [Linux][GCC 9.3.1][64 bit] 8bit".

The same behavior occurs on multiple versions of Kdenlive, specified below.

Attempting an equivalent command with stand-alone ffmpeg built with libx265 10-bit support produces the expected 10-bit video.


STEPS TO REPRODUCE

1. Open Kdenlive
2. Click the "Add Clip or Folder..." button in the Project Bin
3. Select the source video file and press the "OK" button to add the clip
4. When prompted to switch to clip profile, click the "Switch" button
5. Click and drag the video from the "Clip Monitor" to the "V1" timeline below all the way to the left and release
6. Click the "Project" menu, and then the "Render..." option to open the "Rendering" window
7. (For 22.08.3) Create a custom preset by clicking the "Create new preset" button, type "Custom" for the "Group" field, "H.265 10-bit" for the "Preset name" field, select "matroska" in the "Container" drop-down menu, then click the "Edit Render Preset" button in the lower left corner of the window to display a textbox right above it, delete the text in it and replace it with the following line:
f=matroska vcodec=libx265 mlt_image_format=rgb pix_fmt=yuv420p10le an=1 audio_off=1
Then click the "OK" button in the lower right corner of the window to save the custom preset. This step is only needed the first time and can be skipped in following tries.
8. In the "Rendering" window choose an appropriate path and filename for the video to be rendered, then select the newly created custom preset "H.265 10-bit" from the "Custom" group in the "Presets" list, and click the button "Render to File" to start rendering the video
9. Wait until the rendering job finishes in the "Job Queue" tab
10. Video rendered


OBSERVED RESULT

When examining the rendered video with MediaInfo, its output shows that the video's bit depth is 8 bits and the writing library only had 8-bit support.


EXPECTED RESULT

When examining the rendered video with MediaInfo, its output should show that the video's bit depth is 10 bits and the writing library had 10-bit support.


SOFTWARE/OS VERSIONS
OS: Ubuntu 20.04.5 LTS 64-bit
Kdenlive:
22.04.3 (MLT 7.8.0, Ubuntu repositories)
22.08.3 (MLT 7.10.0, AppImage)
22.11.80/22.12 Beta1 (MLT 7.11.0, AppImage)
23.03.70 rev. 589b3eb24 (MLT 7.11.0, AppImage)
23.03.70 rev. d592484a4 (MLT 7.11.0, AppImage)


ADDITIONAL INFORMATION

For more context:
https://www.reddit.com/r/kdenlive/comments/yxz3iv/is_it_possible_to_render_directly_to_h265_hevc/
Comment 1 farid 2023-11-14 15:10:40 UTC
Can you try again with latest appimage please? Note that if you add any effect or transition it will produce an 8 bit video.
Comment 2 Bug Janitor Service 2023-11-29 03:45:46 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Bug Janitor Service 2023-12-14 03:46:12 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!