我正在使用azure media service
存储我的资源,例如视频。现在我想trim
视频到头一分钟。假设视频为5 minute
,那么我想将其修剪为first 1 minute
。我尝试使用以下代码
{
"Version": 1.0,
"Sources": [
{
"StartTime": "00:00:04",
"Duration": "00:00:16"
}
],
"Codecs": [
{
"KeyFrameInterval": "00:00:02",
"SceneChangeDetection": true,
"H264Layers": [
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 4500,
"MaxBitrate": 4500,
"BufferWindow": "00:00:05",
"Width": 1280,
"Height": 720,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
}
],
"Type": "H264Video"
},
{
"Profile": "AACLC",
"Channels": 2,
"SamplingRate": 48000,
"Bitrate": 128,
"Type": "AACAudio"
}
],
"Outputs": [
{
"FileName": "{Basename}_{Width}x{Height}_{VideoBitrate}.mp4",
"Format": {
"Type": "MP4Format"
}
}
]
}
我的问题是,有没有办法在不指定视频codecs
的情况下修剪视频,因为我只是想修剪视频而不想编码。比如使用这段代码
{
"Version": "1.0",
"Sources": [
{
"StartTime": "00:00:00",
"Duration": "00:01:00"
}
],
"Outputs": [
{
"FileName": "$filename$.mp4",
"Format": {
"Type": "MP4Format"
}
}
]
}
答案 0 :(得分:1)
我认为你想要一个输出MP4来下载/交付离线。
如果满足以下条件:
然后,您应该能够使用以下预设JSON,告诉编码器复制输入视频和音频:
{
"Version": "1.0",
"Sources": [
{
"StartTime": "00:00:00",
"Duration": "00:01:00"
}
],
"Outputs": [
{
"FileName": "$filename$.mp4",
"Format": {
"Type": "MP4Format"
}
}
],
"Codecs": [
{
"Type": "CopyVideo"
},
{
"Type": "CopyAudio"
}
]
}