Class BaseInput<T extends BaseInput<T>>

java.lang.Object
com.github.kokorin.jaffree.ffmpeg.BaseInOut<T>
com.github.kokorin.jaffree.ffmpeg.BaseInput<T>
Type Parameters:
T - self
All Implemented Interfaces:
Input
Direct Known Subclasses:
CaptureInput, TcpInput, UrlInput

public abstract class BaseInput<T extends BaseInput<T>> extends BaseInOut<T> implements Input
Base class which handles all arguments for ffmpeg input.
  • Constructor Details

    • BaseInput

      public BaseInput(String input)
      Parameters:
      input - path to file or URI
  • Method Details

    • setStreamLoop

      public T setStreamLoop(Integer streamLoop)
      Set number of times input stream shall be looped. Loop 0 means no loop, loop -1 means infinite loop.
      Parameters:
      streamLoop - number of loops
      Returns:
      this
    • setReadAtFrameRate

      public T setReadAtFrameRate(boolean readAtFrameRate)
      Read input at native frame rate. Mainly used to simulate a grab device, or live input stream (e.g. when reading from a file).

      Should not be used with actual grab devices or live input streams (where it can cause packet loss).

      By default ffmpeg attempts to read the input(s) as fast as possible. This option will slow down the reading of the input(s) to the native frame rate of the input(s).

      It is useful for real-time output (e.g. live streaming).

      Parameters:
      readAtFrameRate - whether or not to read at native frame rate
      Returns:
      this
    • buildArguments

      public final List<String> buildArguments()
      Build a list of command line arguments that are common for ffmpeg input & output.
      Specified by:
      buildArguments in interface Input
      Overrides:
      buildArguments in class BaseInOut<T extends BaseInput<T>>
      Returns:
      list of command line arguments