视频内容分析 VCA 接口返回结果异常
暗の守護 发布于2018-06 浏览:4126 回复:1
0
收藏

根据Python SDK文档(https://cloud.baidu.com/doc/VCA/Python-SDK.html#.21.57.EB.BC.54.0D.5F.7B.B2.BD.95.68.6E.2F.C4.27),使用VCA接口分析存储在BOS(Bucket权限已配置好)中的视频文件。

在设置好source,preset,notification项后,使用response = vca_client.put_media(source, preset, notification);提交分析请求无报错。使用response = vca_client.get_media(source);获得分析结果,分析途中无报错。分析结束后,访问response抛出编码错误。求解答,多谢各位。

 

代码及报错如下:

# -*- coding: utf-8 -*-
# 导入VcaClient配置文件
import vca_sample_conf 

# 导入VCA相关模块
from baidubce import exception
from baidubce import bce_client_configuration
from baidubce.auth import bce_credentials
from baidubce.services import vca
from baidubce.services.vca.vca_client import VcaClient
from baidubce.services.bos import bos_client

# 新建VcaClient
vca_client = VcaClient(vca_sample_conf.config)

# 调用VCA接口分析视频
sample_bucket = 'realisking'
sample_object = 'WeChatSight67104.mp4'
source = "bos://{}/{}".format(sample_bucket, sample_object)
preset = ""
notification = ""
try:
    vca_client.put_media(source, preset, notification);
except exception.BceHttpError as e:
    print e.message
    
# 获取VCA接口分析结果
response = vca_client.get_media(source);
response


UnicodeEncodeError: 'ascii' codec can't encode characters in position 13-14: ordinal not in range(128)

收藏
点赞
0
个赞
共1条回复 最后由坦约欠N78bl4Pt回复于2021-05
#2salooloolou回复于2018-08

请问您提到的这个问题,后来解决了吗?

0
快速回复
TOP
切换版块