Content Templates

The role of content templates in ew-vod2cbm

Contents templates are used in ew-vod2cbm to specify the output segmentation and tracks of a channel, but also serve as measures to check if asset entries in a schedule are compatible with the channel. They are further used to generate the manifest and playlist media data properties as well as the media init segments. Therefore, bitrate, resolution, frame rate, video parameter sets, number audio channels are included in the template. The assets do not need to have exactly the same parameter values, but are allowed to vary as described later.

JSON Schema for Content Template

The JSON schema of the content template contains core parameters of the content_info.json schema, and some additional parametersfor bitrate matching.

It can contain variants of video, audio, and subtitles as signaled in the media_type field. The variant array can contain multiple variants of each type. The table below the schema shows the required parameters for each media type.

{
    "type": "object",
    "properties": {
        "version": {
            "type": "string"
        },
        "constant_gop_duration_ms": {
            "type": "integer"
        },
        "variants": {
            "type": "array",
            "items": [
                {
                    "type": "object",
                    "properties": {
                        "media_type": {
                            "type": "string"
                        },
                        "subtype": {
                            "type": "string"
                        },
                        "name": {
                            "type": "string"
                        },
                        "bitrate": {
                            "type": "integer"
                        },
                        "width": {
                            "type": "integer"
                        },
                        "height": {
                            "type": "integer"
                        },
                        "sample_aspect_ratio": {
                            "type": "string"
                        },
                        "picture_aspect_ratio": {
                            "type": "string"
                        },
                        "scan_type": {
                            "type": "string"
                        },
                        "sps": {
                            "type": "string"
                        },
                        "pps": {
                            "type": "string"
                        },
                        "codec": {
                            "type": "string"
                        },
                        "frame_rate_fraction": {
                            "type": "array",
                            "items": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "integer"
                                }
                            ]
                        },
                        "num_channels": {
                            "type": "integer"
                        },
                        "samplerate": {
                            "type": "integer"
                        },
                        "decoder_config": {
                            "type": "string"
                        },
                        "lang": {
                            "type": "string"
                        },
                        "max_bitrate": {
                            "type": "integer"
                        },
                        "min_bitrate": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "media_type",
                        "name",
                        "bitrate",
                        "codec"
                    ]
                }
            ]
        }
    }
}

Depending on the media type, there are required fields for a variant. The table below lists all the required fields depending on media type.

Media type Required fields
Video media_type
subtype
name
bitrate
width
height
sample_aspect_ratio
picture_aspect_ratio
scan_type
sps
pps
codec
frame_rate_fraction
Audio media_type
subtype
name
bitrate
codec
num_channels
samplerate
decoder_config
lang
Subtitles media_type
name
bitrate
lang
codec

The fields max_bitrate and min_bitrate are optional for all media types.

Example content template

{
    "version": "1.0",
    "constant_gop_duration_ms": 1920,
    "variants": [
        {
            "media_type": "video",
            "subtype": "h264",
            "name": "V1000",
            "bitrate": 1000000,
            "width": 640,
            "height": 360,
            "sample_aspect_ratio": "1:1",
            "picture_aspect_ratio": "16:9",
            "scan_type": "progressive",
            "sps": "6764001eacb201405ff2a0",
            "pps": "68ebccb22c",
            "codec": "avc1.64001E",
            "frame_rate_fraction": [
                25,
                1
            ],
            "max_bitrate": 1500000,
            "min_bitrate": 900000
        },
        {
            "media_type": "video",
            "subtype": "h264",
            "name": "V1500",
            "bitrate": 1500000,
            "width": 768,
            "height": 432,
            "sample_aspect_ratio": "1:1",
            "picture_aspect_ratio": "16:9",
            "scan_type": "progressive",
            "sps": "6764001eacb201806f20",
            "pps": "68ebccb22c",
            "codec": "avc1.64001E",
            "frame_rate_fraction": [
                25,
                1
            ],
            "max_bitrate": 1600000,
            "min_bitrate": 1400000
        },
        {
            "media_type": "audio",
            "subtype": "aac",
            "name": "A128",
            "bitrate": 128000,
            "codec": "mp4a.40.2",
            "num_channels": 2,
            "samplerate": 48000,
            "decoder_config": "1190",
            "lang": "eng"
        },
        {
            "media_type": "subtitles",
            "name": "eng_1",
            "bitrate": 1000,
            "lang": "eng",
            "codec": "wvtt"
        }
    ]
}