public class Encoder extends Coder
Coder.StateavContext, avFrame, avPacket, codec, gotFrame, stateaudioChannels, bitrate, flags, frameRate, gopSize, imageHeight, imageWidth, mediaType, pixelFormat, profile, quality, sampleFormat, sampleRate| Constructor and Description |
|---|
Encoder(Codec codec) |
Encoder(CodecID codecId) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this
Coder and free allocated memory. |
MediaPacket[] |
encodeAudio(AudioFrame audioFrame) |
MediaPacket |
encodeVideo(VideoFrame frame) |
MediaPacket |
flushAudio() |
MediaPacket |
flushVideo() |
Codec |
getCodec() |
void |
open(Map<String,String> options)
Initializes the
Coder with codec options that may contain specific
codec parameters. |
void |
setChannels(int channels) |
void |
setFramerate(double framerate)
Set new frame rate.
|
void |
setGOPSize(int gopSize)
Set group of pictures.
|
void |
setImageHeight(int height)
Set new image height.
|
void |
setImageWidth(int width)
Set new image width.
|
void |
setPixelFormat(PixelFormat format)
Set new pixel format.
|
void |
setSampleFormat(SampleFormat format)
Set new sample format.
|
void |
setSampleRate(int samplerate) |
flush, getAudioChannels, getBitrate, getFramerate, getGOPSize, getImageHeight, getImageWidth, getMediaType, getPixelFormat, getProfile, getQuality, getSampleFormat, getSampleRatesetAudioChannels, setBitrate, setFlag, setMediaType, setProfile, setQuality, setSampleratepublic Encoder(CodecID codecId) throws JavaAVException
JavaAVExceptionpublic Encoder(Codec codec) throws JavaAVException
JavaAVExceptionpublic void open(Map<String,String> options) throws JavaAVException
CoderCoder with codec options that may contain specific
codec parameters.open in class Coderoptions - codec options.JavaAVException - if Coder could not be opened.public void close()
CoderCoder and free allocated memory.public MediaPacket encodeVideo(VideoFrame frame) throws JavaAVException
JavaAVExceptionpublic MediaPacket[] encodeAudio(AudioFrame audioFrame) throws JavaAVException
JavaAVExceptionpublic MediaPacket flushVideo() throws JavaAVException
JavaAVExceptionpublic MediaPacket flushAudio() throws JavaAVException
JavaAVExceptionpublic Codec getCodec()
public void setSampleRate(int samplerate)
throws JavaAVException
JavaAVExceptionpublic void setChannels(int channels)
throws JavaAVException
JavaAVExceptionpublic void setFramerate(double framerate)
throws JavaAVException
ConfigurablesetFramerate in class Configurableframerate - new frame rate.JavaAVExceptionpublic void setImageWidth(int width)
throws JavaAVException
ConfigurablesetImageWidth in class Configurablewidth - new image width.JavaAVExceptionpublic void setImageHeight(int height)
throws JavaAVException
ConfigurablesetImageHeight in class Configurableheight - new image height.JavaAVExceptionpublic void setGOPSize(int gopSize)
throws JavaAVException
ConfigurablesetGOPSize in class ConfigurablegopSize - group of pictures.JavaAVException - if group of pictures could not be set.public void setPixelFormat(PixelFormat format) throws JavaAVException
ConfigurablesetPixelFormat in class Configurableformat - pixel format.JavaAVException - if pixel format could not be set.public void setSampleFormat(SampleFormat format) throws JavaAVException
ConfigurablesetSampleFormat in class Configurableformat - sample format.JavaAVException - if sample format could not be set.Copyright © 2013. All Rights Reserved.