Repository navigation
Export: a 10-bit H.265 format for dark gradients - #858
Merged
Merged
Conversation
Adds "MP4 — H.265 10-bit" (Main 10, yuv420p10le, BT.709 and hvc1 tags) with x265, NVENC and Quick Sync. AMF is not offered: ffmpeg's AMF encoder takes no 10-bit input. 10-bit is probed separately from 8-bit (hevc_nvenc@10), since a GPU can encode one and not the other. The format takes RGBA frames; the GPU's 8-bit I420 path is not used. Measured on a dark gradient (1080p30, 4 s) against the raw RGBA frames at about the same size: x265 48.35 -> 49.87 dB PSNR, NVENC 49.42 -> 51.20 dB. Existing formats and profiles are unchanged. Co-authored-by: caganturgut <271973834+caganturgut@users.noreply.github.com>
|
CaYaDraft — pull request Summary Files
Note Stopping here. I will not merge, push, or change this pull request until you ask.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A twelfth export format, MP4 — H.265 10-bit (H.265 Main 10,
yuv420p10le, BT.709 andhvc1tags). It is opt-in: existing formats, profiles and their ffmpeg arguments are unchanged.Why
Dark, smooth gradients band in 8-bit: the YUV conversion and the compression turn them into flat steps. The picture is still drawn in 8-bit RGBA, so 10-bit does not remove steps already in the drawing; it stops the encoder adding more.
How
depth: 10on the format;videoArgsadds-profile:v main10andyuv420p10le(x265) orp010le(NVENC, Quick Sync).tenBitflag on the encoder table).hevc_nvenc@10) and the real 10-bit arguments, since a GPU can encode 8-bit and not 10-bit.pickEncoderandavailablelook the key up themselves; the capabilities list uses it too.takesYuv420is false for this format, so frames go as RGBA, not through the GPU's 8-bit I420 path.Measured
Dark gradient scene, 1080p30, 4 s, PSNR against the raw RGBA frames the renderer sent (16-bit RGB, no dithering):
A contrast-stretched crop shows large flat blocks in the 8-bit file; the 10-bit one follows the gradient. ffprobe:
Main 10,yuv420p10le,bt709primaries, transfer, matrix and range for both encoders. Speed: about 1.6× the 8-bit time (RGBA instead of I420). Quick Sync could not be checked on this machine; it is offered only where its own 10-bit test encode passes.Tests
Four new tests: arguments per encoder, no I420 path, AMF excluded and separate probe keys, encoder choice following the 10-bit probe.
npm test: 3577/3577.