How to set resoutlion for AWS media convert - amazon-web-services

I was planning on using aws mediaconvert to make multiple different copies of videos with different resolution via aws sdk and I noticed in the example that the Resolution was not included, so I how would I be able to specify it (tell it to do 1920 by 1080 for example)?
"Outputs" => [
[
"VideoDescription" => [
??? "Resolution" => "DEFAULT", ???
"ScalingBehavior" => "DEFAULT",
"TimecodeInsertion" => "DISABLED",
"AntiAlias" => "ENABLED",
"Sharpness" => 50,
"CodecSettings" => [
"Codec" => "H_264",
"H264Settings" => [
...

Not tested, but if you look at the job request json it has "width" and "height" parameters. These will be in the "VideoDescription" object. You can try and see if that works:
"VideoDescription": {
"ScalingBehavior": "DEFAULT",
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"NumberReferenceFrames": 3,
"Bitrate": 5000000
...
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT",
"Width": 1920,
"Height": 1080
}

Related

Set segment duration with media convert

With AWS media convert everytime I convert an mp4 (6 second video) to a dash, the segment duration is about 30 seconds however I'd much appreciate if it were 1 second or less:
<SegmentTemplate timescale="90000" duration="324000" startNumber="1"/>
<Representation id="1" width="1280" height="720" bandwidth="72000000" codecs="avc1.4d4032">
<SegmentTemplate media="5f8283b60a3ac3640191892_$Number%09d$.mp4" initialization="5f8283b60a3ac3640191892init.mp4" duration="324000" startNumber="1"/>
</Representation>
<Representation id="2" width="1920" height="1080" bandwidth="16200000" codecs="avc1.4d4029">
<SegmentTemplate media="5f8283b60a3ac3640191891_$Number%09d$.mp4" initialization="5f8283b60a3ac3640191891init.mp4" duration="324000" startNumber="1"/>
</Representation>
</AdaptationSet>
I've tried messing with the job settings, but nothing I did seemed to work. Sometimes I got it down to 10 seconds, but that still isn't great, anyway here are the settings I used:
$jobSetting = [
"OutputGroups"=> [
[
"CustomName"=> "nicenice",
"Name"=> "DASH ISO",
"Outputs"=> [
[
"ContainerSettings"=> [
"Container"=> "MPD"
],
"VideoDescription"=> [
"Width"=> 1920,
"ScalingBehavior"=> "DEFAULT",
"Height"=> 1080,
"TimecodeInsertion"=> "DISABLED",
"AntiAlias"=> "ENABLED",
"Sharpness"=> 50,
"CodecSettings"=> [
"Codec"=> "H_264",
"H264Settings"=> [
"InterlaceMode"=> "PROGRESSIVE",
"NumberReferenceFrames"=> 3,
"Syntax"=> "DEFAULT",
"Softness"=> 0,
"GopClosedCadence"=> 1,
"GopSize"=> 60,
"Slices"=> 1,
"GopBReference"=> "DISABLED",
"SlowPal"=> "DISABLED",
"SpatialAdaptiveQuantization"=> "ENABLED",
"TemporalAdaptiveQuantization"=> "ENABLED",
"FlickerAdaptiveQuantization"=> "DISABLED",
"EntropyEncoding"=> "CABAC",
"Bitrate"=> 16200000,
"FramerateControl"=> "INITIALIZE_FROM_SOURCE",
"RateControlMode"=> "CBR",
"CodecProfile"=> "MAIN",
"Telecine"=> "NONE",
"MinIInterval"=> 0,
"AdaptiveQuantization"=> "HIGH",
"CodecLevel"=> "AUTO",
"FieldEncoding"=> "PAFF",
"SceneChangeDetect"=> "ENABLED",
"QualityTuningLevel"=> "SINGLE_PASS",
"FramerateConversionAlgorithm"=> "DUPLICATE_DROP",
"UnregisteredSeiTimecode"=> "DISABLED",
"GopSizeUnits"=> "FRAMES",
"ParControl"=> "INITIALIZE_FROM_SOURCE",
"NumberBFramesBetweenReferenceFrames"=> 2,
"RepeatPps"=> "DISABLED",
"DynamicSubGop"=> "STATIC"
]
],
"AfdSignaling"=> "NONE",
"DropFrameTimecode"=> "ENABLED",
"RespondToAfd"=> "NONE",
"ColorMetadata"=> "INSERT"
],
"NameModifier"=> "1"
],
[
"ContainerSettings"=> [
"Container"=> "MPD"
],
"VideoDescription"=> [
"Width"=> 1280,
"ScalingBehavior"=> "DEFAULT",
"Height"=> 720,
"TimecodeInsertion"=> "DISABLED",
"AntiAlias"=> "ENABLED",
"Sharpness"=> 50,
"CodecSettings"=> [
"Codec"=> "H_264",
"H264Settings"=> [
"InterlaceMode"=> "PROGRESSIVE",
"NumberReferenceFrames"=> 3,
"Syntax"=> "DEFAULT",
"Softness"=> 0,
"GopClosedCadence"=> 1,
"GopSize"=> 60,
"Slices"=> 1,
"GopBReference"=> "DISABLED",
"SlowPal"=> "DISABLED",
"SpatialAdaptiveQuantization"=> "ENABLED",
"TemporalAdaptiveQuantization"=> "ENABLED",
"FlickerAdaptiveQuantization"=> "DISABLED",
"EntropyEncoding"=> "CABAC",
"Bitrate"=> 7200000,
"FramerateControl"=> "INITIALIZE_FROM_SOURCE",
"RateControlMode"=> "CBR",
"CodecProfile"=> "MAIN",
"Telecine"=> "NONE",
"MinIInterval"=> 0,
"AdaptiveQuantization"=> "HIGH",
"CodecLevel"=> "AUTO",
"FieldEncoding"=> "PAFF",
"SceneChangeDetect"=> "ENABLED",
"QualityTuningLevel"=> "SINGLE_PASS",
"FramerateConversionAlgorithm"=> "DUPLICATE_DROP",
"UnregisteredSeiTimecode"=> "DISABLED",
"GopSizeUnits"=> "FRAMES",
"ParControl"=> "INITIALIZE_FROM_SOURCE",
"NumberBFramesBetweenReferenceFrames"=> 2,
"RepeatPps"=> "DISABLED",
"DynamicSubGop"=> "STATIC"
]
],
"AfdSignaling"=> "NONE",
"DropFrameTimecode"=> "ENABLED",
"RespondToAfd"=> "NONE",
"ColorMetadata"=> "INSERT"
],
"NameModifier"=> "2"
],
[
"ContainerSettings"=> [
"Container"=> "MPD"
],
"AudioDescriptions"=> [
[
"AudioTypeControl"=> "FOLLOW_INPUT",
"AudioSourceName"=> "Audio Selector 1",
"CodecSettings"=> [
"Codec"=> "AAC",
"AacSettings"=> [
"AudioDescriptionBroadcasterMix"=> "NORMAL",
"Bitrate"=> 96000,
"RateControlMode"=> "CBR",
"CodecProfile"=> "LC",
"CodingMode"=> "CODING_MODE_2_0",
"RawFormat"=> "NONE",
"SampleRate"=> 48000,
"Specification"=> "MPEG4"
]
],
"LanguageCodeControl"=> "FOLLOW_INPUT"
]
],
"NameModifier"=> "3"
]
],
"OutputGroupSettings"=> [
"Type"=> "DASH_ISO_GROUP_SETTINGS",
"DashIsoGroupSettings"=> [
"SegmentLength"=> 1,
"Destination"=> "s3://cactustestphp/videouploads/".$link . "/".$link,
"FragmentLength"=> 2,
"SegmentControl"=> "SEGMENTED_FILES",
"MpdProfile"=> "MAIN_PROFILE",
"HbbtvCompliance"=> "NONE"
]
]
]
],
"AdAvailOffset"=> 0,
"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://cactustestphp/videouploads/test/". $fileid
]
]
];
Json:
{
"Queue": "!!",
"UserMetadata": {
"Customer": "Amazon"
},
"Role": "!!",
"Settings": {
"OutputGroups": [
{
"CustomName": "nicenice",
"Name": "DASH ISO",
"Outputs": [
{
"ContainerSettings": {
"Container": "MPD"
},
"VideoDescription": {
"Width": 3840,
"ScalingBehavior": "DEFAULT",
"Height": 2160,
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"FramerateDenominator": 1,
"GopClosedCadence": 1,
"GopSize": 30,
"Slices": 1,
"GopBReference": "DISABLED",
"SlowPal": "DISABLED",
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "DISABLED",
"EntropyEncoding": "CABAC",
"Bitrate": 66200000,
"FramerateControl": "SPECIFIED",
"RateControlMode": "CBR",
"CodecProfile": "MAIN",
"Telecine": "NONE",
"FramerateNumerator": 30,
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "AUTO",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "SINGLE_PASS",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "FRAMES",
"ParControl": "INITIALIZE_FROM_SOURCE",
"NumberBFramesBetweenReferenceFrames": 2,
"RepeatPps": "DISABLED",
"DynamicSubGop": "STATIC"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"NameModifier": "1"
},
{
"ContainerSettings": {
"Container": "MPD"
},
"VideoDescription": {
"Width": 1920,
"ScalingBehavior": "DEFAULT",
"Height": 1080,
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"FramerateDenominator": 1,
"GopClosedCadence": 1,
"GopSize": 30,
"Slices": 1,
"GopBReference": "DISABLED",
"SlowPal": "DISABLED",
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "DISABLED",
"EntropyEncoding": "CABAC",
"Bitrate": 16200000,
"FramerateControl": "SPECIFIED",
"RateControlMode": "CBR",
"CodecProfile": "MAIN",
"Telecine": "NONE",
"FramerateNumerator": 30,
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "AUTO",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "SINGLE_PASS",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "FRAMES",
"ParControl": "INITIALIZE_FROM_SOURCE",
"NumberBFramesBetweenReferenceFrames": 2,
"RepeatPps": "DISABLED",
"DynamicSubGop": "STATIC"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"NameModifier": "2"
},
{
"ContainerSettings": {
"Container": "MPD"
},
"VideoDescription": {
"Width": 1280,
"ScalingBehavior": "DEFAULT",
"Height": 720,
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"FramerateDenominator": 1,
"GopClosedCadence": 1,
"GopSize": 30,
"Slices": 1,
"GopBReference": "DISABLED",
"SlowPal": "DISABLED",
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "DISABLED",
"EntropyEncoding": "CABAC",
"Bitrate": 5200000,
"FramerateControl": "SPECIFIED",
"RateControlMode": "CBR",
"CodecProfile": "MAIN",
"Telecine": "NONE",
"FramerateNumerator": 30,
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "AUTO",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "SINGLE_PASS",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "FRAMES",
"ParControl": "INITIALIZE_FROM_SOURCE",
"NumberBFramesBetweenReferenceFrames": 2,
"RepeatPps": "DISABLED",
"DynamicSubGop": "STATIC"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"NameModifier": "3"
},
{
"ContainerSettings": {
"Container": "MPD"
},
"VideoDescription": {
"Width": 640,
"ScalingBehavior": "DEFAULT",
"Height": 360,
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"FramerateDenominator": 1,
"GopClosedCadence": 1,
"GopSize": 30,
"Slices": 1,
"GopBReference": "DISABLED",
"SlowPal": "DISABLED",
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "DISABLED",
"EntropyEncoding": "CABAC",
"Bitrate": 1200000,
"FramerateControl": "SPECIFIED",
"RateControlMode": "CBR",
"CodecProfile": "MAIN",
"Telecine": "NONE",
"FramerateNumerator": 30,
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "AUTO",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "SINGLE_PASS",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "FRAMES",
"ParControl": "INITIALIZE_FROM_SOURCE",
"NumberBFramesBetweenReferenceFrames": 2,
"RepeatPps": "DISABLED",
"DynamicSubGop": "STATIC"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"NameModifier": "4"
},
{
"ContainerSettings": {
"Container": "MPD"
},
"VideoDescription": {
"Width": 256,
"ScalingBehavior": "DEFAULT",
"Height": 144,
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"FramerateDenominator": 1,
"GopClosedCadence": 1,
"GopSize": 30,
"Slices": 1,
"GopBReference": "DISABLED",
"SlowPal": "DISABLED",
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "DISABLED",
"EntropyEncoding": "CABAC",
"Bitrate": 200000,
"FramerateControl": "SPECIFIED",
"RateControlMode": "CBR",
"CodecProfile": "MAIN",
"Telecine": "NONE",
"FramerateNumerator": 30,
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "AUTO",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "SINGLE_PASS",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "FRAMES",
"ParControl": "INITIALIZE_FROM_SOURCE",
"NumberBFramesBetweenReferenceFrames": 2,
"RepeatPps": "DISABLED",
"DynamicSubGop": "STATIC"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"NameModifier": "5"
},
{
"ContainerSettings": {
"Container": "MPD"
},
"AudioDescriptions": [
{
"AudioTypeControl": "FOLLOW_INPUT",
"AudioSourceName": "Audio Selector 1",
"CodecSettings": {
"Codec": "AAC",
"AacSettings": {
"AudioDescriptionBroadcasterMix": "NORMAL",
"Bitrate": 96000,
"RateControlMode": "CBR",
"CodecProfile": "LC",
"CodingMode": "CODING_MODE_2_0",
"RawFormat": "NONE",
"SampleRate": 48000,
"Specification": "MPEG4"
}
},
"LanguageCodeControl": "FOLLOW_INPUT"
}
],
"NameModifier": "6"
}
],
"OutputGroupSettings": {
"Type": "DASH_ISO_GROUP_SETTINGS",
"DashIsoGroupSettings": {
"SegmentLength": 1,
"Destination": "!!/videouploads/5fa1ababa7cea975176544/5fa1ababa7cea975176544",
"FragmentLength": 1,
"SegmentControl": "SEGMENTED_FILES",
"MpdProfile": "MAIN_PROFILE",
"HbbtvCompliance": "NONE"
}
}
}
],
"AdAvailOffset": 0,
"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",
"TimecodeSource": "ZEROBASED",
"FileInput": "!!/videouploads/test/5fa1ababa7cea975176544.mp4"
}
]
},
"AccelerationSettings": {
"Mode": "DISABLED"
},
"StatusUpdateInterval": "SECONDS_60",
"Priority": 0
}
So, in other words, what would I have to change to make my segment duration set to 1 second or less?
Thank you for providing the job's JSON settings for further review. Looking at the OutputGroupSettings I can see that you are specifying a SegmentLength value of 1 second so the resulting fragmented MP4 files should be about 1 second in length give or take a few frames.
How are you confirming that the resulting fMP4 files are 30 and 10 seconds respectively? The most accurate way of determining this information is to combine a variant's init MP4 with one of the fragments into a separate file and observe it using a media inspector like Mediainfo or ffprobe. I used your job settings on an MP4 file I had available to me and confirmed that the resulting MP4 segments produces are 1 second in length:
Concatenate a segment with its init file for the full MP4 asset
$ cat 5fa1ababa7cea9751765441init.mp4 >> 5fa1ababa7cea9751765441_concat.mp4 && cat 5fa1ababa7cea9751765441_000000001.mp4 >> 5fa1ababa7cea9751765441_concat.mp4
Probe the newly concatenated file to review the details
$ ffprobe -hide_banner -i 5fa1ababa7cea9751765441_concat.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '5fa1ababa7cea9751765441_concat.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1dash
creation_time : 2020-11-20T20:30:59.000000Z
Duration: 00:00:01.03, start: 0.066667, bitrate: 7658 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 3840x2160 [SAR 1:1 DAR 16:9], 7648 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
Metadata:
creation_time : 2020-11-20T20:30:59.000000Z
handler_name : ETI ISO Video Media Handler
encoder : Elemental H.264
I'm curious how you are confirming the resulting duration of each fMP4 asset and if you can try the above steps as well if you have not already done so.

AWS Elemental MediaConvert: mov file is not supported

I wanna overlay a movie (.mov) on top of another movie (.mp4), using AWS Elemental MediaConvert.
I uploaded one .mov file and one .mp4 to S3, both have similar dimensions.
In AWS Elemental MediaConvert, I created a job:
Input: .mp4 file
Motion image inserter: .mov file
Output file will be an mp4 file
Result: the job is failed, error message:
MGILoaderMOV [s3://test/overlay.mov] file contains unsupported pixel format.
The .mov file is working fine because I can play it from my laptop, IAM includes Full access to your Amazon S3 resources.
Any suggestion is appreciated
***** More detail *****
#Tiziano Coroneo, I got a new overlay.mov (converted from FFmpeg, dimension (450x450)). I set up the output as below:
Preprocessors: Input cropping rectangle X(100), Y(100), Width(450), Height(450)
The job is executed successfully, but the output doesn't include the overlay.
{
"Queue": "arn:aws:mediaconvert:yyyyyyy:xxxxxxxx:queues/Default",
"UserMetadata": {},
"Role": "arn:aws:iam::xxxxxxxxxxxxx:role/my_media_role",
"Settings": {
"OutputGroups": [
{
"Name": "File Group",
"Outputs": [
{
"ContainerSettings": {
"Container": "MP4",
"Mp4Settings": {
"CslgAtom": "INCLUDE",
"FreeSpaceBox": "EXCLUDE",
"MoovPlacement": "PROGRESSIVE_DOWNLOAD"
}
},
"VideoDescription": {
"ScalingBehavior": "DEFAULT",
"Crop": {
"Height": 450,
"Width": 450,
"X": 100,
"Y": 100
},
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"GopClosedCadence": 1,
"GopSize": 90,
"Slices": 1,
"GopBReference": "DISABLED",
"SlowPal": "DISABLED",
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "DISABLED",
"EntropyEncoding": "CABAC",
"Bitrate": 1000000,
"FramerateControl": "INITIALIZE_FROM_SOURCE",
"RateControlMode": "CBR",
"CodecProfile": "MAIN",
"Telecine": "NONE",
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "AUTO",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "SINGLE_PASS",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "FRAMES",
"ParControl": "INITIALIZE_FROM_SOURCE",
"NumberBFramesBetweenReferenceFrames": 2,
"RepeatPps": "DISABLED",
"DynamicSubGop": "STATIC"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"Extension": ".mp4",
"NameModifier": "overlay_video"
}
],
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": "s3://XXXXXXX/files/"
}
}
}
],
"AdAvailOffset": 0,
"MotionImageInserter": {
"InsertionMode": "MOV",
"Input": "s3://XXXXXXX/converted_overlay.mov",
"Offset": {
"ImageX": 0,
"ImageY": 0
},
"Playback": "ONCE"
},
"Inputs": [
{
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"TimecodeSource": "EMBEDDED",
"FileInput": "s3://XXXXXXX/sample_video.mp4"
}
]
},
"StatusUpdateInterval": "SECONDS_60"
}
After some trial and error, I found out that there is a requirement for the motion graphic overlay file to be in pixel format argb.
The error message here tells you that you mov file has a different pixel format. If you have ffmpeg installed on your machine, you can run the following command to convert your file to the right format:
ffmpeg -i your_input_file.mov -sn -dn -an -vcodec qtrle -pix_fmt argb -f mov your_output_file.mov
-i is to specify the input file,
-sn removes any subtitle track
-dn removes any data track
-an removes any audio track
-vcodec qtrle sets "Quicktime Animation" as the codec
-pix_fmt argb sets argb as the pixel data format
-f mov sets mov as the output file container type.
Good luck!

Is there a minimum confidence for celebrity detection in microsoft cognitive services api?

All the confidences I've seen for celebrity detection has been very high. Is there some minimum confidence threshold for which the API will not consider a celebrity present?
The API will return an empty or null "celebrities" JSON array if it doesn't recognize a celebrity and will only return a populated "celebrities" JSON array if the "confidence" level is above 0.
Here's an examples running 2 pictures of Michael Jackson through the celebrities and landmarks section in the Computer Vision API page:
Michael Jackson is recognized and a populated "celebrities" JSON array is returned
{
"categories": [
{
"name": "people_portrait",
"score": 0.62109375,
"detail": {
"celebrities": [
{
"name": "Michael Jackson",
"faceRectangle": {
"left": 377,
"top": 282,
"width": 381,
"height": 381
},
"confidence": 0.99902832508087158
}
],
"landmarks": null
}
}
],
"adult": null,
"tags": [
{
"name": "person",
"confidence": 0.99581664800643921
}
],
"description": {
"tags": [
"person",
"man",
"young",
"standing",
"looking",
"front",
"holding",
"wearing",
"shirt",
"posing",
"boy",
"white",
"smiling",
"dark",
"black",
"table",
"large",
"suit",
"woman",
"board"
],
"captions": [
{
"text": "Michael Jackson posing for the camera",
"confidence": 0.91584373926593021
}
]
},
"requestId": "ac41aa84-9a70-4ffc-8de4-5a662600fc56",
"metadata": {
"width": 1000,
"height": 1000,
"format": "Jpeg"
},
"faces": [
{
"age": 31,
"gender": "Male",
"faceRectangle": {
"left": 377,
"top": 282,
"width": 381,
"height": 381
}
}
],
"color": {
"dominantColorForeground": "White",
"dominantColorBackground": "Black",
"dominantColors": [
"Black",
"White"
],
"accentColor": "B64215",
"isBWImg": false
},
"imageType": {
"clipArtType": 0,
"lineDrawingType": 0
}
}
Michael Jackson is not recognized and an empty "celebrities" JSON array is returned
{
"categories": [
{
"name": "people_",
"score": 0.94140625,
"detail": {
"celebrities": [],
"landmarks": null
}
}
],
"adult": null,
"tags": [
{
"name": "person",
"confidence": 0.99912232160568237
},
{
"name": "outdoor",
"confidence": 0.936089813709259
}
],
"description": {
"tags": [
"person",
"outdoor",
"man",
"woman",
"standing",
"front",
"suit",
"holding",
"car",
"wearing",
"people",
"couple",
"posing",
"young",
"bus",
"black",
"smiling",
"glasses",
"umbrella",
"group",
"table",
"city",
"red",
"water",
"street",
"phone",
"boat",
"train"
],
"captions": [
{
"text": "a couple of people posing for the camera",
"confidence": 0.86922603629725859
}
]
},
"requestId": "7d57493c-f8b0-468f-8135-17da555d2463",
"metadata": {
"width": 1000,
"height": 1000,
"format": "Jpeg"
},
"faces": [
{
"age": 38,
"gender": "Female",
"faceRectangle": {
"left": 400,
"top": 270,
"width": 234,
"height": 234
}
}
],
"color": {
"dominantColorForeground": "Black",
"dominantColorBackground": "Black",
"dominantColors": [
"Black",
"Grey"
],
"accentColor": "364E5D",
"isBWImg": false
},
"imageType": {
"clipArtType": 0,
"lineDrawingType": 0
}
}

AWS cloudfront cli not creating web distribution for custom origin with compress parameter

I was looking to create AWS cloudfront web distribution using CLI, everything was working fine until I tried to add "Compress": True to the distribution's JSON.
Following is my configuration
{
"CallerReference": "string",
"Aliases": {
"Items": [
"test.example.com"
],
"Quantity": 1
},
"DefaultRootObject": "",
"Origins": {
"Items": [
{
"OriginPath": "",
"CustomOriginConfig": {
"OriginProtocolPolicy": "match-viewer",
"HTTPPort": 80,
"HTTPSPort": 443
},
"Id": "Custom-example.com",
"DomainName": "example.com"
}
],
"Quantity": 1
},
"DefaultCacheBehavior": {
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"TargetOriginId": "Custom-example.com",
"ViewerProtocolPolicy": "allow-all",
"ForwardedValues": {
"Headers": {
"Quantity": 0
},
"Cookies": {
"Forward": "none"
},
"QueryString": false
},
"MaxTTL": 31536000,
"Compress": true,
"SmoothStreaming": false,
"DefaultTTL": 86400,
"AllowedMethods": {
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Items": [
"HEAD",
"GET"
],
"Quantity": 2
},
"Quantity": 2
},
"MinTTL": 0
},
"CacheBehaviors": {
"Quantity": 2,
"Items": [ {
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"TargetOriginId": "Custom-example.com",
"ViewerProtocolPolicy": "allow-all",
"ForwardedValues": {
"Headers": {
"Quantity": 0
},
"Cookies": {
"Forward": "none"
},
"QueryString": false
},
"MaxTTL": 31536000,
"Compress": true,
"PathPattern": "*.jpeg",
"SmoothStreaming": false,
"DefaultTTL": 86400,
"AllowedMethods": {
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Items": [
"HEAD",
"GET"
],
"Quantity": 2
},
"Quantity": 2
},
"MinTTL": 60
}
,
{
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"TargetOriginId": "Custom-example.com",
"ViewerProtocolPolicy": "allow-all",
"ForwardedValues": {
"Headers": {
"Quantity": 0
},
"Cookies": {
"Forward": "none"
},
"QueryString": false
},
"MaxTTL": 31536000,
"Compress": true,
"PathPattern": "*.png",
"SmoothStreaming": false,
"DefaultTTL": 86400,
"AllowedMethods": {
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Items": [
"HEAD",
"GET"
],
"Quantity": 2
},
"Quantity": 2
},
"MinTTL": 100
}
]
},
"CustomErrorResponses": {
"Quantity": 0
},
"Comment": "my distro",
"Logging": {
"Bucket": "",
"Prefix": "",
"Enabled": false,
"IncludeCookies": false
},
"PriceClass": "PriceClass_100",
"Enabled": true,
"ViewerCertificate": {
"CloudFrontDefaultCertificate": true,
"MinimumProtocolVersion": "SSLv3"
},
"Restrictions": {
"GeoRestriction": {
"Items": [
"IN",
"GB",
"IR"
],
"RestrictionType": "whitelist",
"Quantity": 3
}
},
"WebACLId": ""
}
This is the error I get
If I remove the compress parameter It works fine.
Parameter validation failed:
Unknown parameter in DistributionConfig.DefaultCacheBehavior: "Compress", must be one of: TargetOriginId, ForwardedValues, TrustedSigners, ViewerProtocolPolicy, MinTTL, AllowedMethods, SmoothStreaming, DefaultTTL, MaxTTL
Unknown parameter in DistributionConfig.CacheBehaviors.Items[0]: "Compress", must be one of: PathPattern, TargetOriginId, ForwardedValues, TrustedSigners, ViewerProtocolPolicy, MinTTL, AllowedMethods, SmoothStreaming, DefaultTTL, MaxTTL
Unknown parameter in DistributionConfig.CacheBehaviors.Items[1]: "Compress", must be one of: PathPattern, TargetOriginId, ForwardedValues, TrustedSigners, ViewerProtocolPolicy, MinTTL, AllowedMethods, SmoothStreaming, DefaultTTL, MaxTTL
After raising a ticket with AWS I got to know that my cloudfront distribution JSON is absolutely fine, the thing which was giving the headache was the CLI version
I was using AWS CLI version 1.9.12 while compress supports only with CLI version >= 1.9.14

how to apply conditions on JSON response in Jmeter?

Response is as follows,
I have to extract all 'deviceResponseStatus.id' where status="PENDING"
how to implement it using JSON Path or REGEX in Jmeter?
{
"apiResponseStatus": "SUCCESS",
"deviceResponseList": [
{
"apiResponseStatus": "SUCCESS",
"id": 23,
"ownership": "CORPORATE",
"deviceName": "Demimbu",
"deviceType": "MOBILE",
"osType": "ANDROID",
"inTotalStorage": 0,
"inAvailableStorage": 0,
"exTotalStorage": 0,
"exAvailableStorage": 0,
"osVersion": "4.2",
"buildVersion": "1.01.08",
"status": "PENDING",
"isDeleted": false,
"policyIdNames": {
"id": 3,
"name": "Test Policy 3"
},
"deviceGroupIdNames": {
"id": 1,
"name": "Default Group"
},
"userIdName": {
"id": 1,
"name": "Randy Lewis"
},
"lastConnected": 1423810405000,
"createdByIdName": {
"id": 1,
"name": "Randy Lewis"
},
"locked": false,
"traceOn": false,
"userEmail": "mdm.user1#gmail.com",
"enrollmentDate": 1423790255000,
"simNumbers": [
"1236547896"
],
"imeiCodes": [],
"mobileNumbers": [
"4558585858858"
],
"createDate": 1421927250000,
"lastModified": 1423810406000,
"rooted": false,
"roaming": false,
"compliant": false
},
{
"apiResponseStatus": "SUCCESS",
"id": 24,
"ownership": "CORPORATE",
"deviceName": "Photobean",
"deviceType": "MOBILE",
"osType": "ANDROID",
"inTotalStorage": 20941258752,
"inAvailableStorage": 8024924160,
"exTotalStorage": 0,
"exAvailableStorage": 0,
"bluetoothMacAddress": "8C:3A:E3:BE:C2:04",
"wirelessMacAddress": "8c:3a:e3:51:bb:e3",
"model": "LG-D686",
"osVersion": "4.4.2",
"buildVersion": "1.01.09",
"status": "PENDING",
"isDeleted": false,
"policyIdNames": {
"id": 3,
"name": "Test Policy 3"
},
"deviceGroupIdNames": {
"id": 1,
"name": "Default Group"
},
"userIdName": {
"id": 1,
"name": "Randy Lewis"
},
"make": "LGE",
"lastConnected": 1423648831000,
"createdByIdName": {
"id": 1,
"name": "Randy Lewis"
},
"locked": false,
"traceOn": false,
"userEmail": "mdm.user1#gmail.com",
"enrollmentDate": 1423628675000,
"simNumbers": [
"404909008623970"
],
"imeiCodes": [
"359004053152889",
"359004053152871"
],
"mobileNumbers": [
"638847339387"
],
"createDate": 1422435029000,
"lastModified": 1423648831000,
"rooted": true,
"roaming": false,
"compliant": false
},
{
"apiResponseStatus": "SUCCESS",
"id": 25,
"ownership": "CORPORATE",
"deviceName": "Livetube",
"deviceType": "MOBILE",
"osType": "ANDROID",
"inTotalStorage": 0,
"inAvailableStorage": 0,
"exTotalStorage": 0,
"exAvailableStorage": 0,
"osVersion": "4.2",
"buildVersion": "1.01.08",
"status": "APPROVAL_PENDING",
"isDeleted": false,
"policyIdNames": {
"id": 3,
"name": "Test Policy 3"
},
"deviceGroupIdNames": {
"id": 1,
"name": "Default Group"
},
"userIdName": {
"id": 1,
"name": "Randy Lewis"
},
"lastConnected": 1423810522000,
"createdByIdName": {
"id": 1,
"name": "Randy Lewis"
},
"locked": false,
"traceOn": false,
"userEmail": "mdm.user1#gmail.com",
"enrollmentDate": 1423790371000,
"simNumbers": [
"1236547896"
],
"imeiCodes": [],
"mobileNumbers": [
"4558585858858"
],
"createDate": 1422435030000,
"lastModified": 1423810522000,
"rooted": false,
"roaming": false,
"compliant": false
},
{
"apiResponseStatus": "SUCCESS",
"id": 26,
"ownership": "CORPORATE",
"deviceName": "Riffwire",
"deviceType": "MOBILE",
"osType": "IOS",
"inTotalStorage": 0,
"inAvailableStorage": 0,
"exTotalStorage": 0,
"exAvailableStorage": 0,
"status": "PENDING",
"isDeleted": false,
"policyIdNames": {
"id": 3,
"name": "Test Policy 3"
},
"deviceGroupIdNames": {
"id": 1,
"name": "Default Group"
},
"userIdName": {
"id": 1,
"name": "Randy Lewis"
},
"createdByIdName": {
"id": 1,
"name": "Randy Lewis"
},
"locked": false,
"traceOn": false,
"userEmail": "mdm.user1#gmail.com",
"simNumbers": [],
"imeiCodes": [],
"mobileNumbers": [],
"createDate": 1422435030000,
"lastModified": 1423216312000,
"rooted": false,
"roaming": false,
"compliant": false
},
Also, Please suggest any good option if any.
You question is JMeter specific, but i believe it's actually regular Json Path expression. For example, in SoapUI it could be done with
$.deviceResponseList[?(#.status=='PENDING')].id
Probably this could help in some way
JMeter provides JSON Path Extractor via JMeter Plugins Extras With Libs Set
I believe that this is the best way to accomplish your goal.
See Using the XPath Extractor in JMeter guide (scroll down to "Parsing JSON" chapter) for the plugin installation instructions and some sample JSON Path queries.