Video Task Callback Backup to COS

Last updated: 2021-01-22 17:55:10


    This document describes how to use SCF to back up task callbacks generated by MPS to COS. SCF is mainly used to process callback information, MPS is mainly used for video processing tasks, and COS mainly provides persistent storage capabilities.


    Creating function

    1. Log in to the SCF console and select Function Service on the left sidebar.
    2. At the top of the Function Service page, select the Beijing region and click Create to enter the function creation page and configure the following parameters:
      • Function name: enter "MPSToCOS".
      • Runtime environment: select "Python 2.7".
      • Creation method: select Function Template.
      • Fuzzy search: enter "MPS_SCF_COS" and search.


        Click Learn More in the template to view or download relevant information in the Template Details pop-up window.

    3. After configuring the basic information, click Next to enter the function configuration page.
    4. Keep the default function configuration and click Complete.

    Configuring MPS trigger

    1. After completing the Creating function step above, you will be redirected to the function management page by default.
    2. On the left sidebar, select Trigger Management to enter the Trigger Management page.
    3. Click Create a Trigger and add the created MPS trigger in the Create a Trigger pop-up window.
      The main parameter information is as follows. Keep the remaining configuration items as default:
    • Event type: an MPS trigger pushes events in the account-level event type. Currently, two event types are supported: workflow task (WorkflowTask) and video editing task (EditMediaTask).


      • When creating an MPS trigger for the first time, you need to click SCF_QcsRole and MPS_QcsRole to authorize the relevant service role.
      • An MPS trigger uses events generated at the service level as the event source, regardless of attributes such as region and resources. Only one single function can be bound to each event type for each account. If you need multiple functions to handle a task, please see SDK for Node.js.
    1. Click Submit.

    Testing function

    1. Log in to the MPS console and execute a video processing workflow.
    2. On the Function Service page in the SCF console, click the name of the function created in the Creating function step above to enter the function details page.
    3. Select the Log Query tab on the function details page to view the printed log information.
    4. Log in to the COS console to view the data dumping and processing result.


      You can write specific data processing methods as needed.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback