tencent cloud

Video on Demand

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Product Features
Features
Strengths
Scenarios
Solutions
Professional Edition
Introduction to Video On Demand Professional Edition
Quick Start
Console Guide
Development Guide
Purchase Guide
Billing Overview
Billing Modes
Purchase Guide
Viewing Bills
Renewal
Overdue Policy
Refund Policy
Getting Started
Console Guide
Console Overview
Service Overview
Application Management
Media Management
Package Management
License Management
Real-Time Log Analysis
Practical Tutorial
Media Upload
Smart Cold Storage of VOD Media Asset Files
Video Processing
Distribution and Playback
How to Receive Event Notification
How to Migrate Files from Origin Server to VOD
Live Recording
How to Pull from Custom Origin Servers
How to Use EdgeOne to Distribute Content in VOD
Development Guide
Media Upload
Media Processing
Video AI
Event Notification
Video Playback
Media Encryption and Copyright Protection
Broadcast Channel
CAM
Media File Download
Subapplication System
Error Codes
Player SDK
Overview
Basic Concepts
Features
Free Demo
Free Trial License
Purchase Guide
SDK Download
Licenses
Player Guide
Integration (UI Included)
Integration (No UI)
Advanced Features
API Documentation
Player Adapter
Player SDK Policy
Server APIs
History
Introduction
API Category
Other APIs
Media Processing APIs
Parameter Template APIs
Task Management APIs
Media Upload APIs
Media Management APIs
Event Notification Relevant API
Media Categorization APIs
Domain Name Management APIs
Distribution APIs
AI-based Sample Management APIs
Region Management APIs
Data Statistics APIs
Carousel-Related APIs
Just In Time Transcode APIs
No longer recommended APIs
Making API Requests
AI-based image processing APIs
Task Flow APIs
Data Types
Error Codes
Video on Demand API 2024-07-18
FAQs
Mobile Playback
Fees
Video Upload
Video Publishing
Video Playback
Web Playback
Full Screen Playback
Statistics
Access Management
Cold Storage
Agreements
Service Level Agreement
VOD Policy
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

How to Pull Network Media Files to VOD

PDF
Focus Mode
Font Size
Last updated: 2022-12-16 15:02:33

Overview

Introduction

This document describes how to pull an online video (provided in the form of URL) to VOD.

Fees

The code provided in this document is open-source and free of charge, but it may incur the following fees during use:
Fees for purchasing a Tencent Cloud CVM instance to run the API request script. For more information, please see Instance Billing Modes.
VOD storage space will be taken up by uploaded videos via pulling. For more information, please see Video Storage Pricing.

Limits

The pull from URL feature provided by VOD has the following limits:
The URL should directly point to a video file but cannot be a link to a video website page.
If the URL has a timestamp for hotlink protection, please make sure that the hotlink protection limits (such as the validity period and number of allowed access requests) are favorable; otherwise, the access may fail.
URLs with referer hotlink protection enabled are not supported.
DASH (MPD file type) is unsupported.
If the pull object is an HLS (.m3u8 file type) file, the URIs of media segments (generally in .ts file type) should be relative paths without parameters.

Upload by Pull in Console

Step 1. Activate VOD

Activate the VOD service as instructed in Getting Started - Step 1.

Step 2. Create a pull task

Go to the upload page in the VOD console, select Pull as the upload method, click Add a Row, enter the URL of the video to be pulled (the test URL is used here as an example. Other configuration items are optional, which can be entered as needed), and click Pull Video in the bottom-left corner:



Note:
The time it takes to pull a video is directly proportional to the video file size. We recommend you use a small video (of dozens of megabytes in size) for the test to avoid long wait.

Step 3. View the pull result

After waiting for one or two minutes (subject to the video file size), you can see the pulled video on the Media Assets page.



Note:
If the browser is stuck at the media assets page during the pull process, you need to refresh the page to view the pulled video.

Calling TencentCloud API for Pull

Step 1. Prepare a CVM instance

The TencentCloud API request script needs to be executed on a CVM instance meeting the following requirements:
Region: not limited.
Model: the minimum official configuration (1 CPU core and 1 GB memory) is sufficient.
Public network: a public IP is required, and the bandwidth should be at least 1 Mbps.
Operating system: official public image Ubuntu Server 16.04.1 LTS 64-bit or Ubuntu Server 18.04.1 LTS 64-bit.
For detailed directions on how to purchase a CVM instance and reinstall the system, please see Operation Guide - Creating Instances via CVM Purchase Page and Operation Guide - Reinstalling System, respectively.
Note:
If you do not have a CVM instance satisfying the above conditions, you can also run the script on another Linux (such as CentOS or Debian) or macOS server with public network access, but you need to modify certain commands in the script based on the operating system. Please search for the specific modification method by yourself.

Step 2. Get the API key

Your API key (i.e., SecretId and SecretKey) is required for TencentCloud API request. If you have not created an API key yet, please generate one as instructed in Root Account Access Key. If you have already created a key, please get it as instructed in the same document.

Step 3. Activate VOD

Activate the VOD service as instructed in Getting Started - Step 1.

Step 4. Initiate a pull task

Log in to the CVM instance prepared in step 1 as instructed in Logging into Linux Instance in Standard Login Method and enter and run the following command on the remote terminal:
ubuntu@VM-69-2-ubuntu:~$ export SECRET_ID=AKxxxxxxxxxxxxxxxxxxxxxxx; export SECRET_KEY=xxxxxxxxxxxxxxxxxxxxx;git clone https://github.com/tencentyun/vod-server-demo.git ~/vod-server-demo; bash ~/vod-server-demo/installer/pull_upload_api_en.sh
Note:
Please assign the corresponding values obtained in step 2 to SECRET_ID and SECRET_KEY in the command.
This command will download the demo source code from GitHub and automatically run the installation script. The installation process will take several minutes (subject to the CVM network conditions), during which the remote terminal will print the following information:
[2020-07-15 17:40:13] Start installing pip3.
[2020-07-15 17:40:39] pip3 is successfully installed.
[2020-07-15 17:40:39] Start installing the TencentCloud API SDK for Python.
[2020-07-15 17:40:42] The TencentCloud API SDK for Python is successfully installed.
[2020-07-15 17:40:42] Start configuring API parameters.
[2020-07-15 17:40:42] API parameter configuration is completed.
Run the pull_upload.py script to initiate upload:
ubuntu@VM-69-2-ubuntu:~$ cd ~/vod-server-demo/pull_upload_api/; python3 pull_upload.py http://example.com/ff439affvodcq1400329073/e968a7e55285890804162014755/LKk92603oW0A.mp4 API-PullUpload
Note:
Please replace the URL in the command with the actual address of the video to be pulled.
This command will initiate a PullUpload request to the specified URL and print the response similar to the following:
{"TaskId": "1400329073-PullUpload-4ea60158fc6f8e611bbfa750eb1fd0a9t0", "RequestId": "4e821b4a-9a29-409f-99cb-b703fa184e50"}

Step 5. View the pull result

After waiting for one or two minutes (subject to the video file size), you can see the pulled video on the Media Assets page.



Note:
If the browser is stuck at the media assets page during the pull process, you need to refresh the page to view the pulled video.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback