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 the preceding errors exist, transcoding efficiency monitoring is triggered and transcoding stops.
- Run the
ffprobe -show_streams -show_format -of json -i [filePath]command to obtain the file metadata and check whether the moov information is missing and whether the stream is abnormal.
- Run the
ffprobe -show_packets -i [filePath]command to check whether the data of the stream is valid and whether the length of the stream is the same as that shown 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.
- Run the
- 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 transcoding 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?
- Issue 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 formats to ApsaraVideo VOD, video streams in the original quality are generated after 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?
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?
rotation=-90is included in the video source, 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 issue that a video converted from MP4 to M3U8 displays a black screen when played?
Check whether the video stream of your source file is normal. If the first TS segment of 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 normally.
The source file is in HDR. Why is it overexposed or excessively dark after I convert the 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/video bitrate that is configured in the transcoding template not take effect during transcoding?
Check whether the bitrate check mechanism is enabled in the transcoding template. To enable bitrate check, turn on Video Bit Rate Check and Audio Bit Rate Check under Conditional Transcoding Parameters in the transcoding template in the ApsaraVideo VOD console. If the audio/video encoders that you use before and after transcoding are the same and the audio/video bitrate after transcoding is greater than the audio/video bitrate before transcoding, the audio/video bitrate that is specified in the transcoding template does not take effect. Based on the bitrate check mechanism, the audio/video is transcoded based on the original bitrate or reset without transcoding.
How long does a transcoding job take?
- Video duration: The longer the video duration, the lower the transcoding speed.
- Output video resolution: The higher the output video resolution, the lower the transcoding speed.
- Transcoding algorithm: The more complex the transcoding algorithm, the lower 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 lower 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 format requires more time than transcoding videos to H.264 format.
- Other factors that affect the transcoding speed.
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.