Skip to content
v2.273.0

VideoEncodeProps Struct ​

Properties for a video encode configuration.

Example ​

ts
declare const stack: Stack;
declare const input: medialive.IInput;
declare const bucket: s3.IBucket;

const video = medialive.EncodeConfiguration.video({
  name: 'video_720p',
  codec: medialive.VideoCodecSettings.h264({
    rateControl: medialive.H264RateControl.cbr({ bitrate: Bitrate.mbps(3) }),
    framerate: medialive.Framerate.FPS_30,
  }),
  width: 1280,
  height: 720,
});

const audio = medialive.EncodeConfiguration.audio({
  name: 'audio_aac',
  codec: medialive.AudioCodecSettings.aac({ bitrate: Bitrate.kbps(192) }),
});

new medialive.Channel(stack, 'Channel', {
  inputs: [{ input }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video, audio], outputName: 'hls_out' }],
    }),
  ],
});

Properties ​

The codec for the video encode.

Choose the codec explicitly (e.g. VideoCodecSettings.h264(...))

heightnumberheightint | floatheightNumberHeightdoubleHeight*float64required#
The height of the output video in pixels.

Must be an even number.

namestringnamestrnameStringNamestringName*stringrequired#
A unique name for this video encode.
respondToAfdRespondToAfdrespond_to_afdRespondToAfdrespondToAfdRespondToAfdRespondToAfdRespondToAfdRespondToAfdRespondToAfd= RespondToAfd.NONE#
How to respond to AFD values in the input stream.
scalingBehaviorScalingBehaviorscaling_behaviorScalingBehaviorscalingBehaviorScalingBehaviorScalingBehaviorScalingBehaviorScalingBehaviorScalingBehavior= ScalingBehavior.DEFAULT#
The video scaling behavior.
sharpnessnumbersharpnessint | floatsharpnessNumberSharpnessdoubleSharpness*float64= 50#
The anti-alias filter strength (0-100).

0 is softest, 100 is sharpest.

widthnumberwidthint | floatwidthNumberWidthdoubleWidth*float64required#
The width of the output video in pixels.

Must be an even number.