Class FrameInput

All Implemented Interfaces:
Input

public class FrameInput extends TcpInput<FrameInput> implements Input
Allows to supply ffmpeg with audio & video frames constructed in Java. It's strongly recommended to specify setFrameRate(Number) for video producing.
See Also:
  • Constructor Details

  • Method Details

    • setFrameRate

      public FrameInput setFrameRate(Number frameRate)
      Set frame rate.

      As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps.

      As an output option, duplicate or drop input frames to achieve constant output frame rate fps.

      It's strongly recommended to specify videoFrameRate for video producing.

      Otherwise conversion can be very slow (20-50 times slower) and even can result in corrupted video.

      Overrides:
      setFrameRate in class BaseInOut<FrameInput>
      Parameters:
      frameRate - Hz value, fraction or abbreviation
      Returns:
      this
    • setFrameRate

      public FrameInput setFrameRate(String streamSpecifier, Number frameRate)
      Set frame rate.

      As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps.

      As an output option, duplicate or drop input frames to achieve constant output frame rate fps.

      It's strongly recommended to specify videoFrameRate for video producing.

      Otherwise conversion can be very slow (20-50 times slower) and even can result in corrupted video.

      Overrides:
      setFrameRate in class BaseInOut<FrameInput>
      Parameters:
      streamSpecifier - stream specifier
      frameRate - Hz value, fraction or abbreviation
      Returns:
      this
      See Also:
    • setFormat

      public final FrameInput setFormat(String format)
      Format change is prohibited after FrameInput instantiation.
      Overrides:
      setFormat in class BaseInOut<FrameInput>
      Parameters:
      format - format
      Returns:
      never returns
      Throws:
      JaffreeException - always
    • withProducer

      public static FrameInput withProducer(FrameProducer producer)
      Creates FrameInput with specified frame producer.

      Note: frame producer should produce video frames in BGR24 format.

      Parameters:
      producer - frame producer
      Returns:
      FrameInput
      See Also:
    • withProducerAlpha

      public static FrameInput withProducerAlpha(FrameProducer producer)
      Creates FrameInput with specified frame producer with alpha channel.

      Note: frame producer should produce video frames in ABGR format.

      Parameters:
      producer - frame producer
      Returns:
      FrameInput
      See Also:
    • withProducer

      public static FrameInput withProducer(FrameProducer producer, ImageFormat imageFormat)
      Creates FrameInput with specified frame producer and image format.
      Parameters:
      producer - frame producer
      imageFormat - video frame image format
      Returns:
      FrameInput
      See Also:
    • withProducer

      public static FrameInput withProducer(FrameProducer producer, ImageFormat imageFormat, long frameOrderingBufferMillis)
      Creates FrameInput with specified frame producer, format and frame ordering buffer

      Frame ordering buffer allows FrameProducer to produce frame without strict ordering (which is required by NUT format).

      Note: too long frame ordering buffer may cause OutOfMemoryError or performance degradation.

      Parameters:
      producer - frame producer
      imageFormat - video frame image format
      frameOrderingBufferMillis - frame ordering buffer milliseconds
      Returns:
      FrameInput
      See Also: