《阿里云AI产品必知必会系列电子书》——阿里云视觉智能开放平台——视频理解QuickStart使用教程(3)

简介: 《阿里云AI产品必知必会系列电子书》——阿里云视觉智能开放平台——视频理解QuickStart使用教程(3)

《阿里云AI产品必知必会系列电子书》——阿里云视觉智能开放平台——视频理解QuickStart使用教程(2) https://developer.aliyun.com/article/1232494?groupCode=supportservice



三、通过Python-SDK调用视频理解-检测视频快照


1、pip install


pip install aliyun-python-sdk-videorecog==1.0.4


2、创建DetectVideoShot


from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.auth.credentials import AccessKeyCredential
from aliyunsdkvideorecog.request.v20200320.DetectVideoShotRequest import DetectVideoShotRequest
credentials = AccessKeyCredential('accesskey', 'accesskeysecret')
client = AcsClient(region_id='cn-shanghai', credential=credentials)
request = DetectVideoShotRequest()
request.set_accept_format('json')
request.set_VideoUrl("url")
response = client.do_action_with_exception(request)
print(str(response, encoding='utf-8'))


3、返回异步任务请求ID


{
 "RequestId": "02F***8-DD5C-5538-B605-89***2114A"
}


4、查询异步任务结果


from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.auth.credentials import AccessKeyCredential
from aliyunsdkvideorecog.request.v20200320.GetAsyncJobResultRequest import GetAsyncJobResultRequest
credentials = AccessKeyCredential('accesskey', 'accesskeysecret')
client = AcsClient(region_id='cn-shanghai', credential=credentials)
request = GetAsyncJobResultRequest()
request.set_accept_format('json')
request.set_JobId("02F***8-DD5C-5538-B605-89***2114A")
response = client.do_action_with_exception(request)
print(str(response, encoding='utf-8'))


5、获取异步结果数据返回


{
 "RequestId": "7D***D-C75A-5DC3-946D-0D5F***91",
 "Data": {
 "Status": "PROCESS_SUCCESS",
 "JobId": "02F***8-DD5C-5538-B605-89***2114A",
 "Result": "{\"ShotFrameIds\":[0,108,156,181,222,254,313,358,414,450,483,513,537,576]}"
 }
}


image.png



《阿里云AI产品必知必会系列电子书》——阿里云视觉智能开放平台——视频理解QuickStart使用教程(4) https://developer.aliyun.com/article/1232490?groupCode=supportservice


相关文章
|
30天前
|
关系型数据库 分布式数据库 数据库
成都晨云信息技术完成阿里云PolarDB数据库产品生态集成认证
近日,成都晨云信息技术有限责任公司(以下简称晨云信息)与阿里云PolarDB PostgreSQL版数据库产品展开产品集成认证。测试结果表明,晨云信息旗下晨云-站群管理系统(V1.0)与阿里云以下产品:开源云原生数据库PolarDB PostgreSQL版(V11),完全满足产品兼容认证要求,兼容性良好,系统运行稳定。
|
1月前
|
编解码 对象存储
阿里云视频转码转码模板-配置工作流
阿里云视频转码转码模板-配置工作流
14 0
|
1月前
|
存储 NoSQL 数据库
阿里云数据库Cassandra的产品价格
阿里云数据库Cassandra提供多地域服务,如中国、亚太、欧洲、美洲及中东。计费分为实例主机节点规格费和存储费用,实例价格因节点数和副本数而异,存储费用按挂载云盘计算。生产系统建议配置多节点以确保冗余。公网流量目前免费,具体收费时间未定。详细价格以购买页面为准。
422 3
|
1月前
|
人工智能 监控 Cloud Native
iLogtail 2.0 来了;通义灵码下载量破百万丨阿里云云原生 2 月产品月报
iLogtail 2.0 来了;通义灵码下载量破百万丨阿里云云原生 2 月产品月报
|
1月前
|
API
阿里云微服务引擎及 API 网关 2024 年 2 月产品动态
阿里云微服务引擎及 API 网关 2024 年 2 月产品动态
|
30天前
|
SQL 存储 API
阿里云实时计算Flink的产品化思考与实践【下】
本文整理自阿里云高级产品专家黄鹏程和阿里云技术专家陈婧敏在 FFA 2023 平台建设专场中的分享。
110844 99
阿里云实时计算Flink的产品化思考与实践【下】
|
1天前
电子好书发您分享《阿里云产品手册2024版》
**《阿里云产品手册2024版》电子书分享:** 探索阿里云最新产品与服务,涵盖广泛云解决方案。[阅读/下载](https://developer.aliyun.com/ebook/8326/116556?spm=a2c6h.26392459.ebook-detail.4.7a15272ah4Uw5U)
10 2
|
4天前
|
人工智能 机器人 Linux
超级炫酷的AI绘图工具—MidJourney入门使用教程
超级炫酷的AI绘图工具—MidJourney入门使用教程
|
11天前
|
API
阿里云微服务引擎及 API 网关 2024 年 3 月产品动态
阿里云微服务引擎及 API 网关 2024 年 3 月产品动态。
|
12天前
|
安全 云计算
电子好书发您分享《阿里云产品手册2024版.阿里云产品手册2024版》
**《阿里云产品手册2024版》电子书分享:** 探索阿里云最新技术与服务,涵盖云计算、安全、移动研发等领域,详尽指南助您高效上云。[阅读链接](https://developer.aliyun.com/ebook/8326/116556?spm=a2c6h.26392459.ebook-detail.4.176b272aLerqlg)
27 1

热门文章

最新文章