Skip to main content

RESTful API type definition

This page lists all the type definitions of the Media Push RESTful API.

audioOptions

The audio transcoding configuration of the Converter.

FieldTypeDescriptions
codecProfile(Optional)StringThe audio codec output by the Converter. The following values are supported:
  • LC-AAC (Default): MPEG-4 AAC LC
  • HE-AAC: High-Efficiency AAC
  • sampleRate(Optional) NumberThe audio coding sampling rate (Hz) output by the Converter, which can can be 32000, 44100, or 48000 (Default value).
    bitrate(Optional) NumberThe audio encoding bit rate (Kbps) output by the Converter. The value range is [32,128]. The default value is 48. If the audio codec is LC-AAC, the recommended audio code rate range is [32,112]. If the audio codec is HE-AAC, the recommended audio code rate range is [40,96].
    audioChannels(Optional) NumberThe number of audio channels output by the Converter , which can be 1 (Default) or 2.
    rtcStreamUids(Optional) JSON Array of NumbersThe user IDs of the users participating in the mixing.
  • The default value is user IDs of all users in the channel, which means that Agora mixes all users's audio streams in the channel.
  • An empty array means that Agora does not mix any user's audio streams.
  • volumes(Optional) JSON ArraySet the volume of users participating in the mixing.
  • This field takes effect only when mixing user IDs are specified (set rtcStreamUids).
  • You can call the Update method to adjust the volume of the specified user. Each time the Update request is successful, the volume of other users in the mixing is reseted to the default value (100).
  • volumes.rtcStreamUidNumberThe user IDs of the mixing users to set the volume.
    volumes.rtcStreamUid needs to exist in the rtcStreamUids array, otherwise the request fails with a response status code of 400.
    volumes.volumeNumberThe volume of the specified mix user. The default value is 100, and the value range is [0, 200].

    videoOptions

    The video transcoding configuration of the Converter.

    canvas

    The video canvas.

    FieldTypeDescriptions
    width(Required) NumberThe width of the canvas (pixels). The value range is [66,1920].
    height(Required) NumberThe height of the canvas (pixels). The value range is [66,1920].
    color(Optional) NumberThe background color of the canvas. This is an RGB color value, expressed as a decimal number. For example, 255 represents blue. The value range is [0,16777215]. The default value is 0, which is black.

    layout

    The content description of the video screen on the canvas.

    layout.RtcStreamView

    The video screen of each user on the canvas.

    FieldTypeDescriptions
    rtcStreamUid(Required) NumberThe user ID of the user to which the video stream belongs.
    region(Required) JSON ObjectThe display area of the user's video screen on the canvas. If the video screen dimensions exceed the canvas, the screen will be cropped, and the excess image will not be displayed.
    region.xPos(Required) NumberThe x coordinate (pixels) of the screen on the canvas. This is the lateral displacement relative to the origin, where the upper left corner of the canvas is the origin, and the x coordinate is the upper left corner of the screen.
    region.yPos(Required) NumberThe y coordinate (pixels) of the screen on the canvas. This is the longitudinal displacement relative to the origin, where the upper left corner of the canvas is the origin, and the y coordinate is the upper left corner of the screen.
    region.zIndex(Required) NumberThe layer number of the screen. The value range is [0,100]. 0 represents the lowest layer. 100 represents the top layer.
    region.width(Required) NumberThe width of the screen (pixels).
    region.height(Required) NumberThe height of the screen (pixels).
    fillMode(Optional) StringThe display types of the screen.
  • fill: (Default) Under the premise of maintaining the aspect ratio, zoom the screen to fill the container. 1628837665989
  • fit: Zoom the screen while maintaining the aspect ratio so that the screen is in the container Full display. 1628837708782
  • placeholderImageUrl(Required) StringThe HTTP(S) URL of the substitute image. Images in JPG, PNG and GIF formats are supported. When the user in the channel does not publish the video stream, if this field is set, this substitute image will replace the user's video screen; otherwise, the last frame of the user's video will be displayed.

    layout.ImageView

    The video image on the canvas, which can be used as a watermark.

    FieldTypeDescriptions
    imageUrl(Required) StringThe HTTP(S) URL of the image. Images in JPG, PNG and GIF formats are supported.
    region(Required) JSON ObjectThe display area of the image on the canvas. If the video screen dimensions exceed the canvas, the screen will be cropped, and the excess image will not be displayed.
    region.xPos(Required) NumberThe x coordinate (pixels) of the image on the canvas. This is the lateral displacement relative to the origin, where the upper left corner of the canvas is the origin, and the x coordinate is the upper left corner of the screen.
    region.yPos(Required) NumberThe y coordinate (pixels) of the picture on the canvas. This is the longitudinal displacement relative to the origin, where the upper left corner of the canvas is the origin and the y coordinate is the upper left corner of the screen.
    region.zIndex(Required) NumberThe layer number of the image. The value range is [0,100]. 0 represents the lowest layer. 100 represents the top layer.
    region.width(Required) NumberThe width of the image (pixels).
    region.height(Required) NumberThe height of the image (pixels).
    fillMode(Optional) StringThe display types of the image.
  • fill: Under the premise of maintaining the aspect ratio, zoom the image so that the image fills the container.
  • fit: zoom the image while maintaining the aspect ratio so that the image is in the container Full display. 1628837708782
  • vertical

    Vertical layout. The field is optional.

    See Set Vertical Layout.

    FieldTypeDescriptions
    maxResolutionUidNumberThe user ID of the user who is displayed in the large window. If maxResolutionUid is not set, the user with the loudest volume when the layout refreshes is displayed in the large window.
  • By default, the screen layout is refreshed every 3 seconds. Contact support@agora.io if you need to adjust the refresh interval.
  • Not setting maxResolutionUid may cause the screen layout to change every 3 seconds. If the layout needs to be stable, set this parameter.
  • fillModeStringThe display options of the screen:
  • fill: (Default) Zoom the image to fill the window completely while maintaining the aspect ratio of the image.1628837665989
  • fit: Zoom the image only until it fills the window vertically or horizontally, displaying the entire image while possibly leaving some of the window blank. 1628837708782
  • seiOptions

    The user SEI information carried in the output video stream. The field is optional.

    FieldTypeDescriptions
    sourceJSON ObjectSet the data source of SEI information. The default value is empty.
    source.metadataBoolSet whether to pass in metadata-type SEI information.
  • true: Metadata-type SEI information is passed in.
  • (Default) false: Metadata-type SEI information is not passed in.
  • source.datastreamBoolSet whether to pass in Agora Datastream-type SEI information type.
  • true: Agora Datastream-type SEI information is passed in.
  • (Default) false: Agora Datastream-type SEI information is not passed in.
  • source.customizedJSON ObjectCustom SEI information. Custom SEI information is converted into Agora SEI information. The default value is empty.
    source.customized.prefixForAgoraSeiStringSet the payload prefix of SEI information. The maximum length is 32 characters, and the default value is blank.
    source.customized.payloadStringSet the payload of the SEI information. The maximum length is 4096 characters, and the default value is blank. When the SEI information is converted into Agora SEI information, the payload is corresponds to the app_data of the SEI.
    sinkJSON ObjectSet the attributes of the output SEI information. The default value is empty.
    sink.typeIntSet the payload type of the output SEI information. The default value is 100.
    vundefined