MediaConvert 将视频分成多个块,但持续时间长度不同
MediaConvert split video into multiple chunk but in different duration length
我有一个时长为 1 小时的视频。
我想按指定范围分块到不同的部分。
例如:
- 0 到 10 分钟
- 10 到 40 分钟
- 40 到 60 分钟
我知道可以通过 ffmpeg 但我想用 MediaConvert.
这是 ffmpeg 的示例,但我想使用 MediaConvert
做同样的事情
ffmpeg -i input.mp4 -c copy -f segment -segment_times 0,600,2400 output%d.mp4
您可以通过在 MediaConvert 中使用输入剪辑来完成此操作。您需要创建多个作业才能获得所需的输入裁剪范围和输出。
在您的作业设置中,输入块将如下所示。
工作 1
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0",
"AlphaBehavior": "DISCARD"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"InputScanType": "AUTO",
"TimecodeSource": "ZEROBASED",
"FileInput": "s3://bucket/media.mp4",
"InputClippings": [
{
"StartTimecode": "00:00:00:00",
"EndTimecode": "00:10:00:00"
}
]
}
]
工作 2
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0",
"AlphaBehavior": "DISCARD"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"InputScanType": "AUTO",
"TimecodeSource": "ZEROBASED",
"FileInput": "s3://bucket/media.mp4",
"InputClippings": [
{
"StartTimecode": "00:10:00:00",
"EndTimecode": "00:40:00:00"
}
]
}
]
工作 3
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0",
"AlphaBehavior": "DISCARD"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"InputScanType": "AUTO",
"TimecodeSource": "ZEROBASED",
"FileInput": "s3://bucket/media.mp4",
"InputClippings": [
{
"StartTimecode": "00:40:00:00",
"EndTimecode": "01:00:00:00"
}
]
}
]
这里需要注意的是剪辑区域基于输入源的时间码。在我的示例中,我将时间码源设置为零基,这意味着服务将从 0 开始时间码并向上移动。您可以选择指定开始时间码或在文件中使用嵌入式时间码。
请注意,时间码需要采用 SMPTE 语法 (HOURS:MINUTES:SECONDS:FRAMES) [2]
== 文档 ==
[1] https://docs.aws.amazon.com/mediaconvert/latest/ug/assembling-multiple-inputs-and-input-clips.html
我有一个时长为 1 小时的视频。
我想按指定范围分块到不同的部分。
例如:
- 0 到 10 分钟
- 10 到 40 分钟
- 40 到 60 分钟
我知道可以通过 ffmpeg 但我想用 MediaConvert.
这是 ffmpeg 的示例,但我想使用 MediaConvert
做同样的事情ffmpeg -i input.mp4 -c copy -f segment -segment_times 0,600,2400 output%d.mp4
您可以通过在 MediaConvert 中使用输入剪辑来完成此操作。您需要创建多个作业才能获得所需的输入裁剪范围和输出。
在您的作业设置中,输入块将如下所示。
工作 1
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0",
"AlphaBehavior": "DISCARD"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"InputScanType": "AUTO",
"TimecodeSource": "ZEROBASED",
"FileInput": "s3://bucket/media.mp4",
"InputClippings": [
{
"StartTimecode": "00:00:00:00",
"EndTimecode": "00:10:00:00"
}
]
}
]
工作 2
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0",
"AlphaBehavior": "DISCARD"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"InputScanType": "AUTO",
"TimecodeSource": "ZEROBASED",
"FileInput": "s3://bucket/media.mp4",
"InputClippings": [
{
"StartTimecode": "00:10:00:00",
"EndTimecode": "00:40:00:00"
}
]
}
]
工作 3
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0",
"AlphaBehavior": "DISCARD"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"InputScanType": "AUTO",
"TimecodeSource": "ZEROBASED",
"FileInput": "s3://bucket/media.mp4",
"InputClippings": [
{
"StartTimecode": "00:40:00:00",
"EndTimecode": "01:00:00:00"
}
]
}
]
这里需要注意的是剪辑区域基于输入源的时间码。在我的示例中,我将时间码源设置为零基,这意味着服务将从 0 开始时间码并向上移动。您可以选择指定开始时间码或在文件中使用嵌入式时间码。
请注意,时间码需要采用 SMPTE 语法 (HOURS:MINUTES:SECONDS:FRAMES) [2]
== 文档 ==
[1] https://docs.aws.amazon.com/mediaconvert/latest/ug/assembling-multiple-inputs-and-input-clips.html