CableLabs®

These examples show how to produce MPEG Transport Stream media through our exclusive Manzanita-based muxer that conforms to the CableLabs standard and passes the toughest QC checks of professional solutions like Baton.

<?xml version="1.0"?>
<query>
    <userid>[UserID]</userid> <!-- required-->
    <userkey>[UserKey]</userkey> <!-- required-->
    <action>AddMedia</action>
    <source>[SourceFile]</source> <!-- required-->
    <format> <!-- required -->
        <output>cablelabs_mpegts</output> <!-- required-->
        <framerate>[FrameRate]</framerate>
        <video_codec>[VideoCodec]</video_codec>
        <audio_codec>[AudioCodec]</audio_codec>
        <audio_bitrate>[AudioBitrate]</audio_bitrate>
        <!-- multiple closed_captions may be included -->
        <closed_captions>
            <mux_type>[MuxType]</mux_type>
            <!-- closed captions parameters -->
        </closed_captions>
        <closed_captions>
            <!-- closed captions parameters -->
        </closed_captions>
        <muxer>[v1|v2]</muxer>
        <!-- format params -->
    </format>
</query>
{
    "query": {
        "userid": "[UserID]", // required
        "userkey": "[UserID]", // required
        "action": "AddMedia",
        "source": "[SourceFile]", // required
        "format": { // required
            "output": "cablelabs_mpegts", // required
            "framerate": "[FrameRate]",
            "video_codec": "[VideoCodec]",
            "audio_codec": "[AudioCodec]",
            "audio_bitrate": "[AudioBitrate]",
            // multiple closed_captions may be included
            "closed_captions": [
                {
                    "mux_type": "[MuxType]"
                   // closed captions parameters
                }
            ],
            "muxer": "[v1|v2]"
            // format params
        }
    }
}

Request With Default Values

❗️

Warning

Changing the default parameters listed below will risk violation of conformance with the CableLabs standard.

There are many interpretations of the CableLabs standard and compliance depending on which device is performing playout or other operations on a transport stream. We invite you to reach out for specific integrations or with any questions on what parameters might need to be modified for your specific use cases.

<?xml version="1.0"?>
<query>
    <userid>[UserID]</userid> <!-- required-->
    <userkey>[UserKey]</userkey> <!-- required-->
    <action>AddMedia</action>
    <source>[SourceFile]</source> <!-- required-->
    <format> <!-- required -->
        <output>cablelabs_mpegts</output>
        <framerate>[FrameRate]</framerate>
        <video_codec>[VideoCodec]</video_codec>
        <audio_codec>[AudioCodec]</audio_codec>
        <audio_bitrate>[AudioBitrate]</audio_bitrate>
        <audio_channels_number>[ChannelsNumber]</audio_channels_number>
        <audio_sample_rate>[SampleRate]</audio_sample_rate>
        <layout>[Layout]</layout>
        <patvsn>[PATVersion]</patvsn>
        <profile>[Profile]</profile>
        <keyframe>[GOPSize]</keyframe>
        <psipat_rep>[PATRepetitionRate]</psipat_rep>
        <psipmt_rep>[PMTRepetitionRate]</psipmt_rep>
        <veryfast>[yes|no]</veryfast>
        <noemptyaf>[yes|no]</noemptyaf>
        <pktsize>[PacketSize]</pktsize>
        <forceduration>[yes|no]</forceduration>
        <color_primaries>[ColorPrimaries]</color_primaries>
        <transfer_characteristics>[TransferCharacteristics]</transfer_characteristics>
        <matrix_coefficients>[MatrixCoefficients]</matrix_coefficients>
        <!-- common format parameters -->
        <video_codec_parameters>
            <!-- common video codec parameters -->
            <b_strategy>[BFStrategy]</b_strategy>
            <sc_threshold>[SceneCutNumber]</sc_threshold>
            <bf>[BFNumber]</bf>
            <keyint_min>[MinGOPSize]</keyint_min>
            <level>[Level]</level>
            <b-pyramid>[0,1]</b-pyramid>
            <open-gop>[0,1]</open-gop>
            <refs>[RefsCount]</refs>
            <flags2>[Flags]</flags2>
            <!-- mpeg2video codec options -->
            <seq_disp_ext>[SequenceDisplayExtension]</seq_disp_ext>
            <video_format>[VideoFormat]</video_format>
            <force-open-gop>[0,1]</force-open-gop>
            <force-seq-header>[0,1]</force-seq-header>
            <force-seq-extension>[0,1]</force-seq-extension>
            <mpv_flags>[MPVFlags]</mpv_flags>
        </video_codec_parameters>
        <program>
            <pmt_pid>[PID]</pmt_pid>
            <pcr_per>[PCRPeriod]</pcr_per>
            <pcr_pes>[yes|no]</pcr_pes>
            <programnumber>[ProgramNumber]</programnumber>
        </program>
        <video_stream>
            <pid>[PID]</pid>
            <auinfo>[yes|no]</auinfo>
            <quadbyte>[yes|no]</quadbyte>
            <insertsec>[yes|no]</insertsec>
            <notlowdelay>[yes|no]</notlowdelay>
            <rai>[yes|no]</rai>
            <pes_align>[yes|no]</pes_align>
        </video_stream>
        <!-- multiple audio_stream may be included -->
        <audio_stream>
            <pid>[PID]</pid>
            <atscbuf>[yes|no]</atscbuf>
            <rai>[yes|no]</rai>
            <pes_align>[yes|no]</pes_align>
            <!-- audio stream parameters -->
        </audio_stream>
        <audio_stream>
            <!-- audio stream parameters -->
        </audio_stream>
        <!-- multiple closed_captions may be included -->
        <closed_captions>
            <mux_type>[MuxType]</mux_type>
            <!-- closed captions parameters -->
        </closed_captions>
        <closed_captions>
            <!-- closed captions parameters -->
        </closed_captions>
        <muxer>[v1|v2]</muxer>
    </format>
</query>
{
    "query": {
        "userid": "[UserID]", // required
        "userkey": "[UserID]", // required
        "action": "AddMedia",
        "source": "[SourceFile]", // required
        "format": { // required
            "output": "cablelabs_mpegts",
            "framerate": "[FrameRate]",
            "video_codec": "[VideoCodec]",
            "audio_codec": "[AudioCodec]",
            "audio_bitrate": "[AudioBitrate]",
            "audio_channels_number": "[ChannelsNumber]",
            "audio_sample_rate": "[SampleRate]",
            "layout": "[Layout]",
            "patvsn": "[PATVersion]",
            "profile": "[Profile]",
            "keyframe": "[GOPSize]",
            "psipat_rep": "[PATRepetitionRate]",
            "psipmt_rep": "[PMTRepetitionRate]",
            "veryfast": "[yes|no]",
            "noemptyaf": "[yes|no]",
            "pktsize": "[PacketSize]",
            "forceduration": "[yes|no]",
            "color_primaries": "[ColorPrimaries]",
            "transfer_characteristics": "[TransferCharacteristics]",
            "matrix_coefficients": "[MatrixCoefficients]",
            // common format parameters
            "video_codec_parameters": {
                // common video codec parameters
                "b_strategy": "[BFStrategy]",
                "sc_threshold": "[SceneCutNumber]",
                "bf": "[BFNumber]",
                "keyint_min": "[MinGOPSize]",
                "level": "[Level]",
                "b-pyramid": "[0,1]",
                "open-gop": "[0,1]",
                "refs": "[RefsCount]",
                "flags2": "[Flags]",
                // mpeg2video codec options
                "seq_disp_ext": "[SequenceDisplayExtension]",
                "video_format": "[VideoFormat]",
                "force-open-gop": "[0,1]",
                "force-seq-header": "[0,1]",
                "force-seq-extension": "[0,1]",
                "mpv_flags": "[MPVFlags]"
            },
            "program": {
                "pmt_pid": "[PID]",
                "pcr_per": "[PCRPeriod]",
                "pcr_pes": "[yes|no]",
                "programnumber": "[ProgramNumber]"
            },
            "video_stream": {
                "pid": "[PID]",
                "auinfo": "[yes|no]",
                "quadbyte": "[yes|no]",
                "insertsec": "[yes|no]",
                "notlowdelay": "[yes|no]",
                "rai": "[yes|no]",
                "pes_align": "[yes|no]"
            },
            "audio_stream": [
                {
                    "pid": "[PID]",
                    "atscbuf": "[yes|no]",
                    "rai": "[yes|no]",
                    "pes_align": "[yes|no]"
                }
            ],
            "closed_captions": [
                {
                    "mux_type": "[MuxType]"
                }
            ],
            "muxer": "[v1|v2]"
        }
    }
}

Format Parameters

ParameterDescriptionAllowed ValuesDefault Value
framerateSpecifies the frame rate.23.976, 24, 25, 29.97, 30, 59.94none
video_codecDefines the codec used for your output.libx264, mpeg2video, copylibx264
audio_codecSpecify the audio codecac3, s302m, mp2ac3
audio_bitrateSpecify the audio bitrate.Nk – where N is any non-zero integer.192k
audio_channels_numberSpecify the number of audio channels.ac3 codec: non-zero integer
s302m codec: even integer
none
audio_sample_rateSpecify the audio sampling frequency (Hz).ac3 codec: non-zero integer
s302m codec: 48000
48000
layoutSpecify the output channels layout.ac3 codec: mono, stereo, 2.1, 3.0, 3.0-back, 4.0, quad, quad-side, 3.1, 5.0, 5.0-side, 4.1, 5.1, 5.1-side, 6.0, 6.0-front, hexagonal, 6.1, 6.1, 6.1-front, 7.0, 7.0-front, 7.1, 7.1-wide, 7.1-wide-side, octagonal, downmix
s302m codec: stereo
none
patvsnPAT version numberInteger number between 0 and 310
profileThis defines various sets of capabilities which are referred to as profiles, that target specific classes of applications.high, main, baselinehigh
keyframeDefines the keyframe interval, in number of frames.Positive integer23.976 fps, 24 fps: 12
29.97 fps, 30 fps: 15
59.94 fps: 30
psipat_repPAT repetition rate per secondFloat number between 0.001 and 10008
psipmt_repPMT repetition rate per secondFloat number between 0.001 and 10008
veryfastApply veryfast encoding profileyes, nono
noemptyafPrevent empty Adaptation Fieldsyes, noyes
pktsizeOutput packet sizeInteger number between 188 and 512188
forcedurationForce the output stream to be of minimum durationyes, nono
color_primariesColor primaries 2 – auto
1 – ITU-R BT.709
5 – ITU-R BT.601 625-line
6 – ITU-R BT.601 525-line
9 – ITU-R BT.2020
copy
2
transfer_characteristicsTransfer Characteristics 2 – auto
1 – ITU-R BT.709 / BT.601 / BT.2020
16 – SMPTE ST 2084 (PQ)
18 – BT.2100 Hybrid Log Gamma
* copy
2
matrix_coefficientsMatrix coefficients 2 – auto
1 – ITU-R BT.709
6 – ITU-R BT.601
9 – ITU-R BT.2020
* copy
2
muxerMuxer versionv1 – Default old muxer
v2 – Advanced muxer
none

Video Codec Options

ParameterDescriptionAllowed ValuesDefault Value
b_strategyB-Frames Strategy0, 1, 20
sc_thresholdScene Cut ThresholdNon-negative integer number0
bfB-Frame numberPositive integer number2
keyint_minMinimum GOP SizePositive integer number1
levelVideo LevelPositive integer number41
b-pyramidApply B-pyramid method0, 10
open-gopProduce Open GOP0, 1libx264: 1
mpeg2video: 0
refsReference numberPositive integer number9
flags2FlagsValid flags stringlibx264: -bpyramid+wpred+mixed_refs+dct8x8-fastpskip
mpeg2video: +local_header
seq_disp_extWrite sequence display extension blocks -1 – auto
0 – never
* 1 – always
1
video_formatVideo Format 5 – unspecified
0 – component
1 – pal
2 – ntsc
3 – secam
4 – mac
0
force-open-gopDon't add closed GOP flag0, 10
force-seq-headerAdd Sequence Header to each frame0, 11
force-seq-extensionAdd Sequence Extension to each frame0, 11
mpv_flagsFlagsValid flags string+strict_gop
mpeg2video options---

Program Parameters

ParameterDescriptionAllowed ValuesDefault Value
pmt_pidProgram PIDHex number between 0x10 - and 0x1ffe0x01e0
pcr_perTime between PCRsPositive integer number between 1 and 6553540
pcr_pesInsert PCRs on all PES packetsyes, noyes
programnumberProgram_number field in PMTDecimal number between 1 - and 65535none

Video Stream Parameters

ParameterDescriptionAllowed ValuesDefault Value
pidStream PIDHex number between 0x10 - and 0x1ffe0x01e1
raiRAI on appropriate access unitsyes, noyes
pes_alignAlign access units to PES packetsyes, noyes
auinfoInsert access unit information data into the adaptation fieldyes, noyes
quadbyteQuad Byteyes, noyes
insertsecVideo Ends with Sequence End Codeyes, noyes
notlowdelayStream should be multiplexed allowing for B-frame reorderingyes, noyes

Audio Stream Parameters

ParameterDescriptionAllowed ValuesDefault Value
pidStream PIDHex number between 0x10 - and 0x1ffe0x01e2
Each next audio stream will have by default PID: 0x01e2 + n
raiRAI on appropriate access unitsyes, nonone
atscbufUse ATSC buffer model for AC-3yes, noyes
pes_alignAlign access units to PES packetsyes, nonone

Closed Captions Parameters

ParameterDescriptionAllowed ValuesDefault Value
mux_typeClosed Captions Mux Typecea-608, cea-708none