Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Media Processing Center/ Best Practices/ Snapshot Capturing Facilitates the Setup of Media Processing Platform for Your Video Website

Snapshot Capturing Facilitates the Setup of Media Processing Platform for Your Video Website

Updated on 2023-12-19 GMT+08:00

Scenarios

Video websites have diverse requirements on video snapshots, including video thumbnails, drag and view, review, posters, and still images. MPC supports synchronous and asynchronous snapshot capturing, as well as snapshot capturing at a specified time point and at a fixed interval, allowing you to quickly set up a media processing platform for your video website. For example, during video playback, you can hover the pointer over the progress bar and drag it to go to the specified position on the preview image.

How It Works

When setting up a media processing platform for your video website, you need to create a snapshot capturing task management service. This service manages operations such as creating and querying snapshot capturing tasks.

The video website snapshot capturing task management service calls the video snapshot capturing capability of MPC through SDKs/APIs. The snapshot capturing task management service obtains the source video from Object Storage Service (OBS). After a snapshot of the source video is captured as required, the snapshot file will be saved in a specified OBS path. The associated service of the video website can obtain the snapshot file information from the snapshot capturing task management service, and apply the snapshot to scenarios such as video thumbnails, drag and view during video playback, and review.

Table 1 Service functions

Service Name

Function

Video website snapshot capturing task management service

Manages video snapshot capturing tasks, including task creation and query.

MPC video snapshot capturing service

Pulls the source video from OBS, takes a snapshot of the source video as required, and saves the snapshot file in a specified OBS path.

OBS

Used by customers to upload and store media files

Figure 1 Working principle

Development Sequence Diagram

Figure 2 Creating a snapshot capturing task
Figure 3 Deleting a snapshot capturing task
Figure 4 Querying snapshot capturing tasks

Procedure

  1. Upload a video file to an OBS bucket.
  2. Create a snapshot capturing task.

    Sample code:

        // Set the input video path.
        ObsObjInfo input = new ObsObjInfo().withBucket("<example-bucket>").withLocation("<Region ID>").withObject("<example-path/input.mp4>");
        ObsObjInfo output = new ObsObjInfo().withBucket("<example-bucket>").withLocation("<Region ID>").withObject("<example-path/output>");
    
        // Create a snapshot capturing request.
        CreateThumbnailsTaskRequest request = new CreateThumbnailsTaskRequest();
        CreateThumbReq body = new CreateThumbReq();
        List<Integer> listThumbnailParaDots = new ArrayList<>();
        listThumbnailParaDots.add(50000);
        // Set the snapshot capturing type. Snapshots are captured at a specified time point.
        ThumbnailPara thumbnailParabody = new ThumbnailPara();
        // Set the sampling type. Snapshots are captured at a specified time point.
        thumbnailParabody.withType(ThumbnailPara.TypeEnum.fromValue("DOTS"))
            // Set the snapshot file name.
            .withOutputFilename("photo")
            // Set the interval for snapshot capturing.
            .withTime(10)
            // Set the start time when the sampling type is set to TIME. This parameter is used together with time.
            .withStartTime(100)
            // Set the capture duration (in second) when the sampling type is set to TIME. This parameter is used together with time and start_time, indicating that the first snapshot is captured at the time specified by start_time and a snapshot is captured at the interval specified by time until the duration specified by this parameter elapses.
            .withDuration(1)
            // Array of time points when a snapshot is captured.
            .withDots(listThumbnailParaDots)
            // Set the snapshot file format.
            .withFormat(1)
            // Set the width of a snapshot.
            .withWidth(96)
            // Set the height of a snapshot.
            .withHeight(96);
    
        body.withThumbnailPara(thumbnailParabody);
        body.withOutput(output);
        body.withInput(input);
        request.withBody(body);
    
        // Send the snapshot capturing request.
        CreateThumbnailsTaskResponse response = initMpcClient().createThumbnailsTask(request);
        logger.info(response.toString());        return response.getTaskId();

  3. Query snapshot capturing tasks.

    Sample code:

        ListThumbnailsTaskRequest request = new ListThumbnailsTaskRequest();
        List<String> listRequestTaskId = new ArrayList<>();
        listRequestTaskId.add(taskId);
        request.withTaskId(listRequestTaskId);
        ListThumbnailsTaskResponse response = initMpcClient().listThumbnailsTask(request);
        logger.info(response.toString());

  4. Check execution results.

    The ID of the created snapshot capturing task is returned.

    {"task_id": "1024"}

    Query the statuses and results of snapshot capturing tasks.

    {
      "task_array" : [
        {
        "task_id" : 2528,
        "status" : "SUCCEEDED",
        "create_time" : 20201118121333,
        "end_time" : 20201118121336,
        "input" : {
          "bucket" : "example-bucket",
          "location" : "region01",
          "object" : "example-input.ts"
        },
        "output" : {
          "bucket" : "example-bucket",
          "location" : "region01",
          "object" : "example-output/example-path"
        },
        "thumbnail_info" : [ {
          "pic_name" : "9.jpg"
        }, {
          "pic_name" : "5.jpg"
        } ]
      } 
      ],
      "is_truncated" : 0,
      "total" : 1
    }

SDK Integration Example

For details about the video snapshot capturing feature and its sample code, see Creating a Snapshot Capturing Task.

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback