All Products
Search
Document Center

ApsaraVideo VOD:Audio and video transcoding

Last Updated:Jun 27, 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 codecs.

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 to 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 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

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

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

  • Low 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 volumes 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.

In most cases, transcoding parameters are complex. To free you from complex parameter configurations, ApsaraVideo VOD saves complex parameters as templates. 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 for transcoding. In a transcoding template group, you can define multiple output settings. ApsaraVideo VOD provides recommended parameter settings based on the video definition and audio quality to allow you to transcode videos without the need to learn the technical details.

Transcoding method

Description

Usage notes

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.

  • ApsaraVideo VOD provides a preset normal transcoding template group TranscodeTemplateGroup. This template group includes preset parameters such as bitrate and resolution for videos in the HTTP Live Streaming (HLS) and MP4 formats. 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.

  • For more information about how to configure a normal transcoding template, see Configure normal transcoding template groups.

Narrowband HD TM 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.

For more information about how to configure a Narrowband HD TM 1.0 transcoding template, see Narrowband HD™ 1.0.

No Transcoding (preset)

Videos are directly played in original quality without transcoding. The built-in No Transcoding template group 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.

  • When you use the No Transcoding template group, make sure that the uploaded videos can be directly played. Only videos in the following formats can be played without transcoding: MP4, Flash Video (FLV), M3U8, MP3, and WEBM.

  • If video playback fails or the playback URL cannot be obtained by calling API operations after you use the No Transcoding template group for a video, see the "Why am I unable to play videos that are transcoded by using the No Transcoding template group?" section of the FAQ about transcoding topic.

Before you begin

Usage notes

  • 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.

Transcode media files by using the ApsaraVideo VOD console

Step 1: (optional) Create a transcoding template group

If the built-in transcoding template groups such as the No Transcoding and TranscodeTemplateGroup template groups cannot meet your transcoding requirements, you can create a custom transcoding template group and specify parameters such as the container format and resolution based on your business requirements.

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Configuration Management > Media Processing > Transcoding Template Groups.

  3. On the Transcoding Template Groups page, click Create Transcoding Template Group.

Step 2: Start transcoding

You can trigger transcoding jobs when you upload and process media files. You can specify a transcoding template group when you create a transcoding job. Alternatively, you can add a transcoding template group to a workflow and use the workflow to transcode media files. For more information about how to create a workflow that includes a transcoding template group, see Manage workflows.

Automatically trigger transcoding during uploads

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Media Files > Audio/Video. Then, click Upload.

  3. On the Add Media page that appears, click Add Media. In the dialog box that appears, specify the parameters such as Upload Method and Bucket, select Use Transcoding Template Group or Use Workflow from the drop-down list, and specify the transcoding template group or workflow.

    For more information about supported video formats and parameter descriptions, see Upload media files by using the ApsaraVideo VOD console.Audio and video transcoding 2

  4. Select the media files that you want to upload and click Upload.

    After the media files are uploaded, the files are automatically transcoded based on the transcoding template group or workflow that you specified.

Start transcoding for uploaded videos

In most cases, this operation is used to re-transcode existing videos, encrypt existing videos in HLS encryption mode, or override watermark parameters.

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Media Files > Audio/Video.

  3. On the Video and Audio page, find the media file that you want to transcode and click Media Processing in the Actions column.

  4. In the dialog box that appears, specify Use Transcoding Template Group or Use Workflow and specify the transcoding template group or workflow that you want to use.Audio and video transcoding

  5. Click OK.

    The media file is transcoded by using the transcoding template group or workflow that you specified.

Step 3: View the transcoding results

After a media file is transcoded, you can use one of the following methods to view the transcoding results, such as the transcoding status and the playback URL of the video. You can obtain the playback URL and use ApsaraVideo Player or a third-party player to play the transcoded video.

Important

If you do not configure an accelerated domain name in ApsaraVideo VOD, you are charged for outbound traffic when you play or download a video based on the URL. For more information, see Billing of basic services.

Method 1: By using the ApsaraVideo VOD console

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Media Files > Audio/Video.

  3. On the Video and Audio page, view the transcoding status of the media file.

    Normal indicates that the media file is transcoded. For more information about other transcoding statuses, see the Status: the status of a video section of the Basic data types topic.

  4. Find the transcoded media file that you want to manage and click Manage in the Actions column. On the page that appears, view the playback URL on the Video URL tab.

    After a media file is transcoded, streams in different definitions and playback URLs are generated.

    Audio and video transcoding 3

Method 2: By event notifications

ApsaraVideo VOD supports HTTP callbacks and MNS callbacks. After you configure event notifications, ApsaraVideo VOD sends you a notification when media files are processed based on the callback method that you specified. For example, ApsaraVideo VOD notifies you when media files are uploaded or transcoded. For more information, see Overview.

The transcoding-related events include StreamTranscodeComplete and TranscodeComplete. You can obtain information such as the transcoding status and playback URL of the video from the callbacks.

Transcode media files by using the ApsaraVideo VOD API or SDK

Usage notes

  • For more information about how to call API operations to transcode media files, see List of operations by function. We recommend that you use the command-line tool OpenAPI Explorer developed by Alibaba Cloud for debugging. This frees you from signature calculations. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

  • For more information about how to use SDKs, see Usage notes.

Step 1: (Optional) Create a transcoding template group

If the built-in transcoding template groups such as the No Transcoding and TranscodeTemplateGroup template groups cannot meet your transcoding requirements, you can create a custom transcoding template group and specify parameters such as the container format and resolution based on your business requirements. If you set TemplateGroupId to VOD_NO_TRANSCODE, the No Transcoding template group is used.

  1. Call the AddTranscodeTemplateGroup operation to create a transcoding template group. Set Definition in TranscodeTemplate to configure normal transcoding or Narrowband HD™ transcoding.

Step 2: Start transcoding

You can trigger transcoding jobs when you upload and process media files. You can specify a transcoding template group when you create a transcoding job. Alternatively, you can add a transcoding template group to a workflow and use the workflow to transcode media files. For more information about how to create a workflow that includes a transcoding template group, see Manage workflows.

Automatically trigger transcoding during uploads

Note

You can call the CreateUploadVideo operation only to obtain upload URLs and credentials and create media assets. To upload media files, you must implement the upload logic. For more information about how to upload media files by calling API operations, see Upload media files by calling the ApsaraVideo VOD API.

  1. Configure TemplateGroupId or WorkflowId when you call the CreateUploadVideo operation to obtain an upload URL and a credential or the UploadMediaByURL operation to upload media files. After media files are uploaded, ApsaraVideo VOD transcodes the media files based on the transcoding template group or workflow that includes a transcoding template that you specified.

Start transcoding for uploaded videos

In most cases, this operation is used to re-transcode existing videos, encrypt existing videos in HLS encryption mode, or override watermark parameters.

  1. Configure TemplateGroupId or WorkflowId when you call the SubmitTranscodeJobs operation to submit a transcoding job or the SubmitWorkflowJob operation to submit a workflow. After you submit a transcoding job, ApsaraVideo VOD transcodes the media files based on the transcoding template group or workflow that includes a transcoding template that you specified.

Step 3: View the transcoding results

After a media file is transcoded, you can use one of the following methods to view the transcoding results, such as the transcoding status and the playback URL of the video. You can obtain the playback URL and use ApsaraVideo Player or a third-party player to play the transcoded video.

Important

If you do not configure an accelerated domain name in ApsaraVideo VOD, you are charged for outbound traffic when you play or download a video based on the URL. For more information, see Billing of basic services.

Method 1: By calling API operations

Obtain the TranscodeTaskId from the response to the SubmitTranscodeJobs operation. Then, call the GetTranscodeTask to query information such as the transcoding status and playback URL of the video.

Method 2: By event notifications

ApsaraVideo VOD supports HTTP callbacks and MNS callbacks. After you configure event notifications, ApsaraVideo VOD sends you a notification when media files are processed based on the callback method that you specified. For example, ApsaraVideo VOD notifies you when media files are uploaded or transcoded. For more information, see Overview.

The transcoding-related events include StreamTranscodeComplete and TranscodeComplete. You can obtain information such as the transcoding status and playback URL of the video from the callbacks.

References