All Products
Search
Document Center

ApsaraVideo VOD:FAQ about transcoding

Last Updated:Feb 02, 2024

This topic provides answers to some commonly asked questions about transcoding in ApsaraVideo VOD.

How do I troubleshoot a transcoding failure?

  • Check whether the source file can be played on your on-premises machine. This step cannot be skipped because most transcoding failures are caused by invalid source files. For example, the source file does not contain the required video stream, the metadata is invalid, the frames are invalid, or the video header information is missing. If one of the preceding errors occurs, transcoding efficiency monitoring is triggered and transcoding stops.

    • Run the ffprobe -show_streams -show_format -of json -i [filePath] command to view the metadata information about the source file and determine whether the file contains errors such as a missing moov atom or an invalid stream.

    • Run the ffprobe -show_packets -i [filePath] command to check whether the source file contains a stream error and whether the stream length is the same as that specified in the metadata.

      Note

      If the length of the stream is different from that shown in the metadata, transcoding may fail. For files that have incorrect metadata, we recommend that you use FFmpeg to process the file before you upload the file for transcoding.

  • Troubleshoot the issue based on the corresponding error code. For more information about the error codes, visit the Error Codes page.

  • If the text watermark that you add contains special characters, the watermark output may be truncated or fail. Before you add the text watermark, you must escape the special characters.

  • Check whether the encryption failed. For more information about common errors when you use HTTP Live Streaming (HLS) encryption, see FAQ about HLS encryption.

Why am I unable to play videos that are transcoded by using the No Transcoding template group?

Check whether the error is caused by the following reasons:

  • Cause 1: The uploaded source video cannot be played.

  • Issue 2: The video that you tried to play is in a format other than MP4, FLV, M3U8, MP3, or WEBM.

    • If you use the No Transcoding template group to upload video files in the MP4, FLV, M3U8, MP3, or WEBM format to ApsaraVideo VOD, video streams in the original quality are generated after the upload. If you upload video files in other formats, the original video is uploaded.

    • You cannot preview original videos in the ApsaraVideo VOD console or obtain playback URLs of original videos by calling the GetPlayInfo or GetMezzanineInfo operation. Video streams in the original quality can be previewed in the ApsaraVideo VOD console, and you can call the GetPlayInfo operation to obtain playback URLs of the video streams.

The video source has multiple audio streams. Why is there only one audio stream left after transcoding?

The attribute audioMap=0 is configured in the Output parameter. Therefore, only one audio stream can be retained. If you have special requirements, submit a request on Yida to contact Alibaba Cloud technical support.

Why are the width and height of the transcoded video different from the settings?

In an ApsaraVideo VOD transcoding template, you can configure the auto-rotate screen feature by using the LongShortMode parameter. This feature is enabled by default. When auto-rotate screen is enabled, you only need to specify either the width or the height. If you want to have a specific output resolution, you must disable auto-rotate screen. In this case, the output video may be stretched or deformed.

Why are the video width and height switched after I transcode a video?

In most cases, if rotation=-90 is included in the video source settings, the width and height of the transcoded video are switched. You can use the FFmpeg tool to check whether the source file contains rotation angle information. Sample code:

ffprobe -show_streams -show_format -of json -i  [filepath]

How do I troubleshoot the black screen error when I play a video converted from MP4 to M3U8?

Check whether the source video stream is valid. If the first TS segment in the source file does not contain video stream data, the player considers that no video images are available. In this case, you can perform MP4 transcoding and then M3U8 transcoding on the source file. This way, the video can be played.

Why is it overexposed or excessively dark after I convert an HDR video to an SDR video?

The video becomes overexposed because existing configurations in the template do not adapt to HDR. submit a request on Yida to contact Alibaba Cloud technical support.

Can ApsaraVideo VOD determine the location of the moov box during transcoding? What if a file does not have moov information?

After transcoding, the moov box is placed in the MP4 file header by default. Custom configurations are not supported. ApsaraVideo VOD cannot process files without moov information. Therefore, transcoding for such files fails.

Why is the duration of the audio file inconsistent with that of the source video after I convert the video to audio?

To ensure consistency in length before and after transcoding, ApsaraVideo VOD calculates the length of the audio stream in the input file based on the "shortest-first" logic. If the timestamps of some segments in the file are not consecutive, ApsaraVideo VOD may fail to obtain the media information of the video stream. This affects the calculation of the transcoding length and causes length deviation.

Why does the audio or video bitrate that is configured in the transcoding template not take effect during transcoding?

Check whether bitrate check is enabled in the transcoding template. To enable bitrate check, turn on Video Bit Rate Check or Audio Bit Rate Check under Conditional Transcoding Parameters in the transcoding template in the ApsaraVideo VOD console. If the audio or video encoders that you use before and after transcoding are the same and the audio or video bitrate after transcoding is greater than the audio or video bitrate before transcoding, the audio or video bitrate that is specified in the transcoding template does not take effect. Based on the bitrate check mechanism, the audio or video is transcoded based on the original bitrate or reset without transcoding.

How long does a transcoding job take?

The transcoding speed mainly depends on the duration of the video that you want to transcode. The transcoding speed is also affected by other factors, such as the resolution and encoding format, the complexity of the transcoding algorithm, and the number of transcoding tasks submitted. The following section describes how the factors affect the transcoding speed:

  • Video duration: The longer the video duration, the slower the transcoding speed.

  • Output video resolution: The higher the output video resolution, the slower the transcoding speed.

  • Transcoding algorithm: The more complex the transcoding algorithm, the slower the transcoding speed. The complexity levels of transcoding algorithms: Narrowband HD™ 2.0 > Narrowband HD™ 1.0 > Regular transcoding.

  • Transcoding tasks: The more transcoding tasks submitted, the slower the transcoding speed. This is because transcoding tasks are queued when a large number of transcoding tasks are submitted.

  • Encoding format: Transcoding videos to H.265 requires more time than transcoding videos to H.264.

In most cases, if you use regular transcoding to generate a 720P H.264 video, the transcoding speed is 5 to 6 times the video duration. If you use Narrowband HD™ 1.0 transcoding to generate a video in the preceding specification, the transcoding speed is 2 to 3 times the video duration. For example, you want to transcode a 6-minute video to a 720P H.264 video. If you use regular transcoding, the transcoding takes approximately 1 minute. If you use Narrowband HD™ 1.0 transcoding, the transcoding takes approximately 2 minutes.

Can I query the progress of a transcoding job in real time?

You cannot call an API operation to query the progress of a transcoding job. However, you can configure a callback to notify you of the transcoding results. For more information, see Event notifications.

Why do my transcoding jobs always fail?

A job failure may be caused by various reasons. You can locate the possible cause based on the returned error message. If you receive an error message that indicates preprocessing failures, ApsaraVideo VOD is unable to decode your source file. submit a request on Yida to contact Alibaba Cloud technical support and provide the following information to assist in problem diagnosis: the ID of your Alibaba Cloud account and the ID of the video.

Does ApsaraVideo VOD support real-time encoding?

ApsaraVideo VOD provides the transcoding service for input files and does not support real-time transcoding.

Can I transcode multiple videos that are uploaded to ApsaraVideo VOD in a batch?

You cannot transcode multiple videos that are uploaded to ApsaraVideo VOD in a batch.

What do I do if the watermark that I configured during transcoding does not take effect or is not displayed on the video?

Check whether the watermark settings such as the size and offset allow the watermark to be displayed on the video. If the watermark resides outside the video image, the watermark is not displayed on the video after the transcoding is complete.

转码常见问题-水印.png