El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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/ Live/ Cloud Live/ Stream Push/ Snapshot Capturing

Snapshot Capturing

Updated on 2024-12-06 GMT+08:00

Live captures snapshots from a livestream based on a configured template and stores the captured snapshots in an OBS bucket. Multiple snapshot templates can be configured for an ingest domain name. The template in which App Name is the same as that in the ingest URL takes effect.

Process Flow

Figure 1 shows the process for configuring a snapshot template.

Figure 1 Process for configuring a snapshot template
  1. (Optional) Create an OBS bucket for storing live video snapshots. If you already have one, go to 2.
    NOTE:

    The OBS bucket for storing live video snapshots must be in the same region as the Live service. For example, if you use Live in the CN North-Beijing4 region, then snapshots must be stored in an OBS bucket in the CN North-Beijing4 region.

  2. Authorize access to the OBS bucket so that the system can save the snapshots in the OBS bucket.
  3. Configure a snapshot template to capture snapshots from a video stream at a specified interval and save them as JPG files in an authorized OBS bucket.
  4. View snapshots in the output path.

Notes

  • Live and the OBS bucket for storing snapshots must be in the same region.
  • You are advised to set the OBS bucket as a private bucket. The differences between a private bucket and a public bucket are as follows:
    • Private bucket: You must add authentication information before accessing the bucket and downloading snapshots. For details about the authentication information, see Creating a Signed URL (SDK for Go).
    • Public bucket: You can directly access the bucket and download snapshots.
  • Multiple snapshot templates can be configured for a domain name. The snapshot template in which App Name is same as that in the ingest URL takes effect.
  • Only JPG files can be generated.
  • In the AP-Bangkok region, submit a service ticket for review after configuring a template. The configuration takes effect only after it is approved.
  • Huawei Cloud Live plans to bring offline the function of carrying authentication information in a snapshot callback URL on August 15, 2024.

Prerequisites

Pricing Notes

  • Snapshot capturing is a billing item. You are billed based on the number of snapshots.
  • Snapshots are stored in OBS. OBS charges you for the storage.

Step 1: (Optional) Create an OBS Bucket

If you have not created an OBS bucket, create one in the region of Live. If you already have one, go to Step 2: Authorize Access to the OBS Bucket.

Step 2: Authorize Access to the OBS Bucket

Perform the following steps to authorize Live to store snapshots in your OBS bucket.

CAUTION:

After access to the OBS bucket is authorized, Live can access the OBS bucket. Ensure that the bucket processes only workloads related to Live. Do not store confidential files in the bucket.

  1. Log in to the Live console.
  2. In the navigation pane, choose OBS Authorization.
  3. Under the Live tab, click Authorize in the Operation column of the desired OBS bucket.

    Figure 2 OBS authorization

Step 3: Configure a Snapshot Template

After OBS authorization is successful, you can configure a snapshot template.

  1. Log in to the Live console.
  2. In the navigation pane, choose Domains.
  3. Click Manage in the Operation column of the desired ingest domain name.
  4. In the navigation pane, choose Templates > Snapshot Capturing.
  5. Click Create Snapshot Template.

    Figure 3 Creating a snapshot template

    Table 1 describes the parameters.

    Table 1 Template parameters

    Parameter

    Description

    App Name

    Application name. The default value is live. You can customize the application name. Only letters, digits, underscores (_), and hyphens (-) are allowed.

    Storage Location

    Live snapshots are stored in OBS.

    Storage Bucket

    OBS bucket for storing snapshots

    Storage Path

    OBS bucket path for storing snapshots

    Capturing Frequency

    Snapshot capturing frequency, in second.

    Value range: 5 to 3,600

    Storage Mode

    Snapshot file storage mode.

    • All: A snapshot file name contains the timestamp. All snapshot files of each stream are stored in OBS. Example: snapshot/{domain}/{app_name}/{stream_name}/{UnixTimestamp}.jpg
    • Latest: A snapshot file name does not contain the timestamp. Only the latest snapshot file of each stream will be saved. A new snapshot file overwrites the previous one. Example: snapshot/{domain}/{app_name}/{stream_name}.jpg

    Callback

    Whether to enable callback

    Callback URL

    Enter a callback URL when Callback is enabled. A callback URL cannot contain message headers or parameters. HTTP and HTTPS (recommended) are supported.

    Callback messages in JSON format are sent in POST requests to your server through HTTP APIs. For details about a callback message body, see Callback Message.

    Authentication Key

    Authentication key. Configure this parameter only when callback authentication is required.

    • A key contains 32 to 128 characters.
    • A key can also be automatically generated.

  6. Click OK.

    After a snapshot template is configured, stream push starts. During stream push, snapshots of the livestream are taken based on template settings.

  7. Click Edit in the Operation column to modify template parameters. App Name cannot be modified.

Step 4: View Snapshots

View snapshots in the predefined output path or from a download link in your received callback message.

  • Viewing snapshots on the console
    1. Log in to the Live console.
    2. In the navigation pane, choose Domains.
    3. Click Manage in the Operation column of the desired ingest domain name.
    4. In the navigation pane, choose Templates > Snapshot Capturing.
    5. Click the output path in the Storage Location column to go to the OBS bucket and view snapshot details.
      Figure 4 Viewing snapshot details

      You can download and share the snapshots. For details, see OBS Help Center.

  • Viewing snapshots through a callback message

    If you set a callback URL when configuring a snapshot template, then you will receive a message each time a snapshot is generated. Table 2 describes the fields in a callback message.

    { 
        "domain": "play.example.com",
        "app": "live",
        "stream_name": "test001",
        "snapshot_url": "https://xxx.obs.cn-north-4.myhuaweicloud.com:443...",
        "width":"720",
        "height":"1280",
        "obs_addr": {
            "bucket": "xxx",
            "location": "cn-north-4",
            "object": "xxx.jpg"
        },
       "auth_timestamp":1587954140,
        "auth_sign":"4918b1axxxxxxb583cffa119d72513bbc35a989f8569fxxxxxx057646154a04a"
    }
    Table 2 Message body

    Field

    Description

    domain

    Ingest domain name

    app

    Application name

    stream_name

    Stream name

    snapshot_url

    URL to download snapshots

    width

    Image width

    Unit: pixel

    height

    Image height

    Unit: pixel

    obs_addr

    Address of the OBS bucket where snapshots are stored.
    • bucket: OBS bucket name
    • location: Region where the OBS bucket is located
    • object: OBS object path

    auth_timestamp

    UNIX timestamp when the event notification signature expires. This parameter is carried when an authentication key is configured.

    The value is a decimal UNIX timestamp, that is, the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT).

    Example: 1592639100 (June 20, 2020 15:45)

    auth_sign

    Event notification signature. This parameter is carried when an authentication key is configured.

    auth_sign = HmacSHA256(domain + app + stream_name + snapshot_url + width + height + obs_addr.bucket + obs_addr.location + obs_addr.object + auth_timestamp,key)

    key indicates the key used for authentication.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback