tencent cloud

User Generated Short Video SDK

뉴스 및 공지사항
Release Notes
The “startPlay” API of the UGSV SDK Renamed
제품소개
Overview
Features
Use Cases
Concepts
구매 가이드
Pricing Overview
Refund Policy
라이선스 가이드
Adding and Renewing a License
Configuring and Viewing a License
SDK 다운로드
SDK Download
Release Notes (App)
UI 통합 솔루션 포함
UGSV Demo App
Source Code Description (iOS)
Source Code Description (Android)
UI 통합 솔루션 없음
SDK Integration
Capturing and Shoot
Preview, Clipping, and Splicing
Upload and Playback
Tencent Effect SDK
Advanced Features and Special Effects
API 문서
Editing
Shooting
기술적 지원
Error Codes
Feature FAQs
일반적인 문제
Upload
Android Compilation
Android
iOS
License
UGSV 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약

Signature Distribution

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-11-12 11:47:01
Video upload from client refers to uploading local videos to the VOD platform by an end user of the application. For more information, please see Guide. This document describes how to generate a signature for upload from client.

Overview

The overall process for upload from client is as follows:



To support upload from client, you need to build two backend services: signature distribution service and event notification receipt service.
1. The client first requests an upload signature from the signature distribution service.
2. The signature distribution service verifies whether the client user has the upload permission. If the verification passes, a signature will be generated and distributed; otherwise, an error code will be returned, and the upload process will end.
3. After receiving the signature, the client will use the upload feature integrated in the UGSV SDK to upload the video.
4. After the upload is completed, the VOD backend will send an upload completion event notification to your event notification receipt service.
5. If the signature distribution service specifies a video processing task flow in the signature, the VOD service will automatically process the video accordingly after the video is uploaded. Video processing in UGSV scenarios is generally AI-based porn detection.
6. After the video is processed, the VOD backend will send a task flow status change event notification to your event notification receipt service.
At this point, the entire video upload and processing flow ends.

Signature Generation

For more information on the signature for upload from client, please see Signature for Upload from Client.

Signature Distribution Service Implementation Sample

/**
* Calculate a signature
*/
function createFileUploadSignature({ timeStamp = 86400, procedure = '', classId = 0, oneTimeValid = 0, sourceContext = '' }) {
// Determine the current time and expiration time of the signature
let current = parseInt((new Date()).getTime() / 1000)
let expired = current + timeStamp; // Signature validity period: 1 day
// Enter the parameters into the parameter list
let arg_list = {
//required
secretId: this.conf.SecretId,
currentTimeStamp: current,
expireTime: expired,
random: Math.round(Math.random() * Math.pow(2, 32)),
//opts
procedure,
classId,
oneTimeValid,
sourceContext
}
// Calculate the signature
let orignal = querystring.stringify(arg_list);
let orignal_buffer = new Buffer(orignal, "utf8");
let hmac = crypto.createHmac("sha1", this.conf.SecretKey);
let hmac_buffer = hmac.update(orignal_buffer).digest();
let signature = Buffer.concat([hmac_buffer, orignal_buffer]).toString("base64");
return signature;
}
/**
* Respond to a signature request
*/
function getUploadSignature(req, res) {
res.json({
code: 0,
message: 'ok',
data: {
signature: gVodHelper.createFileUploadSignature({})
}
});
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백