For more guides on flow API usage, read Starting with flows.
Flow transform
Create a flow transform that performs an encode from SDI baseband to h.264:
PUT <<APIURL>>/api/projects/<<PROJECTNAME>>/v1/flow/temmplating/configs/encodingLive/livechannel/h264-encode
{
"metadata": {
"displayName": "H264 Live Channel",
"description": "Example H.264 Live Channel config",
"tags": [
"latest"
]
},
"spec": {
"config": {
"version": "20.13.0",
"advancedSettings": {
"crossconversion.doNothing": "true",
"mpeg2TsDemuxer.smoothTimestamp": "true",
"mpeg2ts.NullPacketStuffing": "false",
"perChannelLicensing": "false",
"preview.height": "90",
"preview.width": "160",
"qsv.RawInput.EnableOpenCL": "false",
"vega.forcedBframes": "0"
},
"inputs": [
{
"id": "input_1",
"startWithoutSource": {
"defaultFrameRate": "59.94"
},
"useUHD": false,
"streams": [
{
"id": "Video_01",
"preprocessing": {
"deblockingFilter": false,
"spatialDenoisingFilter": "off"
},
"sources": [
{}
],
"type": "video"
},
{
"type": "audio",
"sources": [
{
"type": "audio",
"group": 1,
"pair": 1
}
],
"preprocessing": {
"signalLossFrames": "silence"
},
"decodingCapability": {
"codec": "ac3",
"mode": "5.1"
},
"audioDescriptionService": false,
"audioFormat": "auto",
"id": "Audio_1"
}
]
}
],
"outputs": [
{
"gopSignaling": "idr",
"id": "output_1",
"mpeg2ts": {
"alignVideoFramesToPesPackets": true,
"enableDirectPath": false,
"insertSpliceCountdown": false,
"oneAuPerPesAudioSplices": false,
"pcrPeriod": 30,
"pmtPid": 256,
"programNumber": 1,
"psiPeriod": 100,
"standard": "dvb"
},
"transportStreams": [
{
"streams": [
{
"input": "Video_01_enc_1",
"pid": 121
},
{
"input": "Audio_1_encoded_1",
"pid": 221
}
]
}
],
"mediaTransport": "mpeg2ts"
}
],
"processings": [
{
"exportType": "iptv",
"id": "Processings_0",
"streams": [
{
"id": "Video_01_enc_1",
"type": "video",
"input": "Video_01",
"codec": "h264",
"profile": "main",
"resolution": [
1280,
720
],
"dynamicRangeMode": "followInput",
"rateControlMode": "cbr",
"frameRate": "regular",
"aspectRatioAdjustment": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0,
"type": "dynamic"
},
"videoQualityMode": "standard",
"keyFramePeriod": 1000,
"gopPolicy": "auto",
"videoDelayMode": "standard",
"insertClosedCaptions": false,
"insertActiveFormatDescription": false,
"bitRate": 5000000,
"bFrames": "auto"
},
{
"bitRate": 192000,
"channelMode": "stereo",
"codec": "mpeg1layer2",
"id": "Audio_1_encoded_1",
"input": "Audio_1",
"samplingRate": 48000,
"type": "audio"
}
]
}
],
}
}
}
Flow
Create a flow that takes the 'camera-north-1' content in and outputs to the 'camera-north-1-studio' destination:
PUT https://api.mk.io/api/projects/myproject/v1/flow/flows/camera-north-1
{
"metadata": {
"displayName": "Camera North 1",
},
"spec": {
"state": "Running",
"siteName": "world",
"transform": {
"type": "Encoding",
"encodingLive":{
"configRef":{
"name": "livechannel-encode-h264",
"version": "latest"
}
}
},
"inputs": [
{
"contentName": "camera-north-1",
"transformInput": "encoding/input_1"
}
],
"outputs": [
{
"destinationName": "camera-north-1-studio",
"transformOutput": "encoding/output_1"
}
]
}
}
The flow input connects the 'camera-north-1' content to the 'encoding/input_1' flow transform input. The flow output connects the 'encoding/output_1' flow transform output to the 'camera-north-1-studio' destination. The diagram below demonstrates the connections.

end-to-end encode flow