Transcoding failures may be caused because the uploaded mezzanine files are invalid. For example, a transcoding failure occurs if a mezzanine file does not contain a video stream, or contains invalid metadata, error frames, or incomplete video header information. This topic provides answers to frequently asked questions (FAQ) about ApsaraVideo Media Processing (MPS). The FAQ involves transcoding exceptions, supported transcoding formats, and other common issues.
Transcoding exceptions
How do I troubleshoot a transcoding failure after I submit a transcoding job by calling the SubmitJobs operation?
Check whether the uploaded mezzanine file can be played on your on-premises machine. Most transcoding failures occur because the uploaded mezzanine files are invalid. For example, a transcoding failure occurs if a mezzanine file does not contain a video stream, or contains invalid metadata, error frames, or incomplete video header information.
Run the
ffprobe -show_streams -show_format -of json -i [filePath]
command to view the metadata information about the mezzanine file and check whether the file contains errors such as a missing moov box or an invalid stream.Run the
ffprobe -show_packets -i [filePath]
command to check whether the mezzanine file contains a stream error and whether the stream length is the same as that specified in the metadata.NoteIf the length specified in the metadata is different from the actual length of the stream, the transcoding job may fail. For files that contain invalid metadata, we recommend that you process the files by using an FFmpeg tool on your on-premises machine before you upload the files for transcoding.
Check whether the protocol used by the mezzanine file is supported by MPS.
Troubleshoot the issue based on the error code. For more information, see the "Error codes" section of the SubmitJobs topic.
If the text watermark that you add contains special characters, the watermark may be truncated or fail to be generated. You must escape the special characters when you enter the text, or submit a ticket to contact Alibaba Cloud technical support for compatibility processing.
Troubleshoot encryption and transcoding failures based on the following common causes:
The encryption key is generated by using a custom string.
You must generate the plaintext key for encryption by calling the GenerateDataKey operation. You cannot use a custom string to generate an encryption key. Otherwise, encryption and transcoding fail.
The key type is not AES_128.
If HTTP Live Streaming (HLS) encryption and transcoding fail and no encrypted file is generated, check whether the key that is generated by calling the GenerateDataKey operation is of the AES_128 type. If another key type is set, HLS encryption and transcoding fail, and no encrypted file is generated.
The plaintext key is not decoded.
If a video that is encrypted in HLS encryption mode fails to be decrypted for playback, check whether the decryption operation uses Base64 to decode the plaintext key that is generated by Key Management Service (KMS) before the key is sent to the player. If the plaintext key is not decoded, the decryption fails.
The SubmitJobs operation is repeatedly called.
HLS encryption and transcoding are manually triggered. If duplicate encrypted files are generated, check whether the SubmitJobs operation is repeatedly called.
Why does a transcoding job stay in the Submitted state?
The Submitted state indicates that the transcoding job is being prepared. For example, the video file is being downloaded or analyzed. Factors such as the size of the video file, the bitrate settings, and the template that you select can all cause slow transcoding. Wait until the job is prepared.
What do I do if the mezzanine file contains two audio streams but only one is left after transcoding?
Enter "AudioStreamMap":"0:a:0"
for the Output parameter when you call the SubmitJobs operation.
Why are the width and height of the output file different from those I specify for transcoding?
In a transcoding template, you can set the LongShortMode parameter to specify whether to enable the auto-rotate screen feature. If the auto-rotate screen feature is enabled, you need to set only the width or height of the output file and leave the other empty. If you want to specify both the width and the height of the output file, you must disable the auto-rotate screen feature. For example, if you want to generate a video in portrait mode, you need to set only the width or the short side of the output file. If you want to generate a video in landscape mode, you need to set only the height or the long side of the output file.
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 the uploaded mezzanine file is normal. If the first TS segment of the mezzanine file does not contain video stream data, the player considers that no video images are available. In this case, you can transcode the file to the MP4 format and then transcode the MP4 file to the M3U8 format to play the video.
Why does a video fail to be played after it is transcoded?
A playback failure may be caused by an expired HTTPS certificate or invalid configurations of an HTTPS certificate. In this case, the video can be played only by using the HTTP protocol.
Why does overexposure or underexposure occur after a High Dynamic Range (HDR) video is transcoded to a Standard Dynamic Range (SDR) video?
Overexposure occurs because adaptive settings are not configured for the template that is used. You can submit a ticket to contact Alibaba Cloud technical support to configure adaptive settings. Underexposure occurs because a non-HDR video is transcoded by using a template for HDR videos. You need to check whether the uploaded mezzanine file is an HDR video before you transcode it into an SDR video.
Can I specify the location of the moov box for MPS? Can a file without a moov box be transcoded?
No, you cannot specify the location of the moov box. After transcoding, the moov box is placed in the mp4 file headers by default. Custom configurations are not supported. Files without moov boxes cannot be transcoded.
Why does the length change after a video file is converted to an audio file?
To ensure consistency in length before and after transcoding, MPS 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, MPS 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 bitrate I specify for transcoding fail to take effect?
If the same audio encoder is used before and after transcoding and the audio bitrate after transcoding is greater than the audio bitrate before transcoding, the audio bitrate is reset, and the specified audio bitrate does not take effect. For more information, see SubmitJobs.
What do I do if no data is returned after I call an API operation?
If no data is returned or an error message is returned indicating that the specified resource does not exist, check whether the ID of your Alibaba Cloud account, the specified region, and the ID of the resource are correct in the API request.
Why do my jobs always fail?
A failed job may be caused by many reasons. You can find the possible cause based on the returned error message. If you receive an error message that indicates a preprocessing failure, the mezzanine file fails to be decoded.
Basic issues
What are transcoding resources?
Transcoding resources are the compute nodes of MPS. One compute node can run a transcoding job at a time. The transcoding resources of MPS are shared by all users. The quota for the shared transcoding resources is specified for each user. The maximum number of jobs that you want MPS to process at a time cannot exceed this quota. If the system is busy, the number of jobs that can be processed by MPS at a time may be less than the quota for the shared transcoding resources.
What is a preset transcoding template?
A preset transcoding template is a built-in template. This template contains various settings that you want to enable for a transcoding job. The settings include the format, resolution, and codec of the output file. MPS automatically analyzes the features of the input video and recommends a proper preset transcoding template so that the transcoded video can be played on different terminals at various network bandwidths. When you create a transcoding job, you can specify a recommended preset transcoding template based on your business requirements. If you specify a preset transcoding template that is not recommended by MPS, an error is returned when you submit the transcoding job. For more information, see Preset template details.
What do I do if the recommended preset transcoding templates do not meet my business requirements?
You can create a custom transcoding template. For more information about how to create custom transcoding templates, see Transcoding templates.
How do I upload my media files to Object Storage Service (OSS)?
You can upload files in the MPS console or the OSS console. For more information, see Upload a video.
What is the maximum size of a file that MPS can process?
MPS supports an input file that is up to 100 GB in size. If you want to process a media file whose size is larger than 100 GB, you can submit a ticket .
Can Alibaba Cloud CDN be used to deliver media files?
Yes, we recommend that you use Alibaba Cloud CDN to deliver your media files. You can use the OSS bucket that stores transcoding output files as the origin server. This helps reduce the latency for users to obtain media files, improve the response speed, and resolve the issues such as limited network bandwidth with a large number of requests and unevenly distributed nodes. For more information, visit the product page of Alibaba Cloud CDN. For more information, see Configure a domain name for CDN.
How long does a transcoding job take?
The transcoding speed is affected by various factors, such as the length, resolution, and bitrate of the input file and the configurations of the transcoding template. In most cases, the amount of time consumed by a transcoding job is 0.5 to 2 times the length of the input file. If a large number of transcoding jobs are submitted, the jobs are processed in sequence.
Can I query the progress of a transcoding job in real time?
No, you cannot query the progress of a transcoding job in real time because no such API operation is available. You can query the transcoding percentage and estimate the progress of a transcoding job.
0%: indicates that the transcoding job is being prepared. For example, the video file is being downloaded or analyzed.
20%: indicates that the transcoding job starts. Wait until the job is complete.
100%: indicates that the transcoding job is complete.
Does a transcoding job generate only one output file for each input file? Can a transcoding job generate multiple output files?
Yes, each transcoding job generates an output file for an input file based on a transcoding template. When you call the SubmitJobs operation, you can specify multiple output files. MPS creates a transcoding job for each output file.
How many jobs can MPS process at the same time?
By default, each user has a quota for transcoding resources. The transcoding resources are allocated to MPS queues that are independent of each other. The maximum number of jobs processed by a single MPS queue at the same time cannot exceed the quota allocated to the MPS queue. For more information, see Limits.
What are transcoding resources?
Transcoding resources are the compute nodes of MPS. One compute node can run a transcoding job at a time. The transcoding resources of MPS are shared by all users. The quota for the shared transcoding resources is specified for each user. The maximum number of jobs that you want MPS to process at a time cannot exceed this quota. If the system is busy, the number of jobs that can be processed by MPS at a time may be less than the quota for the shared transcoding resources.
What is a preset transcoding template?
A preset transcoding template is a built-in template. This template contains various settings that you want to enable for a transcoding job. The settings include the format, resolution, and codec of the output file. MPS automatically analyzes the features of the input video and recommends a proper preset transcoding template so that the transcoded video can be played on different terminals at various network bandwidths. When you create a transcoding job, you can specify a recommended preset transcoding template based on your business requirements. If you specify a preset transcoding template that is not recommended by MPS, an error is returned when you submit the transcoding job. For more information, see Preset template details.
What do I do if the recommended preset transcoding templates do not meet my business requirements?
You can create a custom transcoding template. For more information about how to create custom transcoding templates, see Transcoding templates.
Does MPS provide exclusive transcoders?
No, MPS does not provide custom or exclusive transcoders.
Does MPS support real-time encoding?
No, MPS provides the transcoding service for input files and does not support real-time transcoding.
Which regions does MPS support?
For more information about supported regions, see Regions and endpoints.
Why does the "Only one topic can be created" error occur?
Each user is allowed to enable one MPS queue of each type in MPS. If you enable more than one MPS queue of the same type, the "Only one topic can be created" error message is returned. For more information about how to enable an MPS queue or add a type of MPS queue, see Create an MPS queue.
What is the meaning of the Profile parameter in the AliyunAudioCodec data type for a transcoding template?
The Profile parameter specifies the codec profile of an audio file. The following five codec profiles are supported:
aac_low
aac_he
aac_he_v2
aac_ld
aac_eld
Supported formats
What input formats are supported by MPS?
Container formats
3GP, AVI, FLV, MP4, M3U8, MPG, ASF, WMV, MKV, MOV, TS, and WebM
Video encoding formats
H.264/AVC, H.263, H.263+, MPEG-1, MPEG-2, MPEG-4, MJPEG, VP8, VP9, Quicktime, RealVideo, and Windows Media Video
Audio encoding formats
AAC, AC-3, ADPCM, AMR, DSD, MP1, MP2, MP3, PCM, RealAudio, and Windows Media Audio
What output formats are supported by MPS?
We recommend that you specify FLV output files for PCs, MP4 output files for Android devices, and M3U8 output files for iOS devices. The default video encoding format is H.264/AVC, and the default audio encoding format is AAC.
Where can I obtain a complete list of supported formats?
For more information about all supported formats, see Supported formats.
Does MPS support the play-and-cache feature for MP4 files?
Yes. MPS positions the moov box at the beginning of an MP4 file. In this case, the video is cached to your on-premises machine when the video is being played. You do not need to wait for the download to complete.
Does MPS support stereo and surround audio?
Yes. The audio data of transcoded files generated by MPS is in the binaural AAC or MP3 format.
Security issues
Are media files secure in MPS?
All media resources are stored in the OSS buckets that you specify. You can grant permissions to RAM users so that they can access the specified file in the OSS bucket from MPS.
Does MPS support encrypted input files?
No, MPS does not support encrypted input files.