Generated Black and Silence
This tutorial will explain using Hybrik to create generated
black and silence. Generating black video and silence is useful for whenever a slug is needed in your video. Black video is often used at the head and tail of a file or inserted as commercial breaks and accompanied by silent audio.
Generated black or silence will be part of the source element as a component of an asset_complex
. Best practice is to set the black video parameters to the same parameters as the main content of the source.
Below are some examples for generating synthetic black video in a JSON job.
Adding Black and Silence
This is a complex source where the generated black video is the first component of an asset_complex
with the addition of an audio object that creates one channel of silent audio.
If you are using multi-channel audio, you still will want to use a single channel of generated silence. Hybrik will auto-map the one channel of silence to match your output channel configuration. You may also remove the audio
object to add black video only.
NOTE: You must apply a trim
to the black/silence to tell Hybrik how long to create the black/silence for.
{
"uid": "my_black_source_with_silence",
"kind": "source",
"payload": {
"kind": "asset_complex",
"payload": {
"kind": "sequence",
"asset_versions": [
{
"version_uid": "black_silence",
"asset_components": [
{
"kind": "generated",
"component_uid": "main",
"component_descriptor": {
"container": {
"kind": "raw"
},
"video": {
"width": 1920,
"height": 1080,
"frame_rate": 23.98,
"chroma_format": "yuv420",
"fill_color": "black"
},
"audio": [
{
"sample_rate": 48000,
"channels": 1,
"sample_size": 24
}
]
},
"trim": {
"outpoint_sec": 1
}
}
]
}
]
}
}
}
Adding One Second of Black at Head and Tail
If you want to add one second of black and silence to the head and tail of your video, you can build an asset_complex
to reflect the following sequence structure:
leading_black
main
trailing_black
Note:The parameters in the elements for leading_black
and trailing_black
are identical.
{
"uid": "my_sequence",
"kind": "source",
"payload": {
"kind": "asset_complex",
"payload": {
"kind": "sequence",
"asset_versions": [
{
"version_uid": "leading_black",
"asset_components": [
{
"kind": "generated",
"component_uid": "main",
"component_descriptor": {
"container": {
"kind": "raw"
},
"video": {
"width": 1920,
"height": 1080,
"frame_rate": 23.98,
"dar": "16:9",
"chroma_format": "yuv420p",
"fill_color": "black"
},
"audio": [
{
"sample_rate": 48000,
"channels": 1,
"sample_size": 24
}
]
},
"trim": {
"outpoint_sec": 1
}
}
]
},
{
"version_uid": "main",
"asset_components": [
{
"component_uid": "main",
"kind": "name",
"location": {
"path": "{{source_path}}",
"storage_provider": "s3"
},
"name": "{{source_file}}"
}
]
},
{
"version_uid": "trailing_black",
"asset_components": [
{
"kind": "generated",
"component_uid": "main",
"component_descriptor": {
"container": {
"kind": "raw"
},
"video": {
"width": 1920,
"height": 1080,
"frame_rate": 23.98,
"dar": "16:9",
"chroma_format": "yuv420p",
"fill_color": "black"
},
"audio": [
{
"sample_rate": 48000,
"channels": 1,
"sample_size": 24
}
]
},
"trim": {
"outpoint_sec": 1
}
}
]
}
]
}
}
}
Here is a visual representation of what the source looks like and what it looks like when an asset_complex
with black audio and video are passed into the Source Pipeline:
Required Fields
When using generated
black video in your Hybrik JSON, you should include the following fields or else you may get unexpected results:
width
height
frame_rate
chroma_format
fill_color
If there is a difference between the generated black/silence and your targets, Hybrik will duplicate/drop frames to match the frame_rate
and will scale the height
/width
to match the target as well. Both of these are fine in the case of black video as there is no visual difference.
If your target video does not have its frame_rate
defined in the settings, it will inherit the frame rate of the first video asset in the source sequence. If the first video asset is generated
black and no frame_rate
is defined for it, 25fps will be assigned by default and can lead to quirky behavior.
Example Job
Note: Stitching or adding head/tail is not supported for Dolby Vision