如何设置转码输出文件的持续时间?

How to set duration of the transcoded output file?

在 Amazon Elastic Transcoder 中指定 'duration' 转码输出的正确方法是什么?比如无论输入多长的视频文件,我都希望输出最多3分钟。

我正在使用 node.js lambda 来启动转码器作业。然而,查看 AWS.ElasticTranscoder,无法确定 'duration' 参数。

SegmentDuration 看起来很相似,但似乎只适用于 MPEG

考虑使用作为输入参数一部分的 TimeSpan 地图:

Input: {
    AspectRatio: 'STRING_VALUE',
    Container: 'STRING_VALUE',
    DetectedProperties: {
      DurationMillis: 0,
      FileSize: 0,
      FrameRate: 'STRING_VALUE',
      Height: 0,
      Width: 0
    },
<snip>
    Interlaced: 'STRING_VALUE',
    Key: 'STRING_VALUE',
    Resolution: 'STRING_VALUE',
    TimeSpan: {
      Duration: 'STRING_VALUE',
      StartTime: 'STRING_VALUE'
    }

TimeSpan — (map) Settings for clipping an input. Each input can have different clip settings.

StartTime — (String) The place in the input file where you want a clip to start. The format can be either HH:mm:ss.SSS (maximum value: 23:59:59.999; SSS is thousandths of a second) or sssss.SSS (maximum value: 86399.999). If you don't specify a value, Elastic Transcoder starts at the beginning of the input file.

Duration — (String) The duration of the clip. The format can be either HH:mm:ss.SSS (maximum value: 23:59:59.999; SSS is thousandths of a second) or sssss.SSS (maximum value: 86399.999). If you don't specify a value, Elastic Transcoder creates an output file from StartTime to the end of the file.

If you specify a value longer than the duration of the input file, Elastic Transcoder transcodes the file and returns a warning message.