You need to enable JavaScript to run this app.
Volcano Engine Function as a Service

Volcano Engine Function as a Service

Copy page
Download PDF
Audio and video processing
Deploying an FFmpeg video frame extraction application with a few clicks
Copy page
Download PDF
Deploying an FFmpeg video frame extraction application with a few clicks
This topic describes how to deploy an FFmpeg video frame extraction application with a few clicks via the veFaaS application center.​
Background information​
  • Application introduction​
  • FFmpeg is open-source software for processing audio and video, widely used in scenarios such as audio or video transcoding, video editing, and video effect creation. This application template comes with the built-in FFmpeg tool, helping you quickly deploy a video frame extraction application. After deployment, you can send frame extraction requests via the API Gateway to capture screenshots of the video at specified time points.​
  • Runtime​
  • Golang runtime​
  • Associated cloud services​
  • veFaaS: Uses FFmpeg to perform video frame extractions.​
  • API Gateway: Sends video frame capture requests via the API Gateway.​
Prerequisites​
  • All the cloud services associated with the application have been activated.​
  • The VeFaaSFullAccess, APIGFullAccess, and STSAssumeRoleAccess policies have been attached to Identity and Access Management (IAM) users. If one of the preceding policies is not attached, contact the root user or the administrator for authorization. For specific operations, refer to [Creating a user and granting permissions.​
  • API Gateway prerequisites:​
  • The current application supports selecting an existing API Gateway instance or automatically creating a new one.​
  • Select an existing API Gateway instance: Please prepare the gateway instance in advance. Note that the instance must be deployed in the same region as the application. For detailed operations, see Creating instances.​
  • Automatically create an API Gateway instance: Please prepare the VPC and subnet information in advance. Note that the VPC must be in the same region as the application. For detailed operations, see Creating VPCs.​
  • If you use veFaaS for the first time, make sure that the cross-service authorization is complete. If the authorization is not complete, the cross-service authorization page will appear, which provides guidance on authorization.​
Procedure​
  1. Log in to the veFaaS console.​
  1. In the top navigation bar, select the target region.​
  1. In the left navigation bar, click App.​
  1. On the My app page, click Create app.​
  1. On the Create app page, select the volcano-ffmpeg template and click Create.​
  1. On the Create App page, specify the following information as required.​
  • Basic information​
  • ​
    Parameter​
    Description​
    Selected template​
    Displays the selected template. The volcano-ffmpeg is used in this scenario.​
    Name​
    Specify a custom name for the application.​
    Description​
    Enter the description of the application. This parameter can be left empty.​
    IAM role​
    The Application Center provides the system default role ServerlessApplicationRole, which is granted permissions on some cloud resources that the Application Center needs to access.​
    • If your user roles do not contain this role, this role will be automatically added.​
    • If your user roles contain this role, the system will automatically detect whether all the policies required for the application are attached to this role. If a required policy is not attached, the console will display the name of the policy. You can click Add policy to add the policy.​
    warning​
    • Make sure that the IAMReadOnlyAccess policy is attached to IAM users. Otherwise, they will not be authorized to obtain information about the ServerlessApplicationRole role.​
    • If IAM users need to attach policies to the ServerlessApplicationRole role, make sure that the IAMFullAccess policy is attached to the IAM users.​
    Associated cloud services​
    Displays the names, activation status, and activation purposes of all the cloud services that the current application needs to use.​
    ​
  • Advanced settings​
  • ​
    Parameter​
    Description​
    Region​
    The region where the application and its associated cloud resources are located.​
    Function name​
    Specify a custom name for the function.​
    API Gateway Instance​
    Set the API Gateway instance to be used. The resources related to the API Gateway trigger, including services, Upstream, and routes, will be automatically created for this API Gateway instance.​
    • Select an existing API Gateway instance: You can select an existing API Gateway instance.​
    • Automatically create an API Gateway instance: Enter the instance name and select a VPC, a subnet ID in availability zone A, and a subnet ID in availability zone B. The application will automatically create a Serverless gateway instance in this VPC.​
    warning​
    The automatically created API Gateway instance is a Serverless gateway. Only one Serverless gateway instance can be created per region. If a Serverless gateway instance already exists in this region, select it directly.​
    ​
  • ​
  1. Click Confirm to create and deploy the application. The system will automatically redirect to the application details page and display the application deployment logs in real time.​
Result validation​
This section describes how to send a video frame extraction request to obtain a video screenshot at a specified time.​
  1. Prepare the URL of the video file in advance. For example, upload the video file to Volcano Engine TOS and set its read permission to public. The video file used in this example is: https://volcengine-vefaas-demo-resource.tos-cn-beijing.volces.com/moment-120sec.mp4.​
  1. Open a local terminal and run the following command to extract the frame at 10 seconds from the video and save it locally as/tmp/image.jpeg.​
  • ​
    # Replace the https://api_gateway_address with your API Gateway address​
    # The Source refers to the video source address prepared in advance​
    # TimeInSeconds is the time point for capturing the screenshot, in seconds​
    curl -X POST 'https://api_gateway_address/snapshot' -d '{"Source": "https://volcengine-vefaas-demo-resource.tos-cn-beijing.volces.com/moment-120sec.mp4","TimeInSeconds": 10}' > /tmp/image.jpeg​
    ​
    # The following response indicates successful execution​
    % Total % Received % Xferd Average Speed Time Time Time Current​
    Dload Upload Total Spent Left Speed​
    100 71136 0 71019 100 117 24537 40 0:00:02 0:00:02 --:--:-- 24572​
    ​
  1. Open the local file /tmp/image.jpeg to view the video screenshot obtained in Step 2.​
​
Last updated: 2026.08.19 14:06:07