tencent cloud

Feedback

Transcoding to Adaptive Bitrate Streaming

Last updated: 2024-02-20 11:59:37
    Adaptive bitrate streaming refers to the process of transcoding a video into adaptive bitrate streams. The results include audio/video files with different bitrates and a descriptive manifest file. A player can dynamically select the most appropriate bitrate for playback based on the current bandwidth. Currently, the most widely used adaptive bitrate streaming format is HLS master playlist.
    VOD can transcode videos to adaptive bitrate streams in HLS and MPEG-DASH formats. This feature has the following benefits:
    The player can dynamically select the most appropriate bitrate for playback based on the current bandwidth, delivering a smooth viewing experience.
    Mainstream players natively support HLS adaptive bitrate with no customization required.
    VOD provides a Player SDK, which you can integrate into your project quickly and conveniently to enable the playback of adaptive bitrate streams.

    Adaptive Bitrate Streaming Template

    You can specify the "video transcoding parameter", "audio transcoding parameter", and other parameters for each adaptive bitrate substream. VOD uses an adaptive bitrate streaming template to represent the parameters.
    Parameter
    Description
    Protocol
    Adaptive bitrate streaming protocol. Currently, HLS and MPEG-DASH are supported.
    Encryption
    Currently, only HLS supports simple AES encryption. MPEG-DASH does not support encryption.
    Substream specification
    Controls how many substreams are output and the video and audio transcoding parameters of each substream:
    Video transcoding parameters: resolution, bitrate, frame rate, codec, etc.
    Audio transcoding parameters: sample rate, sound channel, codec, etc.
    Whether to filter "low resolution to high resolution"
    Generally, a source video with a low resolution cannot be converted to high resolution to improve the video and sound quality. Enabling filtering "low resolution to high resolution" can help avoid unnecessary transcoding
    VOD provides preset adaptive bitrate streaming templates that include common parameter combinations. You can also customize your own template.

    Initiating a Task

    There are three ways to initiate a transcoding task, namely, through a server API, via the console, and by specifying a task for video upon upload. For more information, please see “Task Initiation” in Video Processing Task System.
    Below are instructions for initiating adaptive bitrate streaming tasks in these ways:
    Call the server API ProcessMedia to initiate a task: set MediaProcessTask.AdaptiveDynamicStreamingTaskSet to the ID of the adaptive bitrate streaming template in the API request.
    Initiate a task via the console: call a server API to create an adaptive bitrate task flow (by specifying MediaProcessTask.AdaptiveDynamicStreamingTaskSet), and use it to process videos in the console.
    Specify a task upon upload from server: call a server API to create an adaptive bitrate streaming task flow, (by specifying MediaProcessTask.AdaptiveDynamicStreamingTaskSet), and in the ApplyUpload request, set procedure to the created task flow.
    Specify a task upon upload from client: call a server API to create an adaptive bitrate streaming task flow (by specifying MediaProcessTask.AdaptiveDynamicStreamingTaskSet), and in the request to upload video from client, set procedure to the created task flow.
    Specify a task upon upload from the console: call a server API to create an adaptive bitrate task flow (by specifying MediaProcessTask.AdaptiveDynamicStreamingTaskSet), and when uploading video via the console, choose Automatic Processing After Upload and select the created task flow.

    Getting Result

    After initiating an adaptive bitrate streaming task, you can wait for result notification asynchronously or perform task query synchronously to get the task execution result. Below is an example of getting the result notification in normal callback mode after the adaptive bitrate streaming task is initiated (the fields with null value are omitted):
    {
    "EventType":"ProcedureStateChanged",
    "ProcedureStateChangeEvent":{
    "TaskId":"1256768367-Procedure-2e1af2456351812be963e309cc133403t0",
    "Status":"FINISH",
    "FileId":"5285890784246869930",
    "FileName":"Animal World",
    "FileUrl":"http://1256768367.vod2.myqcloud.com/xxx/xxx/AtUCmy6gmIYA.mp4",
    "MetaData":{
    "AudioDuration":60,
    "AudioStreamSet":[
    {
    "Bitrate":383854,
    "Codec":"aac",
    "SamplingRate":48000
    }
    ],
    "Bitrate":1021028,
    "Container":"mov,mp4,m4a,3gp,3g2,mj2",
    "Duration":60,
    "Height":480,
    "Rotate":0,
    "Size":7700180,
    "VideoDuration":60,
    "VideoStreamSet":[
    {
    "Bitrate":637174,
    "Codec":"h264",
    "Fps":23,
    "Height":480,
    "Width":640
    }
    ],
    "Width":640
    },
    "MediaProcessResultSet":[
    {
    "Type":"AdaptiveDynamicStreaming",
    "AdaptiveDynamicStreamingTask":{
    "Status":"SUCCESS",
    "ErrCode":0,
    "Message":"",
    "Input":{
    "Definition":10
    },
    "Output":{
    "Definition":10,
    "Package":"hls",
    "DrmType":"",
    "Url":"http://1256768367.vod2.myqcloud.com/xxx/xxx/adp.10.m3u8"
    }
    }
    },
    {
    "Type":"AdaptiveDynamicStreaming",
    "AdaptiveDynamicStreamingTask":{
    "Status":"SUCCESS",
    "ErrCode":0,
    "Message":"",
    "Input":{
    "Definition":20
    },
    "Output":{
    "Definition":20,
    "Package":"dash",
    "DrmType":"",
    "Url":"http://1256768367.vod2.myqcloud.com/xxx/xxx/adp.20.mpd"
    }
    }
    }
    ],
    "TasksPriority":0,
    "TasksNotifyMode":""
    }
    }
    In the callback, ProcedureStateChangeEvent.MediaProcessResultSet contains two adaptive bitrate streams, whose Type is AdaptiveDynamicStreaming and Definition 10 and 20 respectively.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support