In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use API to import 10,000 hours of video, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.
prerequisite
Get the project ID of the task area where you need to create a screenshot (Get Project ID).
Clarify the information of the area where the screenshot task needs to be created, and obtain the Endpoint of the area (obtained by the area and terminal node).
Call the OBS Create Bucket API to create an OBS bucket for storing screenshot files, and then call the OBS Upload Object API to store video files to be captured in the OBS bucket.
operation steps
Step 1: Get the user token. When used for MPC interface, authentication is performed.
Get username, password, domainname and projectname on the My Credentials page, and call the following interface to get Token.
POST https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokensContent-Type: application/json{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", //username. "password": "password", //user login password. "domain": { "name": "domainname" //The name of the user's account. } } } }, "scope": { "project": { "name": "projectname" //project name. } } }}
As shown in the figure, the information in the red box is to obtain the user Token.
Step 2: Create Screenshot Task
Send a POST request.
POST:https://{endpoint}/v1/{project_id}/thumbnails
2. Add "X-Auth-Token" to the request message header, and set the value to the acquired user token.
3. The parameters passed into the Request Body are as follows:
{"input": { "bucket": "example-bucket", "location": "region01", "object": "/mpc/input/sample.MP4"},"output": { "bucket": "example-bucket", "location": "region01", "object": "/mpc/output/ "},"tar": 1,"thumbnail_para": { "type":"DOTS", "dots":[2,4,6,8,10], "format":0, "aspect_ratio":1, "max_length":480 } }
4. After the request response is successful, feedback the screenshot task ID.
{ "task_id": "2081"}
Step 3: Query the execution of video screenshots
1. Send a GET request.
GET:https://{endpoint}/v1/{project_id}/thumbnails? task_id=2081
2. Add "X-Auth-Token" to the header of the request message, and set the value to the acquired user Token. After the request is successfully responded, the details of the video screenshot are returned.
After the screenshot is completed, the captured images are transferred to the created OBS bucket, and then the screenshot is reviewed as the image content. OK!
Thank you for reading this article carefully. I hope that the article "How to import 10,000 hours of video using API" shared by Xiaobian will help everyone. At the same time, I hope everyone will support you a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.