Skip to content

Commit 6f95e38

Browse files
authored
Minor tweaks and adding ProRes. (#110)
Signed-off-by: [email protected] <[email protected]>
1 parent 45690e4 commit 6f95e38

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

enctests/HDR_Encoding.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ However, since we are typically talking about VFX review for individual shots, t
4444

4545
So instead of specifying a gamma curve as the transfer function, the Perceptual Quantizer (PQ), standardized as [SMPTE ST2084](https://en.wikipedia.org/wiki/Perceptual_quantizer) represents luminance from 0 to 10000 nits. It still uses a power function to give more detail in the lower range. Office monitors are often in the 250-350 nit range.
4646

47-
In practice most HDR monitors are more likely to be in the 1000-2000 range, and even there they often try to limit the percentage of the overall screen that is full brightness This is done to manage power consumption and prevent overheating from thermal throttling.
47+
In practice most HDR monitors are more likely to be in the 1000-2000 nit range, and even there they often try to limit the percentage of the overall screen that is full brightness This is done to manage power consumption and prevent overheating from thermal throttling.
4848

4949
### Frame prep
5050

@@ -58,7 +58,7 @@ export OCIO=ocio://studio-config-v1.0.0_aces-v1.3_ocio-v2.1
5858
oiiotool -v --framepadding 5 --frames 6700-6899 sparks2/SPARKS_ACES_#.exr\
5959
--iscolorspace "ACES2065-1" --resize 1920x1014 \
6060
--ociodisplay "Rec.2100-PQ - Display" "ACES 1.1 - HDR Video (1000 nits & P3 lim)" \
61-
-d uint16 -o sparks2_pq2000/sparks2_pq1000.#.png
61+
-d uint16 -o sparks2_pq1000/sparks2_pq1000.#.png
6262
```
6363

6464
| --- | --- |
@@ -70,7 +70,7 @@ The other option built in for PQ is a config with 2000 nits \-
7070
\--ociodisplay "Rec.2100-PQ \- Display" "ACES 1.1 \- HDR Video (2000 nits & Rec.2020 lim)"
7171
There is also a 4000 nit max and P3 target gamuts available in the OCIO config mentioned above. And if you are willing to use OCIO 2.5, there are improved HDR view transforms based on ACES 2.0. This has 500, 1000, 2000, 4000 nit max luminance and P3 and Rec.2020 target gamuts.
7272

73-
### PQ10 FFMPEG encoding
73+
### PQ10 FFMPEG H265 encoding
7474

7575
PQ10 is a simplified HDR format essentially HDR10 without the metadata. It uses the [PQ EOTF](https://en.wikipedia.org/wiki/Perceptual_quantizer) aka SMPTE ST 2084 otherwise is somewhat similar to create as HLG, but there may be different reasons for choosing each.
7676

@@ -114,12 +114,14 @@ ffmpeg \
114114

115115
In many cases this may be sufficient, particularly if you are using the ACES transforms that closely map to the maximum luminance of the review monitor (e.g. the 1000 nit view-transforms). It depends on how much the monitor can take advantage of the master-display parameters (see below).
116116

117-
### PQ 444 FFMPEG encoding
117+
This will also work for other codecs such as h264, vp9, ProRes, AV1, OpenAPV although you would need to change or remove the -tag:v flag.
118+
119+
### PQ 422 FFMPEG H265 encoding
118120

119121
Here we are going to add the additional Mastering Display metadata, in addition to the parameters used by PQ10.
120122

121123
<!---
122-
name: test_pq2000
124+
name: test_pq1000
123125
sources:
124126
- sourceimages/smptehdbars_10.dpx.yml
125127
comparisontest:
@@ -133,14 +135,13 @@ comparisontest:
133135
-->
134136
```console
135137
ffmpeg \
136-
-r 30 -start_number 6700 -i sparks2_pq2000/sparks2_pq2000.%05d.png \
138+
-r 30 -start_number 6700 -i sparks2_pq1000/sparks2_pq1000.%05d.png \
137139
-c:v libx265 \
138140
-vf "scale=in_range=full:in_color_matrix=bt2020:out_range=tv:out_color_matrix=bt2020" \
139-
-tag:v hvc1 \
140141
-color_range tv -color_trc smpte2084 -color_primaries bt2020 -colorspace bt2020nc \
141-
-pix_fmt yuv444p10le
142-
-x265-params "hdr-opt=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:range=limited:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1):max-cll=1000,400" -tag:v hvc1 \
143-
sparks2_pq2000_444.mov
142+
-pix_fmt yuv422p10le -tag:v hvc1 \
143+
-x265-params "hdr-opt=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:range=limited:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1):max-cll=1000,400" \
144+
sparks2_pq1000_422.mov
144145
```
145146

146147
The HDR metadata parameters really is what separates HDR10 from PQ10. The parameters below are:
@@ -224,6 +225,18 @@ To specify the display-master parameters with VP9, you need to use the [mkvmerg
224225

225226
It is currently not possible to add this metadata with ffmpeg, but this hopefully will be addressed.
226227

228+
### ProRes
229+
230+
ProRes does have the ability to add the Mastering Display Metadata, and while it seems ffmpeg can convert a file with it to another, preserving the metadata, there does not appear a way to add it to a newly created ProRes file (if you know how to, do please let us know).
231+
232+
An example of this file is the [NAS Sole Mates ASWF DPEL HDR Production Sample](https://dpel-assets.aswf.io/solemates/quicktime_media-sdr_hdr-v1.0.0.zip), and if you look at the file with ffprobe, you will see:
233+
234+
```
235+
Side data:
236+
Mastering Display Metadata, has_primaries:1 has_luminance:1 r(0.6800,0.3200) g(0.2650,0.6900) b(0.1500 0.0600) wp(0.3127, 0.3290) min_luminance=0.000100, max_luminance=1000.000000
237+
```
238+
239+
227240
## HLG
228241

229242
[HLG](https://en.wikipedia.org/wiki/Hybrid_log%E2%80%93gamma) encoding, developed by NHK and the BBC. It's designed to be backwards compatible with the EOTF to SDR but with an extension for higher intensities. It has a more limited maximum peak brightness of 5000 nits rather than 10000 nits for PQ (although 1000 is more common).

0 commit comments

Comments
 (0)