Skip to content

Commit

Permalink
Media update (#69)
Browse files Browse the repository at this point in the history
* Media should be 16-bit sources.

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

* Predefine OCIO config.

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

* Making sure faststart is bold.

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

* Change start frame of wind-chime.

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

* Fixing broken links.

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

* Add a note about no compression options.

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

* Add in the default OCIO path.

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

* Update which media is being used.

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

* Add a reference to the HDR color bars.

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

* Slight re-wording.

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

* Added in the hevc_nvenc formats.

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 22, 2023
1 parent ecc81aa commit 5630a42
Show file tree
Hide file tree
Showing 15 changed files with 83 additions and 26 deletions.
4 changes: 2 additions & 2 deletions EditorialWorkflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ For examples of the conform workflow, see: [VFX Subclipping relink](https://www.
## AVID Media Composer Workflows

Deciding on whether to create Op1a vs. OpAtom does depend on which version of media composer you are using. Newer ones tend to prefer op-atom, but you should check with your editor.
For details on creating MXF files, see [OpAtom](/EncodeDNXHD.html#op-atom-mxf) and [Op1a](EncodeDNXHD.html#op1a-mxf).
For details on creating MXF files, see [OpAtom](EncodeDNXHD.html#op-atom-mxf) and [Op1a](EncodeDNXHD.html#op1a-mxf).

Part of the decision is whether you want a single file to also contain the audio, and whether you want to additionally use AAF files (see below).

If an AVID imports a media file with no timecode, it will default to 01:00:00:00.
For this reason it can be desirable to do one of the above approaches, but do work with editorial to confirm what they would like.

[OpAtom](/EncodeDNXHD.html#op-atom-mxf) files do not get directly imported into the AVID, instead you copy them directly into the /Users/Shared/AvidMediaComposer/Avid MediaFiles/MXF/{NUMBER} folder (e.g. /Users/Shared/AvidMediaComposer/Avid MediaFiles/MXF/2) on OSX or C:\Avid MediaFiles\MXF\{NUMBER} on windows. You can make a higher number, but Media Composer will also scan existing folders. Media composer will scan for new files and create (or update) a msmMMOB.mdb file, which is a database of the MOB ID's of the files. This can then be dragged into a Avid Bin to import the new files.
[OpAtom](EncodeDNXHD.html#op-atom-mxf) files do not get directly imported into the AVID, instead you copy them directly into the /Users/Shared/AvidMediaComposer/Avid MediaFiles/MXF/{NUMBER} folder (e.g. /Users/Shared/AvidMediaComposer/Avid MediaFiles/MXF/2) on OSX or C:\Avid MediaFiles\MXF\{NUMBER} on windows. You can make a higher number, but Media Composer will also scan existing folders. Media composer will scan for new files and create (or update) a msmMMOB.mdb file, which is a database of the MOB ID's of the files. This can then be dragged into a Avid Bin to import the new files.

NOTE, there is also an associated folder called UME - /Users/Shared/AvidMediaComposer/Avid MediaFiles/UME/{NUMBER} that can take [Op1a](EncodeDNXHD.html#op1a-mxf) files. However, with recent testing (version 2023.8.2.58057.0), the metadata does not reliably get imported.

Expand Down
6 changes: 4 additions & 2 deletions EncodeDNXHD.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ parent: Codec Comparisons

Avid [DNxHD](https://en.wikipedia.org/wiki/Avid_DNxHD) ("Digital Nonlinear Extensible High Definition") is a lossy post-production codec that is intended for use for editing as well as a presentation format.

There are a number of pre-defined resolutions, frame-rates and bit-rates that are supported, see [AVID Resolutions](https://en.wikipedia.org/wiki/List_of_Avid_DNxHD_resolutions) for a list. However, we are going to focus on the DNxHR version of the codec, since it allows quite a bit more flexibility for larger image sizes than HD, more flexible frame rates and bit-rates of up to 3730Mbit/s (See [DNxHR-Codec-Bandwidth-Specifications](https://avid.secure.force.com/pkb/articles/en_US/White_Paper/DNxHR-Codec-Bandwidth-Specifications) ).
There are a number of pre-defined resolutions, frame-rates and bit-rates that are supported, see [AVID Resolutions](#dnxhd-profiles) for a list, and these are commonly requested by Editorial. However, we recommend using the DNxHR version of the codec, since it allows quite a bit more flexibility for larger image sizes than HD, more flexible frame rates and bit-rates of up to 3730Mbit/s (See [DNxHR-Codec-Bandwidth-Specifications](https://avid.secure.force.com/pkb/articles/en_US/White_Paper/DNxHR-Codec-Bandwidth-Specifications) ).


Supported pixel formats: yuv422p yuv422p10le yuv444p10le gbrp10le
Expand Down Expand Up @@ -57,10 +57,12 @@ ffmpeg -r 24 -start_number 1 -i inputfile.%04d.png -frames:v 200 -sws_flags area
| dnxhr_hqx | High Quality | 4 | YUV 4:2:2 (yuv422p, yuv422p10) | 12 (*) | 5.5: 1 |
| dnxhr_444 | DNxHR 4:4:4 | 5 | YUV 4:4:4 or RGB (yuv444p10, gbrp10) | 12 (*) | 4.5:1 |

There really are not any significant flags to be used, changing bit-rate has no effect.
There really are not any significant flags to be used, since the quality is adjusted automatically to fit the compression ratio. Similarly the bit-rate flag has no impact on this. For more Bit-rate control, see the [DNxHD settings](#dnxhd-profiles) below.

(*) The 12-bit depth is what the codec can support, but does not appear to be supported by ffmpeg, since the encoding only allows 10-bit image data to be encoded.

NOTE, we have sometimes seen incompatibility issues with DNxHD Quicktimes not being read by Black Magic devices (e.g. the HyperDeck Studio), so there may be cases where you will need to use Resolve or Adobe Media Encoder to create compatible media.

## ffmpeg RGB support

<!---
Expand Down
5 changes: 4 additions & 1 deletion EncodeHevc.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ffmpeg -r 24 -start_number 1 -i inputfile.%04d.png -frames:v 200 -c:v libx265 \
| -x265-params lossless=1 | Does lossless encoding, -crf 0 is not required |
| -tag:v hvc1 | To make it "Apple "Industry standard" compliant |
| -profile main | Profile can be one of main or main10 or main12 |
**-movflags faststart | This re-organises the mp4 file, so that it doesnt have to read the whole file to start playback, useful for streaming. It can add a second or so to do this, since it does require re-writing the file. |
**-movflags faststart** | This re-organizes the mp4 file, so that it doesn't have to read the whole file to start playback, useful for streaming. It can add a second or so to do this, since it does require re-writing the file. |
## libx265 crf values

To help pick appropriate values with the CRF flag, we have run the [Test Framework](enctests/README.html) through some of the [reference media](enctests/sources/enc_sources/README.html).
Expand Down Expand Up @@ -96,6 +96,9 @@ nv12

## hevc_nvenc

Supported pixel formats:
yuv420p nv12 p010le yuv444p p016le yuv444p16le bgr0 bgra rgb0 rgba x2rgb10le x2bgr10le gbrp gbrp16le cuda d3d11

https://gist.github.com/jbboehr/f487b659cac086b176703c718d797f3b
https://superuser.com/questions/1296374/best-settings-for-ffmpeg-with-nvenc

Expand Down
2 changes: 1 addition & 1 deletion Encodeh264.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ffmpeg -r 24 -start_number 100 -i inputfile.%04d.png -frames:v 200 -c:v libx264
| **-preset slow** | [https://trac.ffmpeg.org/wiki/Encode/H.264#FAQ](https://trac.ffmpeg.org/wiki/Encode/H.264#FAQ) |
| **-qscale:v 9** | Generic quality scale flag: [https://www.ffmpeg.org/ffmpeg.html#toc-Main-options](https://www.ffmpeg.org/ffmpeg.html#toc-Main-options) - TODO experiment with this. |
| **-tune film** | See below. |
**-movflags faststart | This re-organises the mp4 file, so that it doesnt have to read the whole file to start playback, useful for streaming. It can add a second or so to do this, since it does require re-writing the file. |
**-movflags faststart** | This re-organises the mp4 file, so that it doesnt have to read the whole file to start playback, useful for streaming. It can add a second or so to do this, since it does require re-writing the file. |

### Tune Parameter

Expand Down
2 changes: 1 addition & 1 deletion EncodingOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TODO - Provide other approaches for quickly getting going (e.g. vcpkg)
## Quick introduction to color conversion using oiiotool

```
export OCIO=~/git/OpenColorIO-Configs/aces_1.2/config.ocio # Or wherever your OCIO is.
export OCIO=ocio://studio-config-v1.0.0_aces-v1.3_ocio-v2.1 # Or wherever your OCIO is, this is using a builtin OCIO config, with OCIO 2.2 or newer.
oiiotool --framepadding 5 --frames 1-100 sourcefilename_acescg.#.exr --resize 1920x0 \
--colorconvert acescg srgb --dither -o outputimage.#.png
```
Expand Down
2 changes: 1 addition & 1 deletion Quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ffmpeg -r 24 -start_number 1 -i inputfile.%04d.png -sws_flags area+accurate_rnd+
**-colorspace bt709** | mp4 metadata - specifying bt709 yuv color pixel format
**-color_primaries bt709** | mp4 metadata - bt709 color gamut primaries
**-color_trc iec61966-2-1** | mp4 metadata color transfer = iec61966-2-1 = sRGB - See tests [here](WebColorPreservation.html). In some cases, you may also want -color_trc bt709 |
**-movflags faststart | This re-organises the mp4 file, so that it doesnt have to read the whole file to start playback, useful for streaming. It can add a second or so to do this, since it does require re-writing the file. |
**-movflags faststart** | This re-organises the mp4 file, so that it doesnt have to read the whole file to start playback, useful for streaming. It can add a second or so to do this, since it does require re-writing the file. |

**-vf "scale=in_color_matrix=bt709:out_color_matrix=bt709"** means use the sw-scale filter, setting:

Expand Down
1 change: 1 addition & 0 deletions enctests/HDR_Encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,4 @@ ffmpeg -sws_flags print_info+accurate_rnd+bitexact+full_chroma_int \
Further Reading:
* [H.273 Specification.](https://www.itu.int/rec/T-REC-H.273-202107-I/en)
* https://www.lightillusion.com/what_is_hdr.html
* [HDR Color Bars - BT.2111](https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2111-2-202012-I!!PDF-E.pdf)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
images: true
path: chimera_wind_srgb.%06d.png
width: 1920
height: 1080
pix_fmt: rgb48be
in: 66600
duration: 200
rate: 25.0
12 changes: 6 additions & 6 deletions enctests/sources/enc_sources/download_media.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# This first bit of media is really just for sparks, which hopefully should stress encoders.
if [ ! -d chimera_wind_srgb ]
then
aws s3 cp --no-sign-request s3://download.opencontent.netflix.com/Chimera/tif_DCI4k5994p/ chimera_wind --recursive --exclude "*" --include "*_790*.tif"
aws s3 cp --no-sign-request s3://download.opencontent.netflix.com/Chimera/tif_DCI4k5994p/ chimera_wind --recursive --exclude "*" --include "*_791*.tif"
aws s3 cp --no-sign-request s3://download.opencontent.netflix.com/Chimera/tif_DCI4k5994p/ chimera_wind --recursive --exclude '*' --include '*_0666*.tif'
aws s3 cp --no-sign-request s3://download.opencontent.netflix.com/Chimera/tif_DCI4k5994p/ chimera_wind --recursive --exclude "*" --include "*_0667*.tif"
fi

if [[ ! -d chimera_coaster_srgb && ! -d chimera_coaster ]]
Expand Down Expand Up @@ -47,15 +47,15 @@ if [ ! -d chimera_wind_srgb ]
then
mkdir chimera_wind_srgb
echo Building chimera_wind png
oiiotool -v --framepadding 6 --frames 79000-79199 -i chimera_wind/Chimera_DCI4k5994p_HDR_P3PQ_@@@@@@.tif --resize 1920x1080 --powc 2 -dither -o chimera_wind_srgb/chimera_wind_srgb.#.png
oiiotool -v --framepadding 6 --frames 66600-667199 -i chimera_wind/Chimera_DCI4k5994p_HDR_P3PQ_@@@@@@.tif --resize 1920x1080 --powc 2 -d uint16 -o chimera_wind_srgb/chimera_wind_srgb.#.png
rm -rf chimera_wind
fi

if [ ! -d chimera_coaster_srgb ]
then
mkdir chimera_coaster_srgb
echo Building chimera_coaster_srgb png
oiiotool -v --framepadding 6 --frames 44200-44399 -i chimera_coaster/Chimera_DCI4k5994p_HDR_P3PQ_@@@@@@.tif --resize 1920x1080 --powc 2 -dither -o chimera_coaster_srgb/chimera_coaster_srgb.#.png
oiiotool -v --framepadding 6 --frames 44200-44399 -i chimera_coaster/Chimera_DCI4k5994p_HDR_P3PQ_@@@@@@.tif --resize 1920x1080 --powc 2 -d uint16 -o chimera_coaster_srgb/chimera_coaster_srgb.#.png
#rm -rf chimera_coaster
fi

Expand All @@ -64,7 +64,7 @@ if [ ! -d chimera_cars_srgb ]
then
mkdir chimera_cars_srgb
echo Building chimera_cars png
oiiotool -v --framepadding 5 --frames 2500-2699 -i chimera_cars/Chimera_DCI4k2398p_HDR_P3PQ_@@@@@.tif --resize 1920x1080 --powc 2 -dither -o chimera_cars_srgb/chimera_cars_srgb.#.png
oiiotool -v --framepadding 5 --frames 2500-2699 -i chimera_cars/Chimera_DCI4k2398p_HDR_P3PQ_@@@@@.tif --resize 1920x1080 --powc 2 -d uint16 -o chimera_cars_srgb/chimera_cars_srgb.#.png
#rm -rf chimera_cars
fi

Expand All @@ -73,6 +73,6 @@ if [ ! -d chimera_fountains_srgb ]
then
mkdir chimera_fountains_srgb
echo Building chimera_fountains png
oiiotool -v --framepadding 5 --frames 5400-5599 -i chimera_fountains/Chimera_DCI4k2398p_HDR_P3PQ_@@@@@.tif --resize 1920x1080 --powc 2 -dither -o chimera_fountains_srgb/chimera_fountains_srgb.#.png
oiiotool -v --framepadding 5 --frames 5400-5599 -i chimera_fountains/Chimera_DCI4k2398p_HDR_P3PQ_@@@@@.tif --resize 1920x1080 --powc 2 -d uint16 -o chimera_fountains_srgb/chimera_fountains_srgb.#.png
#rm -rf chimera_fountains
fi
16 changes: 9 additions & 7 deletions enctests/sources/hdr_sources/download_media.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#downloading sparks

export OCIO=ocio://studio-config-v1.0.0_aces-v1.3_ocio-v2.1

# https://opencontent.netflix.com/
# This first bit of media is really just for sparks, which hopefully should stress encoders.
if [ ! -d sparks ]
Expand All @@ -25,39 +27,39 @@ if [ ! -d sparks_srgb ]
then
mkdir sparks_srgb
echo Building sparks png
oiiotool -v --framepadding 5 --frames 6100-6299 sparks/SPARKS_ACES_#.exr --resize 1920x1014 \
--colorconvert linear srgb --dither -o sparks_srgb/sparks_srgb.#.png
oiiotool -v --framepadding 5 --frames 6100-6299 sparks/SPARKS_ACES_#.exr --fit 1920x1080 \
--colorconvert linear srgb -d uint16 -o sparks_srgb/sparks_srgb.#.png

fi

if [ ! -d sparks2_srgb ]
then
mkdir sparks2_srgb
echo Building sparks2_srgb
oiiotool -v --framepadding 5 --frames 6700-6899 sparks2/SPARKS_ACES_#.exr --resize 1920x1014 \
--colorconvert acescg out_srgb --dither -o sparks2_srgb/sparks2_srgb.#.png
oiiotool -v --framepadding 5 --frames 6700-6899 sparks2/SPARKS_ACES_#.exr --fit 1920x1080 \
--iscolorspace "ACEScg" --ociodisplay "sRGB - Display" "ACES 1.0 - SDR Video" -d uint16 -o sparks2_srgb/sparks2_srgb.#.png

fi

if [ ! -d sparks2_hlg ]
then
mkdir sparks2_hlg
echo Building sparks2_hlg
oiiotool -v --framepadding 5 --frames 6700-6899 sparks2/SPARKS_ACES_#.exr --resize 1920x1014 --colorconvert acescg out_rec2020hlg1000nits -d uint16 -o sparks2_hlg/sparks2_hlg.#.png
oiiotool -v --framepadding 5 --frames 6700-6899 sparks2/SPARKS_ACES_#.exr --fit 1920x1080 --colorconvert acescg out_rec2020hlg1000nits -d uint16 -o sparks2_hlg/sparks2_hlg.#.png
fi

if [ ! -d sparks2_pq1000 ]
then
mkdir sparks2_pq1000
echo Building sparks2_pq1000
oiiotool -v --framepadding 5 --frames 6700-6899 sparks2/SPARKS_ACES_#.exr --resize 1920x1014 --colorconvert acescg out_rec2020st20841000nits -d uint16 -o sparks2_pq1000/sparks2_pq1000.#.png
oiiotool -v --framepadding 5 --frames 6700-6899 sparks2/SPARKS_ACES_#.exr --fit 1920x1080 --colorconvert acescg out_rec2020st20841000nits -d uint16 -o sparks2_pq1000/sparks2_pq1000.#.png
fi

if [ ! -d sparks2_pq2000 ]
then
mkdir sparks2_pq2000
echo Building sparks2_pq2000
oiiotool -v --framepadding 5 --frames 6700-6899 sparks2/SPARKS_ACES_#.exr --resize 1920x1014 --colorconvert acescg out_rec2020st20842000nits -d uint16 -o sparks2_pq2000/sparks2_pq2000.#.png
oiiotool -v --framepadding 5 --frames 6700-6899 sparks2/SPARKS_ACES_#.exr --fit 1920x1080 --colorconvert acescg out_rec2020st20842000nits -d uint16 -o sparks2_pq2000/sparks2_pq2000.#.png
fi

# Encoding test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
images: true
path: /Users/sam/git/EncodingGuidelines/enctests/sources/hdr_sources/sparks2_hlg/sparks2_hlg.%05d.png
width: 1920
height: 1014
height: 1080
pix_fmt: rgb48be
in: 6700
duration: 200
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
images: true
path: /Users/sam/git/EncodingGuidelines/enctests/sources/hdr_sources/sparks2_srgb/sparks2_srgb.%05d.png
width: 1920
height: 1014
pix_fmt: rgb24
height: 1080
pix_fmt: rgb48be
in: 6700
duration: 200
rate: 25.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
images: true
path: sparks_srgb.%05d.png
width: 1920
height: 1080
pix_fmt: rgb48be
in: 6100
duration: 200
rate: 25.0
2 changes: 2 additions & 0 deletions enctests/test_configs/codec_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ test_mp4:
- sources/enc_sources/chimera_cars_srgb/chimera_cars_srgb.%05d.png.yml
- sources/enc_sources/chimera_coaster_srgb/chimera_coaster_srgb.%06d.png.yml
- sources/enc_sources/chimera_fountains_srgb/chimera_fountains_srgb.%05d.png.yml
- sources/enc_sources/chimera_wind_srgb/chimera_wind_srgb.%06d.png.yml
- sources/hdr_sources/sparks_srgb/sparks_srgb.%05d.png.yml
wedges:
libx264-10bit: &base_args
Expand Down Expand Up @@ -77,6 +78,7 @@ test_mov:
- sources/enc_sources/chimera_cars_srgb/chimera_cars_srgb.%05d.png.yml
- sources/enc_sources/chimera_coaster_srgb/chimera_coaster_srgb.%06d.png.yml
- sources/enc_sources/chimera_fountains_srgb/chimera_fountains_srgb.%05d.png.yml
- sources/enc_sources/chimera_wind_srgb/chimera_wind_srgb.%06d.png.yml
- sources/hdr_sources/sparks_srgb/sparks_srgb.%05d.png.yml
wedges:
dnxhd: &base_args2
Expand Down
35 changes: 33 additions & 2 deletions enctests/test_configs/color_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ test_uncompressed:
name: test_uncompressed
sources:
- ../sourceimages/chip-chart-1080-16bit-noicc.png.yml
- ../sourceimages/chip-chart-1080-noicc.png.yml
- ../sourceimages/smptehdbars_16.png.yml
- ../sourceimages/smptehdbars_10.dpx.yml
suffix: .y4m
wedges:
10bit_default: &base_args
#-c:v: v410
-loglevel: verbose
-strict: -1
#-sws_flags: spline+accurate_rnd+full_chroma_int+full_chroma_inp
-pix_fmt: yuv444p10le
Expand Down Expand Up @@ -80,6 +80,37 @@ test_uncompressed:
<< : *base_args
-vf: '"scale=in_range=full:in_color_matrix=bt709:out_range=tv:out_color_matrix=bt709"'
-sws_flags: spline+accurate_rnd+full_chroma_int

test_bt709:
app: ffmpeg
comparisontest:
- extracttemplate: ffmpeg -y -i {newfile} -compression_level 10 -pred mixed -pix_fmt rgb48be -frames:v 1 -vf scale=in_color_matrix=bt709:out_color_matrix=bt709 {newpngfile}
testtype: idiff
- testtype: assertresults
tests:
- assert: less
value: max_error
less: 0.00195
description: Uncompressed tests.
encoding_template: ffmpeg -y -color_range pc -color_trc iec61966-2-1 -color_primaries bt709 -colorspace bt709 {input_args} -i "{source}" {encoding_args}
-y "{outfile}"
name: test_bt709
sources:
- ../sourceimages/chip-chart-1080-16bit-noicc.png.yml
- ../sourceimages/smptehdbars_10.dpx.yml
suffix: .y4m
wedges:
10bit_bt709: &base_args2
#-c:v: v410
-strict: -1
-loglevel: verbose
#-sws_flags: spline+accurate_rnd+full_chroma_int+full_chroma_inp
-pix_fmt: yuv444p10le
-color_primaries: bt709
-color_range: tv
-color_trc: bt709
-colorspace: bt709

---
reports:
description: This is testing the different options for doing RGB to YCrCb and then back to RGB using y4m as an intermediate container of raw YCrCb data. The pass rate for max-error is 0.00195 = 2/1024 = 1/512. So it has to be 1-bit better than 8-bit values.
Expand Down

0 comments on commit 5630a42

Please sign in to comment.