logo
Voice Call
Server API
Stream Mixing and Transcoding APIs
On this page

SearchMedia

GET

https://rtc-api.zego.im/

When users perform CDN recording, the recorded media files are stored on CDN servers. Users can call this interface to query information about their media files, such as media file name, creation time, etc.

Warning

Before using this interface for the first time, please confirm whether the CDN live service has been activated. If not activated, please go to ZEGOCLOUD Console to activate it yourself. For details, please refer to Console - Service Configuration - CDN, or contact ZEGO technical support to activate it.

Call frequency limit
For all rooms under the same AppID: 20 times/second

Request

Query Parameters

    Action stringrequired

    Possible values: [SearchMedia]

    Interface prototype parameters

    https://rtc-api.zego.im?Action=SearchMedia

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Common parameter. A 16-character hexadecimal random string (hex-encoded 8-byte random number). For the generation algorithm, refer to the signature example.

    Timestamp int64required

    💡Common parameter. Current Unix timestamp in seconds. For the generation algorithm, refer to the signature example. A maximum deviation of 10 minutes is allowed.

    Signature stringrequired

    💡Common parameter. Signature used to verify the legitimacy of the request. Please refer to the signature mechanism to generate it.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    Vendor stringrequired

    Possible values: [Tencent, Ws, Huawei]

    Possible values and corresponding CDN providers:

    • Tencent: Tencent Cloud.
    • Ws: Wangsu.
    • Huawei: Huawei Cloud.
    NamePrefix string

    File name prefix, which matches media file names by prefix, supporting up to 20 bytes.

    Note:

    When using this parameter, URL encoding (UrlEncode) must be performed on its content.

    StartTime int

    Start time for searching files (file creation time), Unix timestamp, accurate to seconds.

    This parameter is only valid when Vendor is set to Tencent.

    EndTime int

    End time for searching files (file creation time), Unix timestamp, accurate to seconds.

    This parameter is only valid when Vendor is set to Tencent.

    PageSize int

    Number of records to return, default value is 10. Value range: PageNumber * PageSize + PageSize must not exceed 5000.

    This parameter is only valid when Vendor is set to Tencent.

    PageNumber int

    Which page to retrieve. Value range: PageNumber * PageSize + PageSize must not exceed 5000.

    This parameter is only valid when Vendor is set to Tencent.

    FileId string[]

    Possible values: >= 1, <= 10

    List of file IDs, supporting up to 10 FileIds, with a maximum length of 40 characters for each FileId.

    This parameter is only valid when Vendor is set to Tencent.

    StreamId string[]

    Possible values: >= 1, <= 10

    List of stream IDs for CDN recording, supporting up to 10 StreamIds, matching any element in the collection.

    This parameter is only valid when Vendor is set to Tencent.

    Marker string

    Marker for retrieving information. When this parameter is not filled, the first page of retrieved information is returned by default.

    1. When calling this interface for the first time, leave the Marker parameter empty.
    2. When calling this interface again, set the Marker parameter to NextMarker (the marker information in the returned result).

    Each time this interface is called, the response will return NextMarker, and developers need to determine whether the last page has been reached.

    This parameter is valid when Vendor is set to Ws or Huawei.

    MaxKeys integer

    Possible values: >= 1 and <= 1000

    Default value: 1000

    Maximum number of records returned in a single call, value range [1, 1000], default is 1000.

    For information lists exceeding the MaxKeys value, you need to call this interface again based on the NextMarker value from the previous call.

    This parameter is valid when Vendor is set to Ws or Huawei.

Responses

Success
Schema
    Code number

    The following only lists some return codes related to the interface business logic. For complete return codes, please refer to Global Return Codes.

    Return CodeDescriptionSuggested Action
    0Request successful.-
    2Output parameter error.-
    3Relevant permissions not activated.Please contact ZEGO technical support.
    4CDN type mismatch.Please check parameters.
    5Configuration error.Please contact ZEGO technical support.
    6Request too frequent.Please try again later.
    7Authentication failed.Please check if authentication parameters are correct.
    8Failed to get authentication configuration.Please contact ZEGO technical support to confirm if this service is activated.
    1000Request failed.Please contact ZEGO technical support.
    Message string

    Description of operation result.

    RequestId string

    Request ID, returned by ZEGO server.

    Data object
    Response data.
    Tencent object
    Tencent Cloud return content (returned when Vendor is Tencent).
    RequestId string

    Unique request ID, returned by the CDN provider corresponding to the Vendor parameter value (i.e., Tencent). This RequestId needs to be provided when troubleshooting problems.

    TotalCount number

    Total number of records matching the search criteria. Maximum value is 5000. When the number of matching records exceeds 5000, this parameter will return 5000 instead of the actual total.

    MediaInfoSet object[]
    List of media file information.
  • Array[
  • FileId string

    Unique file identifier, which is the FileID in the Recording File Generation Callback.

    BasicInfo object
    Basic information, including video name, category, playback URL, cover image, etc.
    Name string

    Media name.

    Description string

    Media file description.

    CreateTime string

    Creation time of the media file, using "ISO date format".

    UpdateTime string

    Last update time of the media file (operations such as modifying video properties or initiating video processing will trigger updates to media file information), using "ISO date format".

    ExpireTime string

    Expiration time of the media file, using "ISO date format". After expiration, the media file and its related resources (transcoding results, sprites, etc.) will be permanently deleted. "9999-12-31T23:59:59Z" means never expires.

    ClassId number

    Category ID of the media file.

    ClassName string

    Category name of the media file.

    ClassPath string

    Category path of the media file, separated by "-", such as "New Level 1 Category - New Level 2 Category".

    CoverUrl string

    Cover image URL of the media file.

    Type string

    Container format of the media file, such as mp4, flv, etc.

    MediaUrl string

    URL address of the original media file.

    SourceInfo object
    Source information of the media file.
    SourceType string

    Source type.

    SourceContext string

    Source stream.

    StorageRegion string

    Storage region of the media file, such as ap-guangzhou.

    Vid string

    Unique identifier of the live recording file.

    Category string

    File type.

    • Video: Video file.
    • Audio: Audio file.
    • Image: Image file.
    Status string

    File status.

    • Normal: Normal.
    • Forbidden: Banned.
    StorageClass string

    Storage class of the file.

    • STANDARD: Standard storage.
    • STANDARD_IA: Infrequent access storage.
    • ARCHIVE: Archive storage.
    • DEEP_ARCHIVE: Deep archive storage.
    TranscodeInfo object
    Information related to media file transcoding results, including file address, specification, bitrate, resolution, etc. after transcoding.
    TranscodeSet object[]
    Collection of media file transcoding information, each element represents 1 transcoding result.
  • Array[
  • Url string

    Address of the transcoded video file.

    Definition integer

    Transcoding specification ID, value 0 indicates the original file.

    Bitrate integer

    Sum of the average value of "video stream bitrate" and the average value of "audio stream bitrate", unit: bps.

    Height integer

    Maximum value of video stream height, unit: px.

    Width integer

    Maximum value of video stream width, unit: px

    Size integer

    Total size of the media file, unit: bytes. When the media file is HLS, the size is the sum of m3u8 and ts file sizes.

    Duration float

    Video duration, unit: seconds.

    Md5 string

    MD5 value of the video.

    Container string

    Container type, such as m4a, mp4, etc.

    VideoStreamSet object[]
    Video stream information.
  • Array[
  • Bitrate integer

    Bitrate of the video stream, unit: bps.

    Height integer

    Height of the video stream, unit: px.

    Width integer

    Width of the video stream, unit: px.

    Codec string

    Encoding format of the video stream, such as h264.

    Fps integer

    Frame rate, unit: hz.

    CodecTag string

    Encoding tag, only valid when Codec is hevc.

    DynamicRangeInfo object
    Dynamic range information of the picture.
    Type string

    Dynamic range information of the picture.

    • SDR: Standard Dynamic Range.
    • HDR: High Dynamic Range.
    HDRType string

    High dynamic range type standard, valid when Type is HDR.

    • hdr10
    • hlg
  • ]
  • AudioStreamSet object[]
    Audio stream information.
  • Array[
  • Bitrate integer

    Bitrate of the audio stream, unit: bps.

    SamplingRate integer

    Sampling rate of the audio stream, unit: hz.

    Codec string

    Encoding format of the audio stream, such as aac.

  • ]
  • DigitalWatermarkType string

    Digital watermark type.

    • Trace: Indicates traceability watermark processing.
    • CopyRight: Indicates copyright watermark processing.
    • None: Indicates no watermark processing.
    CopyRightWatermarkText string

    Copyright information.

  • ]
  • ]
  • Huawei object
    Huawei Cloud return content (returned when Vendor is Huawei).
    NextMarker string

    Index for the next retrieval. Pass this to the Marker parameter in the next call to this interface.

    Keys object[]
    List of media file information.
  • Array[
  • ETag string

    MD5 value of the media file.

    Key string

    Unique identifier of the media file, which is the ObsObject in the Recording File Generation Callback.

    LastModified string

    Last modification time of the media file.

    Size number

    Size of the media file.

    MediaUrl string

    Address of the media file.

  • ]
  • Ws object
    Wangsu Cloud return content (returned when Vendor is Ws).
    NextMarker string

    Index for the next retrieval. Pass this to the Marker parameter in the next call to this interface.

    Keys object[]
    List of media file information.
  • Array[
  • ETag string

    MD5 value of the media file.

    Key string

    Unique identifier of the media file, which is the PersistentId in the Recording File Generation Callback.

    LastModified string

    Last modification time of the media file.

    Size number

    Size of the media file.

    MediaUrl string

    Address of the media file.

  • ]

Previous

StopCDNRecord

Next

DeleteMedia

On this page

Back to top