This topic provides answers to frequently asked questions about video transcoding in ApsaraVideo VOD.
How do I troubleshoot a transcoding failure?
Confirm that the source file plays correctly on a local machine. This is a critical step. Most transcoding failures occur because the source file is invalid. For example, the video stream is missing, the metadata is incorrect, frames are corrupted, or the file header is missing. These issues can trigger transcoding efficiency monitoring and cause the job to stop.
Run the
ffprobe -show_streams -show_format -of json -i [filePath]command to check the file's metadata for issues such as a missing moov atom or an abnormal stream.Run the
ffprobe -show_packets -i [filePath]command to check for problems in the data stream and verify if the stream duration matches the duration in the metadata.NoteA mismatch between the duration in the metadata and the actual stream duration can cause transcoding to fail. If a file has problematic metadata, you can process it with the FFmpeg tool locally before you upload it for transcoding.
Find the corresponding error code in Error codes to determine the specific reason for the failure.
If a text watermark contains special characters, the output may be truncated or fail. You must escape these special characters before you add the watermark.
If encrypted transcoding fails, see FAQ about video encryption for information about common errors that occur during HLS encryption.
Why can't I play a video that was processed using the built-in "No Transcoding" template group?
Check for the following possible causes:
Cause 1: The uploaded source video is invalid and cannot be played.
Cause 2: Only videos in MP4, FLV, M3U8, MP3, and WEBM formats can be played directly without transcoding.
When you upload a video to ApsaraVideo VOD, if you use the built-in No Transcoding template group and the source video is in MP4, FLV, M3U8, MP3, or WEBM format, an original quality video stream is generated after the upload. If the source video is in another format, an original file video stream is generated.
You cannot preview original file video streams in the ApsaraVideo VOD console or retrieve their playback URLs by calling the GetPlayInfo operation. You can only retrieve the source file URL for playback by calling the GetMezzanineInfo operation. In contrast, you can preview original quality video streams in the ApsaraVideo VOD console and retrieve their playback URLs by calling the GetPlayInfo operation.
What do I do if my source video has multiple audio streams but only one remains after transcoding?
Currently, only one audio stream can be retained. This is configured by adding audioMap=0 to the Output parameter. If you have special requirements, you can submit a ticket.
Why are the width and height of the transcoded video different from the settings?
ApsaraVideo VOD transcoding templates include an automatic rotation feature (LongShortMode), which is enabled by default. When this feature is enabled, `width` corresponds to the long side and `height` corresponds to the short side. You need to set only one of these values and leave the other empty. If you want to output a specific resolution, you must disable automatic rotation. Note that this may cause the output video to be stretched or distorted.
Why is the video resolution swapped after transcoding, such as from portrait to landscape?
This usually happens because the video source contains rotation=-90, which causes the resolution to be swapped after transcoding. You can use the FFmpeg tool to check whether the source file contains rotation angle information. To query the source file information, run the following command:
ffprobe -show_streams -show_format -of json -i [filepath]How do I troubleshoot a black screen when playing an M3U8 file that was transcoded from MP4?
First, check whether your source video stream is normal. If the first TS segment of the source file has no video stream data, the player assumes that there is no video. If this happens, first transcode the source file to MP4, and then transcode the MP4 file to M3U8. The video should then play correctly.
Why is a video overexposed or too dark after being converted from HDR to SDR?
If your source video is High Dynamic Range (HDR), set the Dynamic Range of HDR Source parameter in the transcoding template to Map to SDR. Example:

The Map to SDR feature is in public preview. It will become a paid feature after the public preview ends. For more information, see Audio and video enhancement fees. If the issue is not resolved, you can submit a ticket for assistance.
Can ApsaraVideo VOD determine the position of the moov box during transcoding? What if a file does not have a moov box?
After transcoding, the moov box is placed in the MP4 file header by default. Custom configurations are not supported. ApsaraVideo VOD cannot process files that do not have a moov box. The transcoding for such files will fail.
Why is the duration of an audio file different from the source video after conversion?
The transcoding logic of ApsaraVideo VOD ensures duration consistency by timing the transcode based on the shortest audio stream in the input file. If timestamps in some source file segments are not continuous, the service cannot retrieve the media information of the video stream. This affects the transcoding duration estimate and causes a duration drift.
What do I do if an error occurs when I play a transcoded audio-only file?
Check whether the video setting is disabled in the transcoding template. When you transcode an audio-only file, you must prevent video transcoding. To do this, disable video and select an appropriate resolution, such as the last two resolutions shown in the figure.
Why is the audio or video bitrate set in the transcoding template not taking effect?
Check whether a bitrate check mechanism is configured in the transcoding template. In the ApsaraVideo VOD console, this corresponds to the Check video bitrate or Check audio bitrate setting under Conditional Transcoding Parameters. If this check is enabled, the bitrate that you set in the template does not take effect under the following conditions: the encoder is the same for the input and output, and the target bitrate is higher than the source bitrate. In this case, the bitrate is reset based on the check mechanism, which may use the original bitrate or skip transcoding.
How long does a transcoding job take?
In ApsaraVideo VOD, the time required for a transcoding job is mainly proportional to the video duration. The time is also affected by multiple factors, such as the output resolution, encoding format, transcoding algorithm complexity, and the number of transcoding jobs. The details are as follows:
Video duration: The longer the video, the slower the transcoding.
Output resolution: The higher the output resolution, the slower the transcoding.
Transcoding algorithm: The more complex the algorithm, the slower the transcoding. The complexity of transcoding algorithms is ranked as follows: Narrowband HD 2.0 > Narrowband HD 1.0 > Regular transcoding.
Number of transcoding jobs: The more jobs you submit, the slower the transcoding. This is because many jobs can create a queue, which adds to the processing time.
Other factors, such as the encoding format. Transcoding to H.265 takes longer than transcoding to H.264.
Normally, for a job that outputs a 720P H.264 video, regular transcoding runs at 5 to 6 times the playback speed, and Narrowband HD 1.0 transcoding runs at 2 to 3 times the playback speed. For example, to transcode a 6-minute video to 720P H.264, a regular transcoding job takes about 1 minute. A Narrowband HD 1.0 transcoding job takes about 2 minutes.
Can I query the transcoding progress in real time?
ApsaraVideo VOD does not provide an interface to query the real-time progress of a transcoding job. However, you can set up callbacks to receive event notifications about the results of the transcoding process. For more information, see Event notifications.
Can I perform batch transcoding operations?
ApsaraVideo VOD does not support batch transcoding operations for videos that are already in ApsaraVideo VOD. The system automatically transcodes videos during upload based on configured transcoding templates or workflows. However, if you use your own Object Storage Service (OSS) buckets, you can perform batch transcoding. To do this, first attach an Intelligent Media Management (IMM) project. Then, create batch transcoding jobs using conditions such as prefix matching to efficiently process multiple videos. For more information, see OSS batch processing.
Why do my transcoding jobs keep failing?
A job can fail for many reasons. Check the returned error message. If you receive a pre-processing failure error, it means that ApsaraVideo VOD could not decode your source file. In this case, you can submit a ticket for assistance and provide the following information: your Alibaba Cloud account ID and the video ID.
Is real-time transcoding supported?
No. ApsaraVideo VOD is a file-based transcoding service and does not support real-time transcoding.
Can I batch transcode videos that are already uploaded to ApsaraVideo VOD?
No. Batch transcoding is not supported for videos that are already uploaded to ApsaraVideo VOD.
Why is my watermark not visible or not taking effect after transcoding?
Check the parameters of the watermark template that is used for transcoding, such as size (width × height) and offset. Ensure that these settings place the watermark within the video frame (resolution width × height). If the watermark is outside the video frame, it is not visible even if the transcoding is successful.

Why don't I receive callbacks for transcoding failures?
When you configure event notifications for transcoding, you might configure only the Single Definition Transcoding Complete (StreamTranscodeComplete) event and not the All Definitions Transcoding Complete (TranscodeComplete) event. If you upload a damaged source video that causes all transcoding streams to fail, ApsaraVideo VOD returns a failed `TranscodeComplete` callback. Because you did not configure a listener for this callback, you do not receive a notification for the transcoding failure.