All Products
Search
Document Center

ApsaraVideo VOD:Audio and video transcoding

Last Updated:Jan 10, 2023

Transcoding is an essential part of media processing. This topic provides an overview of media transcoding and the transcoding methods supported by Alibaba Cloud. This topic also describes how to configure a transcoding template and start transcoding.

Overview

What is transcoding?

Video transcoding is a process of converting a compressed and encoded video stream to another video stream to adapt to different network bandwidths, terminal processing capabilities, and user requirements. Transcoding is a process in which decoding and encoding are performed. Streams before and after transcoding may use the same or different video encoding standards.

The following figure shows the point at which video transcoding is performed in a video production workflow.

Workflow

Features

  • Video processing: ApsaraVideo VOD provides comprehensive transcoding and container format conversion capabilities to convert between various media file formats.

  • Audio processing: ApsaraVideo VOD provides audio processing features such as audio transcoding and audio extraction.

  • Watermarking: ApsaraVideo VOD supports static watermarks, animated watermarks such as GIF and MOV files, and text watermarks. You can add multiple watermarks to a video. For more information, see Video watermarks.

  • Multiple preset definitions: ApsaraVideo VOD provides multiple preset definitions, such as Standard Definition, High Definition, Ultra High Definition, 2K, and 4K. ApsaraVideo VOD provides recommended optimal settings to help you start transcoding without the need for deep technical understanding.

  • Multi-scenario solutions such as audio extraction: You can extract an audio track of the standard or high quality from a video as an audio output. This is suitable for scenarios such as broadcasting at a radio station.

  • Content protection: ApsaraVideo VOD supports content encryption for various scenarios such as online education and copyright protection.

Scenarios

  • Adaptation to multiple terminals: The generated content can be played on PCs, TVs, and mobile devices.

  • Adaptability with multiple network environments: You can select the most suitable bitrate based on your network bandwidth to ensure smooth playback.

  • Reduction of storage and distribution costs: You can change video bitrates, increase the compression rate, and reduce file sizes without changes to image quality. This ensures smooth playback and reduces storage and traffic costs.

  • Content protection: Content encryption is supported for various scenarios such as online education and copyright protection.

  • Watermarking: You can add information such as enterprise logos, TV station logos, user IDs, and nicknames as watermarks for video copyright declaration or brand promotion.

ApsaraVideo VOD provides multiple scenario-specific preset definitions and streamlines the process from uploading to transcoding based on long-term analysis of large amounts of data.

Transcoding methods

ApsaraVideo VOD supports normal transcoding, no transcoding, and Narrowband HDTM transcoding 1.0. When you configure a transcoding template, you can select a transcoding method based on your business requirements.

Important

  • You are charged for the transcoding feature. For more information, see Billing of basic services.

  • You are charged for each transcoding job. A new video file is generated after a transcoding job is complete. To improve storage utilization and prevent additional charges, we recommend that you create transcoding template groups and transcoding jobs based on your business requirements.

Normal transcoding

Normal transcoding can meet your basic transcoding requirements. You can select different container formats and definitions to transcode videos based on your business requirements. Normal transcoding is suitable for long videos.

ApsaraVideo VOD provides the following seven preset video definitions: Low Definition, Standard Definition, High Definition, Ultra High Definition, 2K, 4K, and Original. ApsaraVideo VOD also provides two audio quality options: Standard Quality and High Quality. You can specify bitrates, resolutions, and formats for videos in different definitions. You can also categorize and manage different transcoding templates in transcoding template groups.

Narrowband HDTM 1.0

Based on the proprietary transcoding technology of Alibaba Cloud, Narrowband HDTM 1.0 analyzes each scene, action, content, and texture in videos. This reduces the bitrate and bandwidth costs without changes to image quality. For more information, see the article posted in Yunqi Community.

No transcoding

Videos are directly played in original quality without transcoding. No transcoding is suitable for scenarios in which you can directly play videos in original quality, such as short videos and live-to-VOD recording.

  • Some videos such as short videos are compressed when they are captured. These videos can be directly played on multiple devices. In this case, you can distribute the videos without transcoding.

  • You do not need to use ApsaraVideo VOD to transcode videos that are locally transcoded. You can distribute the videos without transcoding.

  • Only videos in the following formats can be played without transcoding: MP4, Flash Video (FLV), M3U8, MP3, and WEBM.

Use the transcoding feature

Before you transcode audio or video files, you must configure a transcoding template. You can use the preset transcoding template or a custom transcoding template to create a transcoding job. After the job is complete, you can obtain information about the transcoding job.

  1. Configure a transcoding template group. For more information, see the Configure transcoding template groups section of this topic.

  2. Start transcoding. For more information, see the Start transcoding section of this topic.

Configure transcoding template groups

In most cases, transcoding parameters are complex. ApsaraVideo VOD saves complex parameters as templates to free you from complex parameter configurations. You can create custom transcoding templates. A custom transcoding template contains a set of transcoding parameters such as audio parameters, video parameters, and container parameters to meet your custom requirements on transcoding. Multiple output settings can be configured in a transcoding template. ApsaraVideo VOD provides recommended parameter settings based on the video definition and audio quality to allow you to transcode videos without the need to understand the technical details. You can create transcoding template groups by using the ApsaraVideo VOD console or calling the ApsaraVideo VOD API.

Normal transcoding template groups

  • Console

    Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Processing > Transcoding Template Groups. On the Transcoding Template Groups page, click Create Transcoding Template Group. For more information about how to create normal transcoding template groups, see Configure transcoding template groups.

    • ApsaraVideo VOD provides the following seven preset video definitions: Low Definition, Standard Definition, High Definition, Ultra High Definition, 2K, 4K, and Original. ApsaraVideo VOD also provides two audio quality options: Standard Quality and High Quality. In addition, ApsaraVideo VOD provides recommended parameter settings for each definition. When you select a definition, ApsaraVideo VOD automatically sets parameters to the recommended values to help you quickly create a template.

    • ApsaraVideo VOD provides a preset transcoding template group TranscodeTemplateGroup. This template group includes preset parameters such as definition, bitrate, and resolution for videos in the HTTP Live Streaming (HLS) format and MP4 format. You can quickly configure the encoding format, watermark template, and encryption method. The first time you use a transcoding template group, we recommend that you use TranscodeTemplateGroup.

  • API

    Call the AddTranscodeTemplateGroup operation and configure the Definition parameter in this operation to create a normal transcoding template group.

Narrowband HDTM 1.0 transcoding template groups

  • Console

    You can create Narrowband HD transcoding template groups by following the operations used to create a normal transcoding template group. When you create a transcoding template group, select a definition of Narrowband HD 1.0 such as LD-Narrowband HD1.0 or SD-Narrowband HD1.0. For more information about how to create Narrowband HD transcoding template groups, see Narrowband HD 1.0.

    ApsaraVideo VOD provides preset definitions that support Narrowband HDTM 1.0. These definitions can be applied to videos in the MP4 format and HLS format. The following table describes the preset definitions that support Narrowband HD 1.0.

    Definition

    Bitrate range (Kbit/s)

    Resolution - width (pixel)

    LD - Narrowband HD 1.0

    ≤ 400

    640

    SD - Narrowband HD 1.0

    ≤ 800

    848

    HD - Narrowband HD 1.0

    ≤ 1500

    1280

    UHD - Narrowband HD 1.0

    ≤ 3000

    1920

    2K - Narrowband HD 1.0

    ≤ 4000

    2048

    4K - Narrowband HD 1.0

    ≤ 8000

    3840

  • API

    Call the AddTranscodeTemplateGroup operation and configure the Definition parameter in this operation to create a narrowband HD TM 1.0 template group.

No transcoding template group

ApsaraVideo VOD provides a built-in No Transcoding template group. You cannot modify this template group. By default, the No Transcoding template group is used after you activate the ApsaraVideo VOD service. If you select the No Transcoding template group, the URLs of your videos in Original quality are used.

Note
  • If transcoding is not required, make sure that the files that you upload can be played in original quality. Only videos in the following formats can be played without transcoding: MP4, FLV, M3U8, MP3, and WEBM.

  • If you use the No Transcoding template group when you upload a media file that is not in the MP4 format, the file is considered an original file. In this case, you cannot preview the file in the ApsaraVideo VOD console or call the GetPlayInfo operation to obtain the playback URL of the file. You can obtain the playback URL of the file only by calling the GetMezzanineInfo operation.

  • Console

    Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Processing > Transcoding Template Groups. On the Transcoding Template Groups page, select the No Transcoding template group.Audio and video transcoding 1

  • API

    Call an operation such as SubmitTranscodeJobs and set TemplateGroupId to VOD_NO_TRANSCODE in this operation if you do not need transcoding.

Start transcoding

Automatically trigger transcoding for videos to be uploaded

  • Console

    Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Media Files > Audio/Video. On the Audio and Video page, select a transcoding template before you upload a video. For more information, see Upload media files by using the ApsaraVideo VOD console.

  • API

    You can specify the transcoding template ID that you want to use in the TemplateGroupId parameter when you call the CreateUploadVideo operation or the UploadMediaByURL operation to upload a video. After you upload the video, ApsaraVideo VOD automatically transcodes the video based on the transcoding template. Then, ApsaraVideo VOD returns the information about the transcoded stream based on your callback settings. For more information, see Overview.

Start transcoding for uploaded videos

  • Console

    Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Media Files > Audio/Video. On the Video and Audio page, select a video that you want to transcode and click Media Processing in the Actions column to configure transcoding for the video. This method is used to transcode videos that are stored in ApsaraVideo VOD.Audio and video transcoding

  • API

    Call the SubmitTranscodeJobs operation and configure the TemplateGroupId parameter in this operation to start transcoding. In most cases, this operation is used to re-transcode existing videos, encrypt existing videos in HLS encryption mode, or override watermark parameters.

Best practices

For more information, see Select a transcoding type.