Class VideoAttributes

java.lang.Object
ws.schild.jave.encode.VideoAttributes
All Implemented Interfaces:
Serializable

public class VideoAttributes extends Object implements Serializable
Attributes controlling the video encoding process.
Author:
Carlo Pelliccia
See Also:
  • Field Details

    • DIRECT_STREAM_COPY

      public static final String DIRECT_STREAM_COPY
      This value can be set in the codec field to perform a direct stream copy, without re-encoding of the audio stream.
      See Also:
  • Constructor Details

    • VideoAttributes

      public VideoAttributes()
  • Method Details

    • getCodec

      public Optional<String> getCodec()
      Returns the codec name for the encoding process.
      Returns:
      The codec name for the encoding process.
    • setCodec

      public VideoAttributes setCodec(String codec)
      Sets the codec name for the encoding process. If null or not specified the encoder will perform a direct stream copy.

      Be sure the supplied codec name is in the list returned by Encoder.getVideoEncoders().

      A special value can be picked from DIRECT_STREAM_COPY.

      Parameters:
      codec - The codec name for the encoding process.
      Returns:
      this instance
    • getTag

      public Optional<String> getTag()
      Returns the the forced tag/fourcc value for the video stream.
      Returns:
      The the forced tag/fourcc value for the video stream.
    • setTag

      public VideoAttributes setTag(String tag)
      Sets the forced tag/fourcc value for the video stream.
      Parameters:
      tag - The the forced tag/fourcc value for the video stream.
      Returns:
      this instance
    • getBitRate

      public Optional<Integer> getBitRate()
      Returns the bitrate value for the encoding process.
      Returns:
      The bitrate value for the encoding process.
    • setBitRate

      public VideoAttributes setBitRate(Integer bitRate)
      Sets the bitrate value for the encoding process. If null or not specified a default value will be picked.
      Parameters:
      bitRate - The bitrate value for the encoding process.
      Returns:
      this instance
    • getFrameRate

      public Optional<Integer> getFrameRate()
      Returns the frame rate value for the encoding process.
      Returns:
      The frame rate value for the encoding process.
    • setFrameRate

      public VideoAttributes setFrameRate(Integer frameRate)
      Sets the frame rate value for the encoding process. If null or not specified a default value will be picked.
      Parameters:
      frameRate - The frame rate value for the encoding process.
      Returns:
      this instance
    • getSize

      public Optional<VideoSize> getSize()
      Returns the video size for the encoding process.
      Returns:
      The video size for the encoding process.
    • setSize

      public VideoAttributes setSize(VideoSize size)
      Sets the video size for the encoding process. If null or not specified the source video size will not be modified.
      Parameters:
      size - The video size for the encoding process.
      Returns:
      this instance
    • isFaststart

      public boolean isFaststart()
      Returns:
      the faststart
    • getComplexFiltergraph

      public Optional<FilterGraph> getComplexFiltergraph()
    • setComplexFiltergraph

      public VideoAttributes setComplexFiltergraph(FilterGraph complexFiltergraph)
    • addFilter

      public void addFilter(VideoFilter videoFilter)
    • getVideoFilters

      public ArrayList<VideoFilter> getVideoFilters()
    • setFaststart

      public VideoAttributes setFaststart(boolean faststart)
      Parameters:
      faststart - the faststart to set
      Returns:
      this instance
    • getQuality

      public Optional<Integer> getQuality()
      Returns:
      the quality
    • setQuality

      public VideoAttributes setQuality(Integer quality)
      The video quality value for the encoding process. If null or not specified the ffmpeg default will be used
      Parameters:
      quality - the quality to set
      Returns:
      this instance
    • getPixelFormat

      public Optional<String> getPixelFormat()
    • setPixelFormat

      public VideoAttributes setPixelFormat(String pixelFormat)
    • getVsync

      public Optional<VsyncMethod> getVsync()
    • setVsync

      public VideoAttributes setVsync(VsyncMethod vsync)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getX264Profile

      public Optional<X264_PROFILE> getX264Profile()
      Returns:
      the x264Profile
    • setX264Profile

      public VideoAttributes setX264Profile(X264_PROFILE x264Profile)
      Parameters:
      x264Profile - the x264Profile to set
      Returns:
      this instance
    • setCrf

      public VideoAttributes setCrf(Integer crf)
      Set the quality for constant quality mode.
      Parameters:
      crf - the crf to set
      Returns:
      this instance
    • getCrf

      public Optional<Integer> getCrf()
      Get the quality for constant quality mode.
      Returns:
      the crf
    • setPreset

      public VideoAttributes setPreset(String preset)
      set the quality from PresetEnum
      Parameters:
      preset -
      Returns:
      this instance
    • getPreset

      public Optional<String> getPreset()
      Get the preset.
      Returns:
      the preset