Skip to content

Commit

Permalink
Spelling (#59)
Browse files Browse the repository at this point in the history
* Spelling fixes.

Signed-off-by: [email protected] <[email protected]>

* Adding indexes.

Signed-off-by: [email protected] <[email protected]>

---------

Signed-off-by: [email protected] <[email protected]>
Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
richardssam and SamRichardsDisney authored Nov 6, 2023
1 parent f6051f7 commit e10e882
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 24 deletions.
2 changes: 1 addition & 1 deletion EncodeAv1.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AV1 has browser support in:
* Edge
* Firefox
* Opera
the main missing one is Safari. Apple has now joing the AOM group, and we are starting to see AV1 hardware support in their latest hardware, but currently safari does still not support it.
the main missing one is Safari. Apple has now joined the AOM group, and we are starting to see AV1 hardware support in their latest hardware, but currently safari does still not support it.

Outside of the web browser, AV1 support is pretty much limited to ffmpeg and VLC.

Expand Down
8 changes: 4 additions & 4 deletions EncodeProres.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Options that can be used include:



Using this with the usual color space flags, seems to work well with the exception of ffmpeg itself is unable to read a prores file, and convert it to a still frame. It needs the flags:`-vf scale=in_color_matrix=bt709:out_color_matrix=bt709` added to the command to ensure the right input colorspace is recognised, e.g.:
Using this with the usual color space flags, seems to work well with the exception of ffmpeg itself is unable to read a prores file, and convert it to a still frame. It needs the flags:`-vf scale=in_color_matrix=bt709:out_color_matrix=bt709` added to the command to ensure the right input colorspace is recognized, e.g.:


<!---
Expand All @@ -77,7 +77,7 @@ ffmpeg -i INPUTFILE.mov -compression_level 10 -pred mixed -pix_fmt rgba64be \
-vf scale=in_color_matrix=bt709:out_color_matrix=bt709 OUTPUTFILE.png
```

However, other encoders seem to be recognised correctly, so there is clearly some metadata missing. I did try using the prores_metadata filter to try adding some additional parameters, but it didn't seem to help.
However, other encoders seem to be recognized correctly, so there is clearly some metadata missing. I did try using the prores_metadata filter to try adding some additional parameters, but it didn't seem to help.

```console
ffmpeg -i ./chip-chart-yuvconvert/basicnclc.mov -c copy \
Expand All @@ -94,7 +94,7 @@ Profile values can be one of:
| lt | 1 | 4:2:2 | 102Mbps | Light |
| standard | 2 | 4:2:2 | 147Mbps | Standard |
| hq | 3 | 4:2:2 | 220Mbps | High Quality 10-bit |
| 4444 | 4 | 4:4:4:4 | 300Mbps | High quality mastering format, can support both RGB and Y'CrCb. Also supports a 16-bit mathmatically lossless alpha. |
| 4444 | 4 | 4:4:4:4 | 300Mbps | High quality mastering format, can support both RGB and Y'CrCb. Also supports a 16-bit mathematically lossless alpha. |
| 4444xq | 5 | 4:4:4:4 | 500MBps | High quality mastering format, supports up to 12 bit, and 16-bit alpha. ffmpeg will only generate up to 10-bit. |

See [https://support.apple.com/en-us/HT202410](https://support.apple.com/en-us/HT202410)
Expand Down Expand Up @@ -150,5 +150,5 @@ Similar to prores_ks, with the exception of xq. Profile values can be one of:
| lt | 1 | 4:2:2 | 102Mbps | Light |
| standard | 2 | 4:2:2 | 147Mbps | Standard |
| hq | 3 | 4:2:2 | 220Mbps | High Quality 10-bit |
| 4444 | 4 | 4:4:4:4 | 300Mbps | High quality mastering format, can support both RGB and Y'CrCb. Also supports a 16-bit mathmatically lossless alpha. |
| 4444 | 4 | 4:4:4:4 | 300Mbps | High quality mastering format, can support both RGB and Y'CrCb. Also supports a 16-bit mathematically lossless alpha. |
| xq | 5 | 4:4:4:4 | 500MBps | High quality mastering format, supports up to 12 bit, and 16-bit alpha. ffmpeg will only generate up to 10-bit. |
2 changes: 1 addition & 1 deletion EncodeVP9.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ffmpeg -r 24 -start_number 1 -i inputfile.%04d.png -frames:v 200 -c:v libvpx-vp9

| --- | --- |
| **-crf 23** | This is the constant quality rate factor, controlling the default quality, similar to h264. The range is a little different to h264, so you may need to test. |
| *-quality good* | May require additional testing, but so far switching to *-quality best* increased the duration, but didnt increase the vmaf score (which is already pretty high with these values of crf). |
| *-quality good* | May require additional testing, but so far switching to *-quality best* increased the duration, but didn't increase the VMAF score (which is already pretty high with these values of crf). |
| -b:v 0 | Unlike with h264, you can set a constant quality rate factor unless it exceeds a specified bit-rate, if the bit-rate is set to 0, it ignores the bit-rate as a factor. |
| -speed 2 | This is also accessible as -cpu_used, it sets how efficient the compression will be. The default is 0, changing this will increase encoding speed at the expense of having some impact on quality and rate control accuracy. (See below). |
| -row-mt 1 | This enables row based multi-threading (see [here](https://trac.ffmpeg.org/wiki/Encode/VP9#rowmt)) which is not enabled by default. |
Expand Down
8 changes: 4 additions & 4 deletions Encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ For details on codec flags, and how we picked the parameters, do goto the page f

## Uncompressed Codecs.

Ffmpeg has support for a small number of uncompressed codecs that are worth using for testing. We dont recommend any of them for day-to-day use.
Ffmpeg has support for a small number of uncompressed codecs that are worth using for testing. We don't recommend any of them for day-to-day use.

| Codec | Description | Pix Fmt | Notes |
|:----------|:-----------|:-----------|:-----------|:-----------|:-----------|
Expand All @@ -56,7 +56,7 @@ Ffmpeg has support for a small number of uncompressed codecs that are worth usin
| v308 | 444 8-bit packed | yuv444p |
| v210 | 422 10-bit | yuv422p10le | |
| r210 | RGB 10-bit |
| png | PNG inside a quicktime, either 8 or 16-bit with or without alpha | rgb24 rgba rgb48be rgba64be pal8 gray ya8 gray16be ya16be monob |
| png | PNG inside a Quicktime, either 8 or 16-bit with or without alpha | rgb24 rgba rgb48be rgba64be pal8 gray ya8 gray16be ya16be monob |

## Other codecs worth considering.

Expand All @@ -75,7 +75,7 @@ See:

### HTJ2K

HTJ2K is a modification of the JPEG2000 codecs, where it has been modified to be more scalable, and sigificantly faster than the original jpeg2000 codec at the expense of a slight increase in file-size. The modification is now part of the JPEG2000 spec, and the decoder is now built into ffmpeg.
HTJ2K is a modification of the JPEG2000 codecs, where it has been modified to be more scalable, and significantly faster than the original jpeg2000 codec at the expense of a slight increase in file-size. The modification is now part of the JPEG2000 spec, and the decoder is now built into ffmpeg.

The codec is royalty free, and there are several open source implementations with non-GPL licenses.

Expand All @@ -90,7 +90,7 @@ See:


TODO:
* Figure out the missing metadata so that ffmpeg can correctly decode a quicktime to still.
* Figure out the missing metadata so that ffmpeg can correctly decode a Quicktime to still.
*

### See Also
Expand Down
4 changes: 2 additions & 2 deletions EncodingOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ Adding the `-d uint16` flag forces the intermediate file format to be 16-bit, ra
## Image resizing.

There are a couple of gotchas with image resizing to watch out for:
* A number of the encoders require that the resulting movie file be a factor of 2, there isnt a direct way to do this in oiiotool, you would need to read the source image file to determine the right output scale.
* Watch for filter options, if you choose to do the filtering in ffmpeg, it defaults to bicubic, which is not a great choice for downrezing image formats. For reasons why lancozs is prefered, see:
* A number of the encoders require that the resulting movie file be a factor of 2, there isn't a direct way to do this in oiiotool, you would need to read the source image file to determine the right output scale.
* Watch for filter options, if you choose to do the filtering in ffmpeg, it defaults to bicubic, which is not a great choice for downrezing image formats. For reasons why lancozs is preferred, see:
* [https://legacy.imagemagick.org/Usage/filter/](https://legacy.imagemagick.org/Usage/filter/)
* [https://www.cambridgeincolour.com/tutorials/image-resize-for-web.htm](https://www.cambridgeincolour.com/tutorials/image-resize-for-web.htm)

Expand Down
6 changes: 3 additions & 3 deletions FfmpegInputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ TODO TEST.

### Globbing image sequence definition.

There is a globbing option that makes it a little easier to specify a block of frames, since you dont need to specify the first frame.
There is a globbing option that makes it a little easier to specify a block of frames, since you don't need to specify the first frame.

```console
ffmpeg -pattern_type glob -i "img.*.png" foo.mov
Expand All @@ -64,11 +64,11 @@ The following aliases are defined for framerate values, either `-r` or `-framera
| film | 24 | |
| ntsc-film | 24000/1001 | 23.98 fps |

Is is prefereable to use a fractional rate, or one of the above settings where possible, for example `-r 30000/1001` is the more precise version of 29.97.
Is is preferable to use a fractional rate, or one of the above settings where possible, for example `-r 30000/1001` is the more precise version of 29.97.

Other common fractional rates not defined with presets include:

| 60000/1001 | 59.94 fps equiavalent. |
| 60000/1001 | 59.94 fps equivalent |
| 120000/1001 | 119.88 fps equivalent |

If not specified, the default framerate chosen is 25 fps (i.e. pal).
Expand Down
2 changes: 1 addition & 1 deletion Quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ffmpeg -r 24 -start_number 1 -i inputfile.%04d.png -vframes 100 \
| **-profile:v 3** | Prores profile |
| **-qscale:v 9** | Controls the output quality, lower numbers higher quality and larger file-size. *TODO Need to do testing with different values.* |
| **-pix_fmt yuv422p10le** | Convert to 10-bit YUV 422 |
| **-vendor apl0** | Treat the file as if it was created by the apple-Prores encoder (even though it isnt), helps some tools correctly read the quicktime |
| **-vendor apl0** | Treat the file as if it was created by the apple-Prores encoder (even though it isn't), helps some tools correctly read the quicktime |

For more details see:
* [Prores](Encoding.md#prores)
Expand Down
18 changes: 15 additions & 3 deletions WebColorPreservation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ parent: Encoding Overview
</style>

# Color Metadata and Web Color Preservation <a name="nclc"></a>


<details open markdown="block">
<summary>
Table of contents
</summary>
{: .text-delta }
1. TOC
{:toc}
</details>


There are a number of metadata flags designed to help the player know what colorspace the media is in, so it can correctly interpret it for playback. We do recommend adding the metadata tags to media, particularly if you are reviewing it on a web browser, however there are a lot of gotchas here.

The NCLC/NCLX is defined as a ISO spec here (see [ISO-23091](https://www.iso.org/standard/73412.html) ). The numbers below are part of the definition. NCLC stands for Non-Consistent Luminance Coding, a brief overview of its history is here. For MP4 files, its also known as NCLX. Additionally this metadata can also be represented in the h264 metadata stream in the video usability Information (VUI) block.
Expand Down Expand Up @@ -42,16 +54,16 @@ For more details see: [here](tests/greramp-osx/ycrcbcompare.md)
Using the `-color_trc iec61966-2-1` flag (the sRGB spec is defined as [iec61966-2-1](https://en.wikipedia.org/wiki/SRGB) ). This appears to be the most reliable one, working across all machines and browsers that support it. It's a shame that the flag has to be so cryptic.

<table class='compare'>
<TR><TD><img width=400 src="tests/greyramp-osx/greyscale-srgb.png"/></TD><TD>Source SRGB PNG</TD></TR>
<TR><TD><img width=400 src="tests/greyramp-osx/greyscale-srgb.png"/></TD><TD>Source sRGB PNG</TD></TR>
<TR><TD><video width=400><source src="tests/greyramp-osx/greyscale-srgb.mp4"></video></TD><TD>Mp4 Video should match PNG</TD></TR>
</table>

## bt709
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.
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.

<table class='compare'>
<TR><TD><video width=400><source src="tests/greyramp-osx/greyscale-rec709.mp4"></video></TD><TD>This is the bt709 mp4.</TD></TR>
<TR x-show="/^((?!chrome|android).)*safari/i.test(navigator.userAgent)"><TD><video width=400><source src="tests/greyramp-osx/greyscale-gamma195.mov"></video></TD><TD>This is a quicktime with a gamma of 1.95. This should be nearly identical to the above bt709 mp4, which implies OSX is correctly interpreting camera bt709.</TD></TR>
<TR x-show="/^((?!chrome|android).)*safari/i.test(navigator.userAgent)"><TD><video width=400><source src="tests/greyramp-osx/greyscale-gamma195.mov"></video></TD><TD>This is a Quicktime with a gamma of 1.95. This should be nearly identical to the above bt709 mp4, which implies OSX is correctly interpreting camera bt709.</TD></TR>
<TR><TD><video width=400><source src="tests/greyramp-osx/greyscale-srgb.mp4"></video></TD><TD>This is the srgb.mp4 which may match the bt709 result. For chrome on windows, this should match bt709, which implies its treating it as sRGB.</TD></TR>
</table>

Expand Down
18 changes: 14 additions & 4 deletions enctests/HDR_Encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ parent: Encoding Overview

# HDR Encoding.

{: .warning } This is currently under development, use at your own risk.
<details open markdown="block">
<summary>
Table of contents
</summary>
{: .text-delta }
1. TOC
{:toc}
</details>

{: .warning }
This is currently under development, use at your own risk.

There are a lot of competing standards for [HDR](https://www.lightillusion.com/what_is_hdr.html), we are going to focus only on two due to their relative simplicity (not requiring dynamic metadata), and lack of licensing fees.
1. [HLG](https://en.wikipedia.org/wiki/Hybrid_log%E2%80%93gamma) encoding, developed by NHK and the BBC.
Expand Down Expand Up @@ -87,7 +97,7 @@ We explicitly define the X265 parameters (see [x265](https://x265.readthedocs.io

## HLG

[HLG](https://en.wikipedia.org/wiki/Hybrid_log%E2%80%93gamma) encoding, developed by NHK and the BBC. Its designed to be backwards compatible with the EOTF to SDR but with an exension for higher intensities. It has a more limited maximum peak brightness of 5000 nits rather than 10000 nits for PQ.
[HLG](https://en.wikipedia.org/wiki/Hybrid_log%E2%80%93gamma) encoding, developed by NHK and the BBC. Its 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.

It is also designed to adapt to the surrounding room light levels, unlike PQ which is fixed. The downside is that this adaption could affect the media in unexpected ways.

Expand Down Expand Up @@ -159,8 +169,8 @@ We explicitly define the X265 parameters (see [x265](https://x265.readthedocs.io
| transfer=arib-std-b67 | Set the ETOF to HLG (aka. arib-std-bt67 ) |
| colormatrix=bt2020nc | UTagging the YcBCr as being encoded using the BT-2020 non-constant luminance. |
| range=limited | Set the source range to be tv range. |
| master-display=G\(13250,34500\)B\(7500,3000\)R\(34000,16000\)WP\(15635,16450\)L\(10000000,1\) | SMPTE ST 2086 mastering display color volume SEI info, specified as a string which is parsed when the stream header Essentially setting the X,Y display primaries for rec2020 along with the Whitepoint, and the Max,min luminance values in units of 0.00001 NITs. See the above docs for more info. |
| max-cll=1000,400 | Set the Maximum content light level (in this case 2000 nits = max content light level and 400 = the MaxFall - the maxiumum frame-average light level) |
| master-display=G\(13250,34500\)B\(7500,3000\)R\(34000,16000\)WP\(15635,16450\)L\(10000000,1\) | SMPTE ST 2086 mastering display color volume SEI info, specified as a string which is parsed when the stream header Essentially setting the X,Y display primaries for rec2020 along with the White-point, and the Max,min luminance values in units of 0.00001 NITs. See the above docs for more info. |
| max-cll=1000,400 | Set the Maximum content light level (in this case 2000 nits = max content light level and 400 = the MaxFall - the maximum frame-average light level) |

TODO - We do need to understand if the max-cll and master-display parameters are even used for HLG display.

Expand Down
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ An example of why this is important is to compare:
<TR><TD style='padding-top:0px; padding-bottom: 0px'>Using the libavscale library</TD><TD style='padding-top:0px; padding-bottom: 0px'><img src="sourceimages/libswscale-example.png" style='height:70px'/> </td><td style='padding-top:0px; padding-bottom: 0px'> Should match original</TD></TR>
</table>

You can see the default ffmpeg conversion introduces a dramatic colorshift that if you use the right flags, you can match the original. See [Color space conversion](ColorPreservation.html#Color-space-conversion) for more details on this.
You can see the default ffmpeg conversion introduces a dramatic color shift that if you use the right flags, you can match the original. See [Color space conversion](ColorPreservation.html#Color-space-conversion) for more details on this.

1. [Acknowledgements](#Acknowledgements)
2. [Encoding Cheat Sheet](Quickstart.html)
Expand Down

0 comments on commit e10e882

Please sign in to comment.