Is there a built in way to prevent AME from encoding an output size from the config file if the source video is smaller than the target, or is it necessary to have a bunch of presets with each one having the maximum res then I query the media file myself to determine which preset to use?
This is what I have so far and want to include a 1080 version but don't want 720 or lower source files to generate a 1080 size:
{
"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"
},
did you look into tutorials of using Media Encoder Premium Workflow encoder with Azure Media Services Workflow Designer ( https://azure.microsoft.com/en-us/documentation/articles/media-services-workflow-designer/).
There is one example of workflow which detects input resolution - https://github.com/Azure/azure-media-services-samples/tree/master/Encoding%20Presets/VoD/MediaEncoderPremiumWorkfows. (H264 Progressive Download MP4 SD). From one of example description "If source is SD (image width is less than 640), then the frame size of the output is left unchanged. Otherwise, if source is HD (image width is 640 or greater), output frame size is set to 640x360 (16:9 sources) or 640x480 (4:3 sources)."
You need to request workflow designer tool and change described logic if needed - its is hard to construct these workflow files manually.
If you want to use only Media Encoder Standard, than you need to use sdk to construct input detection logic on your side and schedule or skip encoding based on input resolution.