Package com.amazonaws.ivs.broadcast
Class BroadcastConfiguration.Video
java.lang.Object
com.amazonaws.ivs.broadcast.BroadcastConfiguration.Video
- Enclosing class:
- BroadcastConfiguration
-
Method Summary
Modifier and TypeMethodDescriptionvoid
enableTransparency
(boolean enableTransparency) Setting this to true will enable transparency between mixer slots at the cost of some memory usage.The profile to use for the video's automatic bitrate algorithm.getCodec()
The codec for the output video stream.int
The initial bitrate for the output video stream.float
The keyframe interval for the output video stream in seconds.int
The maximum bitrate for the output video stream.int
The minimum bitrate for the output video stream.getSize()
The resolution of the output video stream.int
The target framerate of the output video stream.boolean
Whether transparency is enabled for this broadcast session.boolean
Whether the output video stream will automatically adjust the bitrate based on network conditions.boolean
Whether the output video stream uses B (Bidirectional predicted picture) frames.void
void
setInitialBitrate
(int initialBitrate) Sets the initial bitrate for the video stream.void
setKeyframeInterval
(float keyframeInterval) Sets the keyframe interval for the video stream.void
setMaxBitrate
(int maxBitrate) Sets the maximum bitrate for the video stream.void
setMinBitrate
(int minBitrate) Sets the minimum bitrate for the video stream.void
setSize
(int width, int height) Sets the frame image size for the video stream.void
void
setTargetFramerate
(int targetFramerate) Sets the target frame rate for the video stream.void
setUseAutoBitrate
(boolean useAutoBitrate) void
setUseBFrames
(boolean useBFrames) Sets whether the output video stream uses B (Bidirectional predicted picture) frames.
-
Method Details
-
getInitialBitrate
public int getInitialBitrate()The initial bitrate for the output video stream. By default this is `2,100,000`. -
setInitialBitrate
public void setInitialBitrate(int initialBitrate) Sets the initial bitrate for the video stream.- Parameters:
initialBitrate
- the desired initial bitrate- Throws:
IllegalArgumentException
- if the bitrate is not between 100k and 8500kUnsupportedOperationException
- if this configuration has been locked byCodecDiscovery
-
getMaxBitrate
public int getMaxBitrate()The maximum bitrate for the output video stream. By default this is `6,000,000`. -
setMaxBitrate
public void setMaxBitrate(int maxBitrate) Sets the maximum bitrate for the video stream.- Parameters:
maxBitrate
- the desired initial bitrate- Throws:
IllegalArgumentException
- if the bitrate is not between 100k and 8500kUnsupportedOperationException
- if this configuration has been locked byCodecDiscovery
-
getMinBitrate
public int getMinBitrate()The minimum bitrate for the output video stream. By default this is `300,000`. -
setMinBitrate
public void setMinBitrate(int minBitrate) Sets the minimum bitrate for the video stream.- Parameters:
minBitrate
- the desired initial bitrate- Throws:
IllegalArgumentException
- if the bitrate is not between 100k and 8500kUnsupportedOperationException
- if this configuration has been locked byCodecDiscovery
-
getTargetFramerate
public int getTargetFramerate()The target framerate of the output video stream. By default this is `30`. -
setTargetFramerate
public void setTargetFramerate(int targetFramerate) Sets the target frame rate for the video stream.- Parameters:
targetFramerate
- the desired target framerate- Throws:
IllegalArgumentException
- if the target frame rate is not between 10 and 60UnsupportedOperationException
- if this configuration has been locked byCodecDiscovery
-
getKeyframeInterval
public float getKeyframeInterval()The keyframe interval for the output video stream in seconds. By default this is `2`. -
setKeyframeInterval
public void setKeyframeInterval(float keyframeInterval) Sets the keyframe interval for the video stream.- Parameters:
keyframeInterval
- the desired keyframe interval- Throws:
IllegalArgumentException
- if the keyframe interval is not between 1 and 5UnsupportedOperationException
- if this configuration has been locked byCodecDiscovery
-
getSize
The resolution of the output video stream. By default this is `720x1280`. -
setSize
public void setSize(int width, int height) Sets the frame image size for the video stream. The width and height must both be between 160 and 1920, and the maximum total number of pixels is 2,073,600. So the smallest size you can provide is 160x160, and the largest is either 1080x1920 or 1920x1080. However something like 1920x1200 would not be supported. 1280x180 however is supported. If these restrictions are violated aIllegalArgumentException
will be thrown. Note that some video encoders are unable to handle image frame sizes of less than 176x176, resulting in an inability to start the session. The recommended minimum is 176x176.- Parameters:
width
- the desired width in pixelsheight
- the desired height in pixels- Throws:
IllegalArgumentException
- if the above rules have been brokenUnsupportedOperationException
- if this configuration has been locked byCodecDiscovery
-
setSize
-
isUseBFrames
public boolean isUseBFrames()Whether the output video stream uses B (Bidirectional predicted picture) frames. By default this is `true`. -
setUseBFrames
public void setUseBFrames(boolean useBFrames) Sets whether the output video stream uses B (Bidirectional predicted picture) frames.- Parameters:
useBFrames
- whether to use B frames- Throws:
UnsupportedOperationException
- if this configuration has been locked byCodecDiscovery
-
isUseAutoBitrate
public boolean isUseAutoBitrate()Whether the output video stream will automatically adjust the bitrate based on network conditions. UsesetMinBitrate(int)
andsetMaxBitrate(int)
to specify the bounds when this is `true`. By default this is `true`. -
setUseAutoBitrate
public void setUseAutoBitrate(boolean useAutoBitrate) -
getAutoBitrateProfile
The profile to use for the video's automatic bitrate algorithm. This has no effect ifuseAutoBitrate
is `false`. By default this isBroadcastConfiguration.AutomaticBitrateProfile.CONSERVATIVE
. -
setAutoBitrateProfile
-
isTransparencyEnabled
public boolean isTransparencyEnabled()Whether transparency is enabled for this broadcast session. -
enableTransparency
public void enableTransparency(boolean enableTransparency) Setting this to true will enable transparency between mixer slots at the cost of some memory usage. For example, if you wanted to broadcast the rear facing camera taking up the entire view port, and then overlay the front facing camera with 30% transparency so that you can still partially see the rear facing camera under the front facing camera, this property would need to be YES. Enabling this option does increase the memory usage of the pipeline. If you are not going to use multiple mixer slots with blending, leave this as false. By default this is false.- Parameters:
enableTransparency
- Whether to enable transparency.
-
getCodec
The codec for the output video stream. By default this is H264. To get aBroadcastConfiguration.Video
with a different codec,CodecDiscovery
must be used.
-