As the largest part of traffic in information dissemination, audio and video are very important in all industries, and the processing logic of audio and video in different business scenarios may be specific to the industry. Although public cloud provides a large number of video processing services for users to choose from, it still cannot fully cover users' requirements for special processes and customization. Using the workflow processing of Cloud Object Storage (COS) combined with the customization logic of Serverless Cloud Function (SCF) is an excellent choice to help users quickly create a variety of audio and video processing businesses to meet their needs.
Log in to the COS console, create a workflow, customize a filter rule, and create a custom function node.
In the function node pop-up window, click Add Function.
On the function creation page, select the COS data workflow audio/video transcoding template.
Based on the user's file size, configure the execution timeout duration in the basic settings and configure sufficient memory in the advanced settings.
Choose Advanced Settings > Environment Configuration and configure environment variables. The function template supports the following environment variables:
${InputPath}${InputName}_transcode.${ext}.
${ffmpeg} -loglevel error -i ${source} -r 10 -b:a 32k ${target}.
/tmp.
Enable permission configuration and bind a role that has the read/write permission of the current bucket. If you need to create an execution role, see Role and Authorization.
Click Finish.
Go back to the previous workflow page, select the custom transcoding function created just now, and save the workflow. Start the workflow on the workflow list page.
Upload the file. After the workflow processing is successful, you can see that the uploaded video is successfully transcoded and is saved as a new file.
Was this page helpful?