tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary
DocumentationServerless Cloud FunctionUse CasesCOS PracticesImplementing Custom Transcoding with SCF + COS

Implementing Custom Transcoding with SCF + COS

PDF
Focus Mode
Font Size
Last updated: 2024-12-02 16:35:34

Overview

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.


Applications

Fast access to users' self-built transcoding clusters, compatible with their existing businesses
Formats and processing logic for special industries are supported, including movie and media.
Supports custom processing logic, meeting process customization requirements of various scenarios
Workflow for template-based batch processing, meeting common audio and video processing requirements of video websites, education, and social networking industries

Solution Strengths

Accelerated development: Eliminates the need to focus on resource Ops and component overhead, greatly reducing the complexity for constructing service structures.
Reduced overhead: When the platform is idle, no resource is executed. When a function is executed, the service fee is determined by the number of requests and the running time of the computing resource. The price advantage is obvious.
High availability and scalability: The platform automatically adjusts service resources in parallel based on requests, thus implementing near-infinite scalability and eliminating the risk of service interruption inherent in single-availability zone operations.

Directions

1. Log in to the COS console, create a workflow, customize the filter rule, and create a custom function node. For detailed directions, see Configuring Workflow.

2. In the function node pop-up window, click Add Function.
3. On the function creation page, select the template for COSWorkflowFFmpegT....

4. Based on the user's file size, configure the execution timeout duration in the basic settings and configure sufficient memory in the advanced settings.
5. Configure environment variables in Advanced configuration > Environment configuration. The function template supports the following environment variables:
targetBucket: Target bucket. Required.
targetRegion: Region of the target bucket. Required.
targetKeyTemplate: Target path template. Optional. Defaults to ${InputPath}${InputName}_transcode.${ext}.
ffmpegTemplate: Transcoding command template. Required. Example: ${ffmpeg} -loglevel error -i ${source} -r 10 -b:a 32k ${target}.
localTmpPath: Temporary save path. When CFS is bound, you can change the temporary path. Optional. Defaults to /tmp.

6. Enable permission configuration and bind a role that has the read/write permission of the current bucket. To create an execution role, see Role and Authorization.

7. Click Complete.
8. 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.

9. 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.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback