
public class Codec extends RefCounted
| Modifier and Type | Class and Description |
|---|---|
static class |
Codec.CodecCapability
Capabilities supported by a codec.
|
static class |
Codec.DiscardFlag
When decoding, you can instruct streams to discard some
packets. |
static class |
Codec.ID
Identify the syntax and semantics of an audio or video encoded bitstream.
The principle is roughly: Two decoders with the same ID can decode the same streams. Two encoders with the same ID can encode compatible streams. There may be slight deviations from the principle due to implementation details. From Ffmpeg 2.8 |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDecode()
Can this codec be used for decoding?
|
boolean |
canEncode()
Can this codec be used for encoding?
|
Codec |
copyReference()
Create a new Codec object that is actually referring to the
exact same underlying native object.
|
boolean |
equals(Object obj)
Compares two values, returning true if the underlying objects in native code are the same object.
|
static Codec |
findDecodingCodec(Codec.ID id)
Find a codec that can be used for decoding.
|
static Codec |
findDecodingCodecByIntID(int id)
Find a codec that can be used for decoding.
|
static Codec |
findDecodingCodecByName(String id)
Find a codec that can be used for decoding.
|
static Codec |
findEncodingCodec(Codec.ID id)
Find a codec that can be used for encoding.
|
static Codec |
findEncodingCodecByIntID(int id)
Find a codec that can be used for encoding.
|
static Codec |
findEncodingCodecByName(String id)
Find a codec that can be used for encoding.
|
int |
getCapabilities()
Get a bitmask of the supported CodecCapability flags.
|
Codec.ID |
getID()
Get the ID of this codec as an enumeration.
|
int |
getIDAsInt()
Get the ID of this codec, as an integer.
|
static Codec |
getInstalledCodec(int index)
Get the ICodec at the given index.
|
static Collection<Codec> |
getInstalledCodecs()
Gets a collection of ALL codecs installed on this
system.
|
String |
getLongName()
Get the long name for this codec.
|
String |
getName()
Get the name of the codec.
|
static int |
getNumInstalledCodecs()
Capability flags
Get the number of installed codecs on this system. |
int |
getNumSupportedAudioChannelLayouts()
Get the number of different audio channel layouts this codec supports
for encoding. |
int |
getNumSupportedAudioFormats()
Get the number of different audio sample formats this codec supports
for encoding. |
int |
getNumSupportedAudioSampleRates()
Get the number of different audio sample rates this codec supports
for encoding. |
int |
getNumSupportedProfiles()
Get the number of supported CodecProfiles this codec
supports. |
int |
getNumSupportedVideoFrameRates()
Get the number of frame rates this codec supports for encoding.
Not all codecs will report this number. |
int |
getNumSupportedVideoPixelFormats()
Get the number of supported video pixel formats this codec supports
for encoding. |
AudioChannel.Layout |
getSupportedAudioChannelLayout(int index)
Get the supported audio channel layout at this index.
The value returned is a bit flag representing the different types of audio layout this codec can support. |
Collection<AudioChannel.Layout> |
getSupportedAudioChannelLayouts()
Returns a list of supported audio channel layouts this codec can encode
audio in.
|
AudioFormat.Type |
getSupportedAudioFormat(int index)
Get the supported sample format at this index.
|
Collection<AudioFormat.Type> |
getSupportedAudioFormats()
Returns a list of supported audio sample formats this codec can encode
audio in.
|
int |
getSupportedAudioSampleRate(int index)
Return the support audio sample rate at the given index.
|
Collection<Integer> |
getSupportedAudioSampleRates()
Returns a list of supported audio sample rates this codec can encode
audio in.
|
CodecProfile |
getSupportedProfile(int index)
Get the supported CodecProfile at this index.
|
Rational |
getSupportedVideoFrameRate(int index)
Return the supported frame rate at the given index.
|
Collection<Rational> |
getSupportedVideoFrameRates()
Returns a list of supported frame-rates this codec can encode
video to.
|
PixelFormat.Type |
getSupportedVideoPixelFormat(int index)
Return the supported video pixel format at the given index.
|
Collection<PixelFormat.Type> |
getSupportedVideoPixelFormats()
Returns a list of supported pixel formats this codec can encode
video in.
|
MediaDescriptor.Type |
getType()
Get the type of this codec.
|
static Codec |
guessEncodingCodec(MuxerFormat fmt,
String shortName,
String url,
String mimeType,
MediaDescriptor.Type type)
Ask us to guess an encoding codec based on the inputs
passed in. |
boolean |
hasCapability(Codec.CodecCapability c)
Checks if this codec has the given capability.
|
int |
hashCode()
Get a hashable value for this object.
|
String |
toString()
Prints the type and id of this codec
|
delete, getCurrentRefCountpublic Codec copyReference()
copyReference in class RefCountedpublic boolean equals(Object obj)
public int hashCode()
public String toString()
public static Collection<Codec> getInstalledCodecs()
public Collection<Rational> getSupportedVideoFrameRates()
Not all codecs support reporting this, in which case the returned list will be empty.
public Collection<PixelFormat.Type> getSupportedVideoPixelFormats()
Not all codecs support reporting this, in which case the returned list will be empty.
public Collection<Integer> getSupportedAudioSampleRates()
Not all codecs support reporting this, in which case the returned list will be empty.
public Collection<AudioFormat.Type> getSupportedAudioFormats()
Not all codecs support reporting this, in which case the returned list will be empty.
public Collection<AudioChannel.Layout> getSupportedAudioChannelLayouts()
Not all codecs support reporting this, in which case the returned list will be empty.
public boolean hasCapability(Codec.CodecCapability c)
c - Capability to check.public int getCapabilities()
public String getName()
public int getIDAsInt()
public Codec.ID getID()
public MediaDescriptor.Type getType()
public boolean canDecode()
public boolean canEncode()
public static Codec findEncodingCodec(Codec.ID id)
id - The id of the codecpublic static Codec findEncodingCodecByIntID(int id)
id - The id of the codec, as an integer.public static Codec findEncodingCodecByName(String id)
id - The id of the codec, as a FFMPEG short-name stringpublic static Codec findDecodingCodec(Codec.ID id)
id - The id of the codecpublic static Codec findDecodingCodecByIntID(int id)
id - The id of the codec, as an integerpublic static Codec findDecodingCodecByName(String id)
id - The id of the codec, as a FFMPEG short-name stringpublic static Codec guessEncodingCodec(MuxerFormat fmt, String shortName, String url, String mimeType, MediaDescriptor.Type type)
You must pass in at least one non null fmt, shortName,
url or mime_type.
fmt - A SinkFormat for the container you'll want to encode into.shortName - The FFMPEG short name of the codec (e.g. "mpeg4").url - The URL you'll be writing packets to.mimeType - The mime type of the container.type - The codec type.public String getLongName()
public static int getNumInstalledCodecs()
public static Codec getInstalledCodec(int index)
index - the index in our listpublic int getNumSupportedVideoFrameRates()
public Rational getSupportedVideoFrameRate(int index)
index - the index in our list.public int getNumSupportedVideoPixelFormats()
public PixelFormat.Type getSupportedVideoPixelFormat(int index)
index - the index in our list.public int getNumSupportedAudioSampleRates()
public int getSupportedAudioSampleRate(int index)
index - the index in our list.public int getNumSupportedAudioFormats()
public AudioFormat.Type getSupportedAudioFormat(int index)
index - the index in our list.public int getNumSupportedAudioChannelLayouts()
public AudioChannel.Layout getSupportedAudioChannelLayout(int index)
index - the indexpublic int getNumSupportedProfiles()
public CodecProfile getSupportedProfile(int index)
index - the indexCopyright © 2018 Humble Software. All rights reserved.