This topic provides answers to some frequently asked questions (FAQ) about using workflows in ApsaraVideo Media Processing (MPS).
How do I upload files?
You can upload files in the MPS console or by using the graphical management tool provided by Object Storage Service (OSS). Multipart upload, resumable upload, and batch upload are supported. For more information, see Upload a video.
Is transcoding automatically triggered after audio or video files are uploaded?
A workflow is automatically triggered if a file with a specific file name extension is uploaded.
When you create a workflow, you must specify the input path. If an audio or video file with a specific file name extension is uploaded to the path, MPS automatically triggers the workflow and performs the operations specified in the workflow on the input file.
Supported file name extensions:
Video
.3gp, .asf, .avi, .dat, .dv, .flv, .f4v, .gif, .m2t, .m3u8, .m4v, .mj2, .mjpeg, .mkv, .mov, .mp4, .mpe, .mpg, .mpeg, .mts, .ogg, .qt, .rm, .rmvb, .swf, .vob, .wmv, and .webm
Audio
.aac, .ac3, .acm, .amr, .ape, .caf, .flac, .m4a, .mp3, .ra, .wav, .wma, and .aiff
Workflow triggering rule:
If the path of an input file is under the input path that you specified for the workflow in MPS, the input file can trigger the workflow. Example:
If the input path that you specified for Workflow A is the AA/BB directory in Bucket A, both the AA/BB/a.mp4 and AA/BB/CC/b.flv files that are uploaded to Bucket A can trigger Workflow A. A disabled workflow cannot be automatically triggered.
Can transcoding be triggered after a video is uploaded to the input path of a workflow by using the OSS tool?
Yes, transcoding can be triggered after a video is uploaded to the input path of a workflow by using the OSS tool. Transcoding can be automatically triggered after a file is uploaded to the input path specified for the workflow. You can upload files in the MPS console, by calling API operations, or by using the OSS tool. However, if the workflow is disabled, transcoding cannot be automatically triggered.
Why cannot a video be found in the media library after the video is uploaded?
Only videos that are transcoded by using workflows are displayed in the media library. Videos that are transcoded by calling API operations are not displayed in the media library.
Check whether the video is uploaded. If the ID of the corresponding transcoding job is not found in the transcoding management of OSS objects, check whether the video is successfully uploaded to the input path specified for the workflow.
Check whether a video with the same name is uploaded. If you upload a video with the same name as an existing video in the media library, no media files are generated. You can search for the media file based on the video name in the media library.
What operations are supported by workflows?
Workflows support multiple operations, including snapshot, transcoding, template analysis, and publish management.
How do I name the output file of a transcoding node in a workflow?
Workflows allow you to process multiple files at a time in an efficient manner. You need to name the output files of workflows. You can use the following variables provided by MPS to name the output files:
{RunId}: the ID of the workflow execution instance.
{ObjectPrefix}: the original file path that does not include the bucket information.
{FileName}: the original file name that contains the file name extension. The file name extension varies based on the format of the transcoding template.
{ExtName}: the file name extension of the original file.
For example, if the input file is named http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/news/video/foooo****.mp4
, the following variables are related to the input file:
The value of the {ObjectPrefix} variable is news/video/.
The value of the {FileName} variable is foooo.
The value of the {ExtName} variable is .mp4.
You can set the name of the output file to vod/{ObjectPrefix}{FileName}_HD.flv
. In this case, the output file transcoded based on the input file is named vod/news/video/foooo_HD.flv
.
In addition, a specific variable is provided by the snapshot node:
{SnapshotTime}: the snapshot time. Unit: milliseconds.
What messaging models are supported by workflows?
Workflows support the queue-based and topic-based messaging models of Simple Message Queue (formerly MNS). You can configure the notification feature for the input node of a workflow. Then, MPS can send notifications to the specified queue or topic when the workflow starts and ends.
How do I obtain the URL of the output file generated after a video is transcoded?
On the media library page of the console, find the video that you want to view and go to the details page of the video. On the details page, you can view the OSS URL and Alibaba Cloud CDN (CDN)-accelerated domain name that is displayed if CDN is configured for the OSS bucket. You can also use SDKs to obtain the URLs of output files.
Are the notifications about jobs in a workflow sent to the SMQ queue or topic associated with the MPS queue for transcoding?
No, the notifications about jobs in a workflow are not sent to the SMQ queue or topic associated with the MPS queue for transcoding.
Why am I unable to preview a video in the console by using the CDN-accelerated domain name?
A CNAME record may not be added for the CDN-accelerated domain name. You can run the following command to query the CNAME record of your domain name:
nslookup -type=cname [your domain name]
For more information, see Configure a domain name for CDN.
Why am I unable to preview a M3U8 file generated after transcoding in the console?
The access control list (ACL) of the output bucket
must be set to public-read.
Alibaba Cloud Flash player is used in the console. In this case, you must add the crossdomain.xml file that contains the domain name of the player to the root directory of the bucket in which the M3U8 file is stored. Otherwise, the M3U8 file cannot be previewed.
To preview your M3U8 file in the console, add the crossdomain.xml file that contains the following content to the root directory of the bucket in which the M3U8 file is stored:
<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">
<allow-access-from domain="*.example.com"/>
</cross-domain-policy>
*.example.com
specifies the domain name of the player used in the console. If you use other Flash players, you must set *.example.com to the domain name of the used player.