Skip to content

Commit 6e46690

Browse files
authored
Apple gamma (#58)
* Missing images Signed-off-by: [email protected] <[email protected]> * Added in section for -mov_gamma flag. Signed-off-by: [email protected] <[email protected]> * Highlight results of osx trc tests that gamma 2.2 does not give the right results. Signed-off-by: [email protected] <[email protected]> --------- Signed-off-by: [email protected] <[email protected]> Co-authored-by: [email protected] <[email protected]>
1 parent dae83b6 commit 6e46690

9 files changed

+32
-4
lines changed

WebColorPreservation.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Using the `-color_trc iec61966-2-1` flag (the sRGB spec is defined as [iec61966-
4747
</table>
4848

4949
## bt709
50-
Using the `-color_trc bt709` flag (AKA rec709). This is often the default tag, however producers the most confusing results. On Chrome this will actually match sRGB, but on safari it will match the camera bt709 parameters, which roughly match gamma 1.95. NOTE, there is no support at all for BT1886, which is what we would conventionally use for the TV gamma of 2.4, the closest you can get is using quicktime on OSX.
50+
Using the `-color_trc bt709` flag (AKA rec709). This is often the default tag, however produces the most confusing results. On Chrome this will actually match sRGB, but on safari it will match the camera bt709 parameters, which roughly match gamma 1.95. NOTE, there is no support at all for BT1886, which is what we would conventionally use for the TV gamma of 2.4, the closest you can get is using quicktime on OSX. See [Apple quicktime gamma](#apple-quicktime-gamma-and-bt1886) for the workaround.
5151

5252
<table class='compare'>
5353
<TR><TD><video width=400><source src="tests/greyramp-osx/greyscale-rec709.mp4"></video></TD><TD>This is the bt709 mp4.</TD></TR>
@@ -62,7 +62,7 @@ Screenshots
6262
</table>
6363

6464
## Gamma 2.2
65-
Using the `-color_trc gamma22` flag. This does not work correctly on safari.
65+
Using the `-color_trc gamma22` flag. This does not work correctly on safari, see [Color-TRC Comparison for OSX](/EncodingGuidelines/tests/greyramp-osx/compare.html)
6666

6767
<table class='compare'>
6868
<TR><TD><img width=400 src="tests/greyramp-osx/greyscale-g22.png"/></TD><TD>Source gamma 2.2 PNG</TD></TR>
@@ -77,6 +77,32 @@ Using the `-color_trc linear` flag. This is unlikely to ever be used for video,
7777
<TR><TD><video width=400><source src="tests/greyramp-osx/greyscale-lin.mp4"></video></TD><TD>Mp4 Video should match PNG</TD></TR>
7878
</table>
7979

80+
## Apple Quicktime Gamma and bt1886
81+
82+
Apple has a workaround flag for quicktime files that allows you to explicitly set the gamma of the file. Adding the flags
83+
`-color_trc unknown -movflags write_colr+write_gama -mov_gamma 2.4` would correctly set the gamma of the media to bt1886 on Apple hardware. You can similarly use this for any other gamma, see: [Color-TRC Comparison for OSX](/EncodingGuidelines/tests/greyramp-osx/compare.html). NOTE, you do need the `-color_trc unknown` so that it knows to fall back on the mov_gamma value.
84+
85+
<!---
86+
name: test_quickstart
87+
sources:
88+
- sourceimages/chip-chart-1080-noicc.png.yml
89+
comparisontest:
90+
- testtype: idiff
91+
testtemplate: idiff {originalfile} {newfile}
92+
- testtype: assertresults
93+
tests:
94+
- assert: less
95+
value: max_error
96+
less: 0.00195
97+
-->
98+
```console
99+
ffmpeg -r 24 -start_number 1 -i inputfile.%04d.png \
100+
-sws_flags spline+accurate_rnd+full_chroma_int \
101+
-vf "scale=in_range=full:in_color_matrix=bt709:out_range=tv:out_color_matrix=bt709" \
102+
-c:v libx264 -t 5 -pix_fmt yuv420p -qscale:v 1 -color_range tv -colorspace bt709 -color_primaries bt709 \
103+
-color_trc unknown -movflags write_colr+write_gama -mov_gamma 2.4 ./greyramp-osx/greyscale-gamma24.mov
104+
```
105+
80106
## Summary
81107
We recommend the use of `-color_trc iec61966-2-1` to use sRGB. There is no support for a gamma 2.4, if you still need it, we recommend that you use -color_trc unknown and ensure that your monitor is set correctly
82108

browsercompare/chrome-rec709-osx.png

22.2 KB
Loading
Loading

browsercompare/gamut-all.png

48 KB
Loading
28 KB
Loading

browsercompare/gamut-displayp3.png

37.8 KB
Loading
2.75 KB
Loading

browsercompare/safari-rec709-osx.png

13.3 KB
Loading

tests/greyramp-osx/colortrccompare.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
---
22
layout: default
33
nav_order: 6.2
4-
title: Color TRC Comparison
4+
title: Color TRC Comparison for OSX
55
parent: Test Output
66
---
77

8-
To see a full screen version of this page goto [here](compare.html)
8+
To see a full screen version of this page goto [here](compare.html)
9+
10+
NOTE, this test is highlighting that some of the color-trc results are incorrect on OSX, since it is showing that gamma2.2 and gamma 2.8 do not match the corresponding color-trc curves. It is also showing that -color_trc 1 is matching gamma 1.98.
911

1012
{% include_relative compare.html %}

0 commit comments

Comments
 (0)