首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何连接AWS弹性转换器?

问如何连接AWS弹性转换器?
EN

Stack Overflow用户
提问于 2013-07-30 17:07:02
回答 2查看 2.4K关注 0票数 2

我正在尝试对一些视频进行转码,但是我连接的方式有问题。

这是我的密码:

代码语言:javascript
复制
transcode = layer1.ElasticTranscoderConnection()
transcode.DefaultRegionEndpoint = 'elastictranscoder.us-west-2.amazonaws.com'
transcode.DefaultRegionName = 'us-west-2'
transcode.create_job(pipelineId, transInput, transOutput)

这是一个例外:

代码语言:javascript
复制
{u'message': u'The specified pipeline was not found: account=xxxxxx, pipelineId=xxxxxx.'}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-07-30 20:07:59

要连接到boto中的特定区域,可以使用:

代码语言:javascript
复制
import boto.elastictranscoder
transcode = boto.elastictranscoder.connect_to_region('us-west-2')
transcode.create_job(...)
票数 5
EN

Stack Overflow用户

发布于 2013-10-09 18:57:25

前几天我才开始使用boto,但是前面的答案对我没有用--我不知道API是否改变了,或者什么(如果是这样的话,看起来有点奇怪,但无论如何)。我就是这么做的。

代码语言:javascript
复制
#!/usr/bin/env python

# Boto
import boto

# Debug
boto.set_stream_logger('boto')

# Pipeline Id
pipeline_id = 'lotsofcharacters-393824'

# The input object
input_object = {
    'Key': 'foo.webm',
    'Container': 'webm',
    'AspectRatio': 'auto',
    'FrameRate': 'auto',
    'Resolution': 'auto',
    'Interlaced': 'auto'
}

# The object (or objects) that will be created by the transcoding job;
# note that this is a list of dictionaries.
output_objects = [
    {
        'Key': 'bar.mp4',
        'PresetId': '1351620000001-000010',
        'Rotate': 'auto',
        'ThumbnailPattern': '',
    }
]

# Phone home
# - Har har.
et = boto.connect_elastictranscoder()

# Create the job
# - If successful, this will execute immediately.
et.create_job(pipeline_id, input_name=input_object, outputs=output_objects)

显然,这是一个精心设计的示例,它只是从一个独立的python脚本中运行;它假设您在某个地方有一个带有凭据的.boto文件。

另外要注意的是PresetId;您可以在预置下的AWS弹性转换编码器管理控制台中找到这些信息。最后,可以填充在字典中的值从下面的链接逐字删除--据我所知,它们只是插入到REST调用中(显然区分大小写)。

AWS创建作业API

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17953163

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档