Class EncodingProfile

All Implemented Interfaces:
Proxy
Direct Known Subclasses:
EncodingAudioProfile, EncodingContainerProfile, EncodingVideoProfile

@Generated("org.javagi.JavaGI") public class EncodingProfile extends GObject
The opaque base class object for all encoding profiles. This contains generic information like name, description, format and preset.
  • Constructor Details

    • EncodingProfile

      public EncodingProfile(MemorySegment address)
      Create a EncodingProfile instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • EncodingProfile

      public EncodingProfile()
      Create a new EncodingProfile.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the EncodingProfile class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected EncodingProfile asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • find

      public static @Nullable EncodingProfile find(String targetname, @Nullable String profilename, @Nullable String category)
      Find the GstEncodingProfile with the specified name and category.
      Parameters:
      targetname - The name of the target
      profilename - The name of the profile, if null provided, it will default to the encoding profile called default.
      category - The target category. Can be null
      Returns:
      The matching GstEncodingProfile or null.
    • fromDiscoverer

      public static @Nullable EncodingProfile fromDiscoverer(DiscovererInfo info)
      Creates a GstEncodingProfile matching the formats from the given GstDiscovererInfo. Streams other than audio or video (eg, subtitles), are currently ignored.
      Parameters:
      info - The GstDiscovererInfo to read from
      Returns:
      The new GstEncodingProfile or null.
    • fromString

      public static @Nullable EncodingProfile fromString(String string)
      Converts a string in the "encoding profile serialization format" into a GstEncodingProfile. Refer to the encoding-profile documentation for details on the format.
      Parameters:
      string - The string to convert into a GstEncodingProfile.
      Returns:
      A newly created GstEncodingProfile or NULL if the input string is not a valid encoding profile serialization format.
      Since:
      1.26
    • copy

      public EncodingProfile copy()
      Makes a deep copy of this EncodingProfile
      Returns:
      The copy of this EncodingProfile
      Since:
      1.12
    • getAllowDynamicOutput

      public boolean getAllowDynamicOutput()
      Get whether the format that has been negotiated in at some point can be renegotiated later during the encoding.
    • getDescription

      public @Nullable String getDescription()
    • getElementProperties

      public @Nullable Structure getElementProperties()
    • getFileExtension

      public @Nullable String getFileExtension()
    • getFormat

      public Caps getFormat()
    • getInputCaps

      public Caps getInputCaps()
      Computes the full output caps that this this EncodingProfile will be able to consume.
      Returns:
      The full caps the given this EncodingProfile can consume. Call gst_caps_unref() when you are done with the caps.
    • getName

      public @Nullable String getName()
    • getPresence

      public int getPresence()
    • getPreset

      public @Nullable String getPreset()
    • getPresetName

      public @Nullable String getPresetName()
    • getRestriction

      public @Nullable Caps getRestriction()
    • getSingleSegment

      public boolean getSingleSegment()
    • getTypeNick

      public String getTypeNick()
    • isEnabled

      public boolean isEnabled()
    • isEqual

      public boolean isEqual(EncodingProfile b)
      Checks whether the two GstEncodingProfile are equal
      Parameters:
      b - a GstEncodingProfile
      Returns:
      true if this EncodingProfile and b are equal, else false.
    • setAllowDynamicOutput

      public void setAllowDynamicOutput(boolean allowDynamicOutput)
      Sets whether the format that has been negotiated in at some point can be renegotiated later during the encoding.
      Parameters:
      allowDynamicOutput - Whether the format that has been negotiated first can be renegotiated during the encoding
    • setDescription

      public void setDescription(@Nullable String description)
      Set description as the given description for the profile. A copy of description will be made internally.
      Parameters:
      description - the description to set on the profile
    • setElementProperties

      public void setElementProperties(Structure elementProperties)

      This allows setting the muxing/encoding element properties.

      Set properties generically

       [element-properties, boolean-prop=true, string-prop="hi"]
      

      Mapping properties with well known element factories

      element-properties-map, map = {
           [openh264enc, gop-size=32, ],
           [x264enc, key-int-max=32, tune=zerolatency],
       }
      
      Parameters:
      elementProperties - A GstStructure defining the properties to be set to the element the profile represents.
      Since:
      1.20
    • setEnabled

      public void setEnabled(boolean enabled)
      Set whether the profile should be used or not.
      Parameters:
      enabled - false to disable profile, true to enable it
      Since:
      1.6
    • setFormat

      public void setFormat(Caps format)
      Sets the media format used in the profile.
      Parameters:
      format - the media format to use in the profile.
    • setName

      public void setName(@Nullable String name)
      Set name as the given name for the profile. A copy of name will be made internally.
      Parameters:
      name - the name to set on the profile
    • setPresence

      public void setPresence(int presence)
      Set the number of time the profile is used in its parent container profile. If 0, it is not a mandatory stream
      Parameters:
      presence - the number of time the profile can be used
    • setPreset

      public void setPreset(@Nullable String preset)

      Sets the name of the preset to be used in the profile. This is the name that has been set when saving the preset. You can list the available presets for a specific element factory using $ gst-inspect-1.0 element-factory-name, for example for x264enc:

      $ gst-inspect-1.0 x264enc
      ...
      Presets:
       "Profile Baseline": Baseline Profile
       "Profile High": High Profile
       "Profile Main": Main Profile
       "Profile YouTube": YouTube recommended settings (https://support.google.com/youtube/answer/1722171)
       "Quality High": High quality
       "Quality Low": Low quality
       "Quality Normal": Normal quality
       "Zero Latency"
      

      }

      Parameters:
      preset - the element preset to use
    • setPresetName

      public void setPresetName(@Nullable String presetName)
      Sets the name of the GstPreset's factory to be used in the profile. This is the name of the element factory that implements the GstPreset interface not the name of the preset itself (see gst_encoding_profile_set_preset).
      Parameters:
      presetName - The name of the element factory to use in this profile.
    • setRestriction

      public void setRestriction(@Nullable Caps restriction)
      Set the restriction GstCaps to apply before the encoder that will be used in the profile. See gst_encoding_profile_get_restriction() for more about restrictions. Does not apply to GstEncodingContainerProfile.
      Parameters:
      restriction - the restriction to apply
    • setSingleSegment

      public void setSingleSegment(boolean singleSegment)

      If using a single segment, buffers will be retimestamped and segments will be eat so as to appear as one segment.

      NOTE: Single segment is not property supported when using encodebin:avoid-reencoding

      Parameters:
      singleSegment - TRUE if the stream represented by this EncodingProfile should use a single segment before the encoder, FALSE otherwise.
      Since:
      1.18
    • toString

      public String toString()
      Converts a GstEncodingProfile to a string in the "Encoding Profile serialization format".
      Overrides:
      toString in class Object
      Returns:
      A string representation of the GstEncodingProfile.
      Since:
      1.26
    • builder

      public static EncodingProfile.Builder<? extends EncodingProfile.Builder> builder()
      A EncodingProfile.Builder object constructs a EncodingProfile with the specified properties. Use the various set...() methods to set properties, and finish construction with EncodingProfile.Builder.build().
      Returns:
      the builder object