public class Codec extends Object
Codecs are usually used by encoders and decoders. To create a Codec use
the getEncoderById(CodecID) or getEncoderByName(String), for decoder
respectively.| Modifier and Type | Method and Description |
|---|---|
boolean |
canDecode()
Determines whether this
Codec is a decoder. |
boolean |
canEncode()
Determines whether this
Codec is a encoder. |
int |
getCapabilities()
Get the codec capabilities.
|
static Codec |
getDecoderById(CodecID codecId)
Create a new decoder with specified codec id.
|
static Codec |
getDecoderByName(String avCodecName)
Create a new decoder with specified codec name.
|
static Codec |
getEncoderById(CodecID codecId)
Create a new encoder with specified codec id.
|
static Codec |
getEncoderByName(String avCodecName)
Create a new encoder with specified codec name.
|
CodecID |
getID()
Get the id of this
Codec. |
static String[] |
getInstalledCodecs()
Get all names of codecs that are compiled into FFmpeg.
|
String |
getName()
Get the short name of this
Codec. |
String |
getNameLong()
Get the long name of this
Codec. |
ChannelLayout[] |
getSupportedChannelLayouts()
Get all supported channel layouts by this
Codec. |
Integer[] |
getSupportedFrameRates()
Get all supported frame rates by this
Codec. |
PixelFormat[] |
getSupportedPixelFormats()
Get all supported pixel formats by this
Codec. |
SampleFormat[] |
getSupportedSampleFormats()
Get all supported sample formats by this
Codec. |
Integer[] |
getSupportedSampleRates()
Get all supported sample rates by this
Codec. |
MediaType |
getType()
Get the media type of this
Codec. |
boolean |
hasCapability(CodecCapability flag)
Determines whether this
Codec has the specified capability. |
public static Codec getEncoderById(CodecID codecId) throws JavaAVException
codecId - the codec id.JavaAVException - if encoder could not be created.public static Codec getDecoderById(CodecID codecId) throws JavaAVException
codecId - the codec id.JavaAVException - if decoder could not be created.public static Codec getEncoderByName(String avCodecName) throws JavaAVException
avCodecName - the codec name.JavaAVException - if encoder could not be created.public static Codec getDecoderByName(String avCodecName) throws JavaAVException
avCodecName - the codec name.JavaAVException - if decoder could not be created.public static String[] getInstalledCodecs()
public String getName()
Codec.Codec.public String getNameLong()
Codec.Codec.public CodecID getID()
Codec.public MediaType getType()
Codec.Codec.public boolean canDecode()
Codec is a decoder.Codec is a decoder, false otherwise.public boolean canEncode()
Codec is a encoder.Codec is a encoder, false otherwise.public int getCapabilities()
public boolean hasCapability(CodecCapability flag)
Codec has the specified capability.flag - the codec capability.public SampleFormat[] getSupportedSampleFormats()
Codec. If this Codec
is not an audio codec, then null is returned.Codec.public Integer[] getSupportedSampleRates()
Codec. If this Codec
is not an audio codec, then null is returned. The sample rates are
ordered in ascending order.Codec.public Integer[] getSupportedFrameRates()
Codec. If this Codec
is not a video codec, then null is returned. The frame rates are
ordered in ascending order.Codec.public ChannelLayout[] getSupportedChannelLayouts()
Codec. If this Codec
is not an audio codec, then null is returned.Codec.public PixelFormat[] getSupportedPixelFormats()
Codec. If this Codec
is not a video codec, then null is returned. The pixel formats are
ordered in ascending order.Codec.Copyright © 2013. All Rights Reserved.