Package limn.video.ffmpeg
Record Class FfmpegMedia.AudioTrack
java.lang.Object
java.lang.Record
limn.video.ffmpeg.FfmpegMedia.AudioTrack
- Record Components:
index- this track's position inFfmpegMedia.audioTracks(), and whatFfmpegMedia.audio(int)takes. Not a container stream index: a file whose audio is streams 1 and 2 has tracks 0 and 1streamIndex- the container's own index for this stream, for a diagnostic; nothing in this API takes itchannels- what this track would deliver: 1 or 2, after the fold the audio engine makes necessarysourceChannels- what the file holds, before that fold. A 5.1 track reports 6 here and 2 inchannelssampleRate- frames a second, as the file declares it. Nothing resamples, so this is what the engine would be handedcodec- the codec's name as libavcodec spells it:aac,opuslanguage- the language tag the container states, or null when it states none. Null and never an empty string, so that a caller can tell the two apart rather than rendering a blank row; the tag is whatever the container carries, which for MP4 and Matroska is an ISO 639-2 three-letter code, and the undetermined codeundis reported as null because it is the file saying it does not knowisDefault- whether this is the trackFfmpegMedia.audio()hands over (the container's own signalling, ranked as libavformat ranks it: the default disposition first, then channel count and bit rate)decodable- whether this build has a decoder for it. False is not a broken file: a trimmed build carries a few codecs, and a track it cannot decode is still listed rather than hidden, because a two-language film with one playable track is not a one-language film. Asking for such a track throws rather than playing silence
- Enclosing class:
FfmpegMedia
public static record FfmpegMedia.AudioTrack(int index, int streamIndex, int channels, int sourceChannels, int sampleRate, String codec, String language, boolean isDefault, boolean decodable)
extends Record
One of a container's audio tracks, as the container describes it: read once at open, from
the file's own stream headers, without opening a decoder for it.
-
Constructor Summary
ConstructorsConstructorDescriptionAudioTrack(int index, int streamIndex, int channels, int sourceChannels, int sampleRate, String codec, String language, boolean isDefault, boolean decodable) Creates an instance of aAudioTrackrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintchannels()Returns the value of thechannelsrecord component.codec()Returns the value of thecodecrecord component.booleanReturns the value of thedecodablerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.booleanReturns the value of theisDefaultrecord component.language()Returns the value of thelanguagerecord component.intReturns the value of thesampleRaterecord component.intReturns the value of thesourceChannelsrecord component.intReturns the value of thestreamIndexrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AudioTrack
public AudioTrack(int index, int streamIndex, int channels, int sourceChannels, int sampleRate, String codec, String language, boolean isDefault, boolean decodable) Creates an instance of aAudioTrackrecord class.- Parameters:
index- the value for theindexrecord componentstreamIndex- the value for thestreamIndexrecord componentchannels- the value for thechannelsrecord componentsourceChannels- the value for thesourceChannelsrecord componentsampleRate- the value for thesampleRaterecord componentcodec- the value for thecodecrecord componentlanguage- the value for thelanguagerecord componentisDefault- the value for theisDefaultrecord componentdecodable- the value for thedecodablerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
streamIndex
public int streamIndex()Returns the value of thestreamIndexrecord component.- Returns:
- the value of the
streamIndexrecord component
-
channels
public int channels()Returns the value of thechannelsrecord component.- Returns:
- the value of the
channelsrecord component
-
sourceChannels
public int sourceChannels()Returns the value of thesourceChannelsrecord component.- Returns:
- the value of the
sourceChannelsrecord component
-
sampleRate
public int sampleRate()Returns the value of thesampleRaterecord component.- Returns:
- the value of the
sampleRaterecord component
-
codec
Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-
language
Returns the value of thelanguagerecord component.- Returns:
- the value of the
languagerecord component
-
isDefault
public boolean isDefault()Returns the value of theisDefaultrecord component.- Returns:
- the value of the
isDefaultrecord component
-
decodable
public boolean decodable()Returns the value of thedecodablerecord component.- Returns:
- the value of the
decodablerecord component
-