Package 

Class PublishOption

  • All Implemented Interfaces:
    java.io.Serializable

    
    public final class PublishOption
    extends Message<PublishOption, Nothing>
                        

    PublishOption represents the configuration options for publishing a track.

    • Method Detail

      • getTrack_type

         final TrackType getTrack_type()

        The type of the track being published (e.g., video, screenshare).

      • getCodec

         final Codec getCodec()

        The codec to be used for encoding the track (e.g., VP8, VP9, H264).

      • getBitrate

         final Integer getBitrate()

        The target bitrate for the published track, in bits per second.

      • getFps

         final Integer getFps()

        The target frames per second (FPS) for video encoding.

      • getMax_spatial_layers

         final Integer getMax_spatial_layers()

        The maximum number of spatial layers to send.

        • For SVC (e.g., VP9), spatial layers downscale by a factor of 2:

        • 1 layer: full resolution

        • 2 layers: full resolution + half resolution

        • 3 layers: full resolution + half resolution + quarter resolution

        • For non-SVC codecs (e.g., VP8/H264), this determines the number of encoded resolutions (e.g., quarter, half, full) sent for simulcast.

      • getMax_temporal_layers

         final Integer getMax_temporal_layers()

        The maximum number of temporal layers for scalable video coding (SVC). Temporal layers allow varying frame rates for different bandwidths.

      • getVideo_dimension

         final VideoDimension getVideo_dimension()

        The dimensions of the video (e.g., width and height in pixels). Spatial layers are based on this base resolution. For example, if the base resolution is 1280x720:

        • Full resolution (1 layer) = 1280x720

        • Half resolution (2 layers) = 640x360

        • Quarter resolution (3 layers) = 320x180

      • getId

         final Integer getId()

        The unique identifier for the publish request.

        • This id is assigned exclusively by the SFU. Any id set by the client in the PublishOption will be ignored and overwritten by the SFU.

        • The primary purpose of this id is to uniquely identify each publish request, even in scenarios where multiple publish requests for the same track_type and codec are active simultaneously. For example:

        • This uniqueness ensures that individual requests can be managed independently. For instance, an id is critical when stopping a specific publish request without affecting others.

      • getUse_single_layer

         final Boolean getUse_single_layer()

        If true, instructs the publisher to send only the highest available simulcast layer, disabling all lower layers. This applies to simulcast encodings. For SVC codecs, prefer using the L1T3 (single spatial, 3 temporal layers) mode instead.