Updated on 2024-04-02 GMT+08:00

Background Music Recognition

Function

This API recognizes background music in videos and return the music names.

URI

URI format

POST /v1.0/bgm/recognition

Request Message

Table 1 describes the request parameters.
Table 1 Parameter description

Parameter

Mandatory

Type

Description

url

Yes

String

Indicates the URL of a video. Currently, URLs for temporarily authorized access to video files stored on OBS are supported.

Currently, only files in MP4 format are supported. The maximum file size is 65 MB.

Response Message

Table 2 describes the response parameters.
Table 2 Parameter description

Parameter

Type

Description

result

Object

Indicates the calling result when the API is successfully called.

This parameter is not included when the API fails to be called.

audio_name

String

Indicates the background music name.

error_code

String

Indicates the error code when the API fails to be called. For details, see Error Codes.

This parameter is not included when the API is successfully called.

error_msg

String

Indicates the error message when the API fails to be called.

This parameter is not included when the API is successfully called.

Examples

  • Example request
    POST https://image.ap-southeast-1.myhuaweicloud.com/v1.0/bgm/recognition
       
    Request Header:  
    Content-Type:application/json
    X-Auth-Token: MIINRwYJKoZIhvcNAQcCoIINODCCDTQCAQExDTALBglghkgBZQMEAgEwgguVBgkqhkiG...   
    Request Body:
    {
        "url": "https://BucketName.obs.myhuaweicloud.com/ObjectName"
    }
      
  • Example successful response
    {
    
       "result": {
          "audio_name": "my heart will go on"
       }
    }
  • Example failed response
    {
        "error_code": "AIS.0014",
        "error_msg": "The JSON format of the input data is incorrect."
    }

Return Value

  • Normal

    200

  • Abnormal

    Return Value

    Description

    400

    • The request cannot be understood by the server due to malformed syntax. The client should not repeat the request without modifications.
    • The request parameter is incorrect.

    401

    The request requires user authentication.

    403

    No operation permission.

    404

    The server has not found anything matching the Request-URI.

    500

    The server encountered an unexpected condition which prevented it from fulfilling the request.