Class Stream

java.lang.Object
com.github.kokorin.jaffree.ffprobe.Stream
All Implemented Interfaces:
TagAware

public class Stream extends Object implements TagAware
Program description.
  • Constructor Details

    • Stream

      public Stream(ProbeData probeData)
      Creates Stream description based on provided ffprobe data.
      Parameters:
      probeData - ffprobe data
  • Method Details

    • getProbeData

      public ProbeData getProbeData()
      Returns data section which holds all the data provided by ffprobe.

      Use this method if you have to access properties which are not accessible through other getters.

      Specified by:
      getProbeData in interface TagAware
      Returns:
      probe data
    • getId

      public String getId()
      Returns format-specific stream ID.
      Returns:
      stream ID
    • getIndex

      public Integer getIndex()
      Returns:
      stream index
    • getDisposition

      public StreamDisposition getDisposition()
      Returns:
      stream disposition
    • getSideDataList

      public List<SideData> getSideDataList()
      Returns additional stream data that can be provided by the container.
      Returns:
      side data
    • getCodecName

      public String getCodecName()
      Returns:
      codec name
    • getCodecLongName

      public String getCodecLongName()
      Returns:
      codec long name
    • getProfile

      public String getProfile()
      Returns:
      codec profile
    • getLevel

      public Integer getLevel()
      Returns codec level. Video only.
      Returns:
      codec level
    • getCodecType

      public StreamType getCodecType()
      Returns:
      codec type
    • getCodecTimeBase

      @Deprecated public Rational getCodecTimeBase()
      Deprecated.
      removed in ffmpeg source code
      Returns:
      codec time base
    • getCodecTag

      public String getCodecTag()
      Returns hexadecimal representation of fourcc codec tag, e.g. 0x31637661.
      Returns:
      codec tag
      See Also:
    • getCodecTagString

      public String getCodecTagString()
      Returns string representation of fourcc codec tag, e.g. avc1.
      Returns:
      codec tag
      See Also:
    • getExtradata

      public String getExtradata()
      Returns extra binary data needed for initializing the decoder, codec-dependent.
      Returns:
      extradata
    • getExtradataHash

      public String getExtradataHash()
      Returns extra binary data hash. Extradata is needed for initializing the decoder, codec-dependent.
      Returns:
      extradata hash
    • getWidth

      public Integer getWidth()
      Returns width of video or subtitle stream, or null.
      Returns:
      width
      See Also:
    • getHeight

      public Integer getHeight()
      Returns height of video or subtitle stream, or null.
      Returns:
      height
      See Also:
    • getCodedWidth

      public Integer getCodedWidth()
      Returns coded width of video stream, or null.
      Returns:
      coded width
    • getCodedHeight

      public Integer getCodedHeight()
      Returns coded height of video stream, or null.
      Returns:
      coded height
    • hasBFrames

      public Integer hasBFrames()
      Returns number of delayed frames of video stream, or null.
      Returns:
      number of delayed frames
    • getSampleAspectRatio

      public Rational getSampleAspectRatio()
      Returns sample aspect ratio (SAR) of video stream, or null.
      Returns:
      sar
    • getDisplayAspectRatio

      public Rational getDisplayAspectRatio()
      Returns display aspect ratio (DAR) of video stream, or null.
      Returns:
      dar
    • getPixFmt

      public String getPixFmt()
      Returns pixel format of video stream, or null.
      Returns:
      pixel format
    • getColorRange

      public String getColorRange()
      Returns visual content value range of video stream, or null.
      Returns:
      color range
      See Also:
    • getColorSpace

      public String getColorSpace()
      Returns YUV color space type of video stream, or null.
      Returns:
      color space
      See Also:
    • getColorTransfer

      public String getColorTransfer()
      Returns color transfer characteristic of video stream, or null.
      Returns:
      color transfer
      See Also:
    • getColorPrimaries

      public String getColorPrimaries()
      Returns chromaticity coordinates of the source primaries of video stream, or null.
      Returns:
      color primaries
      See Also:
    • getChromaLocation

      public String getChromaLocation()
      Returns chroma location of video stream, or null.
      Returns:
      chroma location
      See Also:
    • getFieldOrder

      public String getFieldOrder()
      Returns field order of video stream, or null.
      Returns:
      field order
      See Also:
    • getTimecode

      @Deprecated public String getTimecode()
      Deprecated.
      removed in ffmpeg source code
      Returns mpeg timecode string of video stream, or null.
      Returns:
      timecode
    • getRefs

      public Integer getRefs()
      Returns:
      number of reference frames
    • getSampleFmt

      public String getSampleFmt()
      Returns sample format of audio stream, or null.
      Returns:
      sample format
    • getSampleRate

      public Integer getSampleRate()
      Returns sample rate of audio stream, or null.
      Returns:
      sample rate
    • getChannels

      public Integer getChannels()
      Returns number of channels in audio stream, or null.
      Returns:
      number of channels
    • getChannelLayout

      public String getChannelLayout()
      Returns channels layout of audio stream, or null.
      Returns:
      channels layout
    • getBitsPerSample

      public Integer getBitsPerSample()
      Returns number of bits per sample of audio stream, or null.
      Returns:
      bits per sample
    • getRFrameRate

      public Rational getRFrameRate()
      Returns real base framerate of the stream.

      This is the lowest framerate with which all timestamps can be represented accurately (it is the least common multiple of all framerates in the stream).

      Note, this value is just a guess! For example, if the time base is 1/90000 and all frames have either approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.

      Returns:
      base framerate
    • getAvgFrameRate

      public Rational getAvgFrameRate()
      Returns:
      average framerate
    • getTimeBase

      public String getTimeBase()
      Timebase is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
      Returns:
      stream timebase
    • getStartPts

      public Long getStartPts()
      Returns presentation timestamp of the first frame of the stream in presentation order.
      Returns:
      start PTS
    • getStartTime

      public Float getStartTime()
      Returns time (in seconds) of the first frame of the stream in presentation order.
      Returns:
      start time
    • getDurationTs

      public Long getDurationTs()
      Stream duration in stream timebase units.
      Returns:
      duration in timebase units
    • getDuration

      public Float getDuration()
      Returns:
      duration in seconds
    • getBitRate

      public Integer getBitRate()
      Returns:
      bit rate
    • getMaxBitRate

      public Integer getMaxBitRate()
      Returns:
      max bit rate
    • getBitsPerRawSample

      public Integer getBitsPerRawSample()
      Returns:
      bits per raw sample
    • getNbFrames

      public Integer getNbFrames()
      Returns:
      number of frames
    • getNbReadFrames

      public Integer getNbReadFrames()
      Returns:
      number of read frames
    • getNbReadPackets

      public Integer getNbReadPackets()
      Returns:
      number of read packets