Set up an upstream flow for site-to-site contribution

Flow transform

Create a flow transform that performs an encode from SDI baseband to h.264:

PUT <<APIURL>>/api/projects/<<PROJECTNAME>>/v1/flow/transforms/h264-encode

{
    "metadata": {
        "displayName": "H.264 Encode"
    },
    "spec": {
        "type": "LiveChannel",
        "encoding": {
            "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"
                        }
                    ]
                }
            ],
            "hardwareAcceleration": {
                "type": "qsv",
                "mode": "full",
                "device": 1
            }
        }
    }
}

Flow

Create a flow that takes the 'camera-north-1' content in and outputs to a downstream flow:

PUT https://api.mk.io/api/projects/myproject/v1/flow/flows/cn1-stadium

{
    "metadata": {
        "displayName": "Camera North 1 - Stadium",
    },
    "spec": {
        "state": "Running",
        "siteName": "stadium",
        "transformName": "h264-encode",
        "inputs": [
            {
                "contentName": "camera-north-1",
                "transformInput": "encoding/input_1"
            }
        ],
        "outputs": [
            {
                "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 to the 'encoding/output_1' flow transform output and omits the destinationName to create an internal flow output that will supply the downstream flow on the 'studio' site. The diagram below demonstrates the connections.

upstream encode flow

upstream encode flow