0

我想使用 Amazon 的 Elastic Transcoder 自动修剪 Django 中的视频文件。到目前为止的代码是:

def trim_video(key, new_key, duration):

    pipeline_id = 'XXXXXXXXXXXX-XXXXXX'
    region = 'XXXXXXXX'

    transcoder_client = boto.elastictranscoder.connect_to_region(region)

    create_job_result=transcoder_client.create_job(**{
            'pipeline_id': pipeline_id,
            'input_name': {'Key': key},
            'output': {
                    'Key': new_key,
                    "PresetId": 'XXXXXXXXXXXXX-XXXXXX'
            }
        })
    print('Job has been created. The output key will be ' + new_key)

此代码将导致文件被转码但不会修剪它。我要添加什么来修剪视频?

4

0 回答 0