public class H264Encoder extends VideoEncoder
VideoEncoder.EncodedFrame
Constructor and Description |
---|
H264Encoder(RateControl rc) |
Modifier and Type | Method and Description |
---|---|
static H264Encoder |
createH264Encoder() |
ByteBuffer |
doEncodeFrame(Picture pic,
ByteBuffer _out,
boolean idr,
int frameNumber,
SliceType frameType) |
VideoEncoder.EncodedFrame |
encodeFrame(Picture pic,
ByteBuffer _out)
Encode this picture into h.264 frame.
|
ByteBuffer |
encodeIDRFrame(Picture pic,
ByteBuffer _out)
Encode this picture as an IDR frame.
|
ByteBuffer |
encodePFrame(Picture pic,
ByteBuffer _out)
Encode this picture as a P-frame.
|
int |
estimateBufferSize(Picture frame)
Estimate the output buffer size that will likely be needed for the
current instance of encoder to encode a given frame.
|
int |
getKeyInterval() |
int |
getMotionSearchRange() |
ColorSpace[] |
getSupportedColorSpaces()
Native color spaces of this video encoder, i.e.
|
PictureParameterSet |
initPPS() |
SeqParameterSet |
initSPS(Size sz) |
void |
setKeyInterval(int keyInterval) |
void |
setMotionSearchRange(int motionSearchRange) |
public H264Encoder(RateControl rc)
public static H264Encoder createH264Encoder()
public int getKeyInterval()
public void setKeyInterval(int keyInterval)
public int getMotionSearchRange()
public void setMotionSearchRange(int motionSearchRange)
public VideoEncoder.EncodedFrame encodeFrame(Picture pic, ByteBuffer _out)
encodeFrame
in class VideoEncoder
pic
- The video frame to be encoded. Must be in one of the encoder's
native color spaces._out
- The buffer to store the encoded frame into. Note, only the
storage of this buffer is used, the position and limit are
kept untouched. Instead the returned value contains a
duplicate of this buffer with the position and limit set
correctly to the boundaries of the encoded frame. This buffer
must be large enough to hold the encoded frame. It is
undefined what will happen if the buffer is not large enough.
Most commonly some exception will be thrown.public ByteBuffer encodeIDRFrame(Picture pic, ByteBuffer _out)
pic
- _out
- public ByteBuffer encodePFrame(Picture pic, ByteBuffer _out)
pic
- _out
- public ByteBuffer doEncodeFrame(Picture pic, ByteBuffer _out, boolean idr, int frameNumber, SliceType frameType)
public PictureParameterSet initPPS()
public SeqParameterSet initSPS(Size sz)
public ColorSpace[] getSupportedColorSpaces()
VideoEncoder
getSupportedColorSpaces
in class VideoEncoder
public int estimateBufferSize(Picture frame)
VideoEncoder
estimateBufferSize
in class VideoEncoder
frame
- A frame in question.Copyright © 2019. All rights reserved.