如果源视频小于目标,是否有内置的方法来防止AME从配置文件中编码输出大小,或者是否需要有一组预设,每个预设都具有最大res,然后我查询媒体我自己确定要使用哪个预设?
这是我到目前为止,并希望包含1080版本,但不希望720或更低的源文件生成1080大小:
{
"KeyFrameInterval": "00:00:02",
"H264Layers": [
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 2250,
"MaxBitrate": 3400,
"BufferWindow": "00:00:05",
"Width": 1280,
"Height": 720,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
},
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 1500,
"MaxBitrate": 2250,
"BufferWindow": "00:00:05",
"Width": 960,
"Height": 540,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
},
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 650,
"MaxBitrate": 1000,
"BufferWindow": "00:00:05",
"Width": 640,
"Height": 360,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
}
],
"Type": "H264Video"
},
最佳答案 您是否查看过使用Media Encoder Premium Workflow编码器和Azure Media Services工作流设计器(
https://azure.microsoft.com/en-us/documentation/articles/media-services-workflow-designer/)的教程.
有一个工作流程示例检测输入分辨率 – https://github.com/Azure/azure-media-services-samples/tree/master/Encoding%20Presets/VoD/MediaEncoderPremiumWorkfows.(H264 Progressive Download MP4 SD).从示例描述中的一个“如果源是SD(图像宽度小于640),则输出的帧大小保持不变.否则,如果源是HD(图像宽度是640或更大),则设置输出帧大小至640×360(16:9来源)或640×480(4:3来源).“
您需要请求工作流设计器工具并在需要时更改描述的逻辑 – 很难手动构建这些工作流文件.
如果您只想使用Media Encoder Standard,则需要使用sdk构建输入检测逻辑,并根据输入分辨率调度或跳过编码.