Dolby Vision
NOTE: This is a new Dolby Vision workflow
In Hybrik version 1.223, we introduced new, greatly simplified, Dolby Vision workflow. If you need the documentation for the legacy version of this tutorial, please visit the legacy link.Dolby Vision is a version of High Dynamic Range (HDR) video by Dolby Laboratories. HDR video takes advantage of today’s modern displays with the ability to show more dynamic luminance and color range than previous standards.
Here is a visual representation of how much more color information can be displayed in HDR video (Rec 2020) compared to traditional High Definition (Rec 709) video.
High Dynamic Range video also targets a much higher luminance; while a typical HD display is capable of displaying 100-400 nits of peak brightness, many HDR displays can display upwards of 1500 nits. The standard is capable of supporting displays up to 10,000 nits in the future.
Apple made a nice primer video on the differences between HD and HDR video, as well as the differences between HDR10 and Dolby Vision. Watch Apple’s Tech Talk
HDR10 vs Dolby Vision
HDR10 defines static metadata for the entire length of the video, with information such as maximum and average luminance values as well as original mastering display information. This allows the playback display to map the video’s levels to it’s own capabilities. For HDR10, this metadata is static and doesn’t change over the course of the video.
For Dolby Vision, this data is dynamic and can be specified per shot, per scene, or per frame. It also encompasses even more information than the HDR10 metadata. While an HDR10 video source typically has its metadata encoded into the video, a Dolby Vision Mezzanine file can have the dynamic metadata either embedded in the video container or as a sidecar file.
Dolby Vision brings brighter images, greater contrast, better highlights and more color. It also brings more consistency across displays as it considers not just the content itself but also the capabilities of the display the image is being rendered on.
More details on Dolby Vision:
Dolby Vision Encoding Targets Profiles and Levels
There are several HEVC variants of Dolby Vision depending on the needed application. Read in depth about this in the Dolby Vision Profiles and Levels Specification.
Some examples are:
- Profile 5 (not-cross compatible to HDR10 or SDR)
- Profile 8.1 (cross-compatible to HDR10)
- Profile 8.2 (cross-compatible to SDR)
At this time, Hybrik only supports Profile 5 and 8.1
Dolby Vision Sources for Hybrik
While Dolby has recommendations and best practices for Dolby Vision mastering, by the time you get to Hybrik you will need a mezzanine source. The following forms are supported in Hybrik.
You will need the following to encode Dolby Vision in Hybrik:
- Dolby Vision Mezzanine File
- JPEG 2000 or Apple ProRes video codec
- Rec2020 or DCI-P3 color space in PQ (Perceptual Quantization)
- Dolby Vision Metadata
- Metadata can be a sidecar file or interleaved in the mezzanine file (see input formats below)
Input formats
Depending on the format, Dolby Vision metadata can either be interleaved into the source file or be separate as a sidecar file. Hybrik supports the following source combinatinos:
- MXF with interleaved metadata
- MXF with sidecar metadata XML
- ProRes with sidecar metadata XML
Hybrik can also accept MXF formats when packaged as an IMF. Read our Sources tutorial to learn more about specifying a CPL (Composition Playlist) source.
NOTE: We do not support a “complex” CPL, that is a CPL with multiple segments. Your CPL may have an entrypoint
> 0 (and Hybrik will respect the offset) but you may not use a CPL that has more than one segment. Alternatively, you may also trim a CPL source with Hybrik trim json but you may not do both.
Netflix has a bunch of open source content available. We recommend using Sol Levante for testing.
Audio Encoding
At this time, you cannot transcode muxed audio and video at the same time with the Dolby Vision workflow. You can create discrete video and audio targets as you would use for Adaptive Bitrate streaming (ABR) for HLS or DASH. If you require muxed audio and video in the same container, you must run a codec-copy in a follow-on transcode task. We plan to allow muxed audio in a future release.
Dolby Vision in the Transcode Task
Transcoding Dolby Vision content is encoded in a standard Hybrik transcode
task. This allows you the option to define multiple Dolby Vision targets
within the same transcode
task.
Transcoding
For efficiency in encoding, we utilize a segmented_rendering
script task ahead of our transcode task to divide the the media into temporal segments that are encoded in parallel across multiple machines and combined at the last step. If you’re not familiar with this feature, see our Segmented Rendering tutorial.
{
"uid": "segment_script_task",
"kind": "script",
"task": {
"retry_method": "fail"
},
"payload": {
"kind": "job_modifier",
"payload": {
"modifiers": [
{
"kind": "transcode_segmented_rendering",
"target_element_uid": "transcode_task",
"duration_sec": "{{segmented_rendering_secs}}"
}
]
}
}
}
Targets
If you are familiar with Hybrik transcode
tasks then you are already familiar with the structure needed for Dolby Vision targets. With just a few additional parameters within targets
, you will enable a Dolby Vision output from a Dolby Vision source.
"targets": [
{
"file_pattern": "{{output_name}}_dv_p5_1080p.mp4",
"$inherits": "{{target_base}}",
"video": {
"$inherits": "{{video_base}}",
"vtag": "dvh1",
"dolby_vision": {
"profile": "5"
},
"width": 1920,
"height": 1080,
"bitrate_kb": 9000
}
}
The important parameter to note is the dolby_vision
object.
The dolby_vision
Object
The dolby_vision
object is where you set which target Dolby Vision profile
you want to use. The accepted values are
"5"
"8.1"
"hdr10"
"sdr"
"20"
- Note these values are all of type String as indicated by the quotes.
compatible_peak_brightness
for Content Mapping
You can also define the compatible_peak_brightness
within target profiles with an HEVC base layer, such as hdr10
or Dolby Vision Profile 8.1
. This will map the brightness to a specific value.
hdr10
can be mapped to either1000
nits or600
nits8.1
can only be mapped to1000
nits
"dolby_vision": {
"profile": "8.1",
"compatible_peak_brightness": 1000
},
Note: Choosing profile "sdr"
will automatically map to 100 nits. Omit this value for no mapping.
The vtag
parameter
vtag
is how you specify to the muxer how to store the parameters for the stream. These are equavalent to hvc1
and hev1
for non-Dolby Vision hevc targets. The dvh1
vtag tag muxes the metadata into the sample descriptor boxes in an mp4. Conversely, the dvhe
vtag keeps this metadata in-band within the hevc stream.
Which one you need will depend on your playback scenario, dvh1
is recommended by Apple for HLS and is required for playback on apple devices.
By default, this codec tag is set to dvhe
. The accepted values are
dvh1
(for Dolby Vision, Apple / HLS compatible)dvhe
(for Dolby Vision)hvc1
(for non-Dolby Vision HEVC)hev1
(for non-Dolby Vision HEVC)
Inheritance
You may have noticed that we don’t define all of our video parameters in the video target, instead we “inherit” something called {{video_base}}
. video_base
is an object that we have defined in the definitions
at the top of our job so that we don’t need to specify the same parameters again and again and again. While not specific to Dolby Vision, this makes a job much more easy to modify. Here is what the definiton that we created for {{video_base}}
from the definitions of our file. Read more on inheritance and how it works in Hybrik via our Definitions and Placeholders Tutorial. See our examples for complete usage.
"definitions": {
"video_base": {
"codec": "h265",
"hrd_signaling": "encoder",
"bitrate_mode": "vbr",
"chroma_format": "yuv420p10le",
"idr_interval": {
"seconds": 2
}
},
...
}
Once you submit your job, Hybrik will run through all of the steps to create the Dolby Vision encode including preprocessing. You will notice that the job will automatically create multiple tasks for each dolby_vision
target and segment defined in your job. If any of the tasks fail, the job will ultimately fail too.
Notes on our Dolby Vision Workflow
- The target profiles Dolby Vision workflow always run in 2-pass mode, this cannot be changed.
- Each transcode target (or layer) will always process on its own machine instance.
- If
segmented_rendering
is used (recommended), each segment will consume a transcode slot. Combiningsegmented_rendering
and multiple layers will require quite a few machines pretty quickly. - We recommend trimming your source and encoding a single target to begin testing and get your job working piece by piece.
Stitching and Trimming Dolby Vision
We support editing features such as stitching and trimming in Dolby Vision jobs. To read more on how to stitch and trim in Hybrik, look at our Stitching Tutorial and Trimming Tutorial.
If a Dolby Vision metadata file is used in the source, it does not need to be trimmed; only the video element should be trimmed.
Currently, Hybrik only supports stitching Dolby Vision assets of the same type; for example, ProRes with sidecar XML sources may only be stitched with other ProRes + sidecar sources. Sources must also have matching frame rates. See our example job below for complete usage.
We also support stitching SDR and Dolby Vision sources together into Dolby Vision mp4 outputs using the convert_to_dolby_vision
feature. Learn more in our SDR to HDR Conversion Tutorial
Note: Stitching is NOT supported for Profile 20 at this time.
Dolby Vision Metadata Operations
The Dolby Vision Professional Tools are a set of command line tools from Dolby that can perform several metadata operations with a Dolby Vision Mezzanine. For full details with the Dolby Vision Professional tools, please refer to the User Manual.
Hybrik can use these professional tools for validating Dolby Vision Metadata (either as a sidecar XML file or an interleaved MXF file).
Note: You will need a license to use these tools in Hybrik, please contact your Hybrik representative to get a license.
Validating Metadata
In our sample job for validation, we load the XML or MXF file and run a metafier operation to validate the metadata. If the metadata has errors, the task will fail. For details about the validation, see the task result summary where the output from metafier is displayed.
Extracting Metadata
Extracting Dolby Vision Metadata is a common operation. Metadata can be provided as a sidecar file with a Dolby Vision Mezzanine for transcoding, or sometimes you may just want to inspect the metadata. In our example job which extracts metadata from an interleaved Dolby Vision Mezzanine, we extract the metadata to an XML file as a result of the job. In order to extract the metadata even if there is a problem, we use the option ignore_exit_code
so that even if there is a metadata problem, Hybrik will extract the XML. You can look at the task result summary to see the details of the extraction or validate the metadata with our validation example job.
Examples
Dolby Vision Profile 5
- Interleaved MXF to Dolby Vision Profile 5
- Sidecar Metadata to Profile 5
- IMF CPL to Profile 5
- Interleaved MXF to Dolby Vision Profile 5 ABR Video and Audio in HLS and DASH
- Sidecar Metadata Profile 5 ABR Video + Audio in HLS and DASH Sample Job
Dolby Vision Profile 8.1
HDR10
SDR
Putting it all Together Into a Single Job
Stitching Dolby Vision
Dolby Vision Source Configuration Example Snippets
As there are many ways to specify a Dolby Vision source, we have compiled a comprehensive set of example source configurations here for easy copy/pasteability
- Video with Interleaved metadata
{ "uid": "source", "kind": "source", "payload": { "kind": "asset_url", "payload": { "storage_provider": "s3", "url": "{{source_mxf}}" } } },
- Video with Interleaved metadata + trim
{ "uid": "source", "kind": "source", "payload": { "kind": "asset_url", "payload": { "storage_provider": "s3", "url": "{{source_mxf}}", "trim": { "inpoint_sec": 5, "duration_sec": 120 } } } },
- Video MXF + Sidecar
{ "uid": "source", "kind": "source", "payload": { "kind": "asset_complex", "payload": { "kind": "sequence", "asset_versions": [ { "location": { "storage_provider": "s3", "path": "{{source_path}}" }, "version_uid": "source", "asset_components": [ { "component_uid": "video", "kind": "name", "name": "{{source_video_name}}", "contents": [ { "kind": "video" } ] }, { "component_uid": "metadata", "kind": "name", "name": "{{source_metadata_name}}", "contents": [ { "kind": "metadata", "payload": { "standard": "dolbyvision_metadata" } } ] } ] } ] } } },
- Video MXF + Audio MXF
{ "uid": "source", "kind": "source", "payload": { "kind": "asset_complex", "payload": { "kind": "sequence", "asset_versions": [ { "location": { "storage_provider": "s3", "path": "{{source_path}}" }, "version_uid": "source", "asset_components": [ { "component_uid": "video", "kind": "name", "name": "{{source_video}}", "contents": [ { "kind": "video" } ] }, { "component_uid": "audio", "kind": "name", "name": "{{source_audio}}", "location": { "storage_provider": "s3", "path": "{{source_audio_path}}" }, "contents": [ { "kind": "audio" } ] } ] } ] } } },
- Video MXF + Audio MXF + Sidecar XML metadata
{ "uid": "source", "kind": "source", "payload": { "kind": "asset_complex", "payload": { "kind": "sequence", "asset_versions": [ { "location": { "storage_provider": "s3", "path": "{{source_path}}" }, "version_uid": "source", "asset_components": [ { "component_uid": "video", "kind": "name", "name": "{{source_video}}", "contents": [ { "kind": "video" } ] }, { "component_uid": "metadata", "kind": "name", "name": "{{source_metadata}}", "contents": [ { "kind": "metadata", "payload": { "standard": "dolbyvision_metadata" } } ] }, { "component_uid": "audio", "kind": "name", "name": "{{source_audio}}", "location": { "storage_provider": "s3", "path": "{{source_audio_path}}" }, "contents": [ { "kind": "audio" } ] } ] } ] } } },
- CPL with
resolve_manifest
{ "uid": "source", "kind": "source", "payload": { "kind": "asset_url", "payload": { "storage_provider": "s3", "url": "{{source_path}}/{{source_cpl}}", "options": { "resolve_manifest": true } } } },