【问题标题】:Agora Unable to Start Cloud RecordingAgora 无法启动云录制
【发布时间】:2020-06-16 08:14:14
【问题描述】:
        options1 = {
            'method': 'POST',
            'url': 'https://api.agora.io/v1/apps/' + appID + '/cloud_recording/resourceid/' + resourceId + '/mode/2/start',
            'headers': {
                'Content-Type': 'application/json',
                'Authorization': 'Basic XXX'
            },
            body: JSON.stringify({
                "cname": "lol",
                "uid": "1",
                "clientRequest": {
                  "token": token,
                  "recordingConfig": {
                    "maxIdleTime": 30,
                    "streamTypes": 2,
                    "channelType": 0,
                    "videoStreamType": 0,
                    "transcodingConfig": {
                      "height": 640,
                      "width": 360,
                      "bitrate": 500,
                      "fps": 15,
                      "mixedVideoLayout": 1,
                      "backgroundColor": "#FF0000"
                    },
                    "subscribeVideoUids": [
                      "123",
                      "456"
                    ],
                    "subscribeAudioUids": [
                      "“123”",
                      "“456”"
                    ],
                    "subscribeUidGroup": 0
                  },
                  "recordingFileConfig": {
                    "avFileType": [
                      "hls"
                    ]
                  },
                  "storageConfig": {
                    "accessKey": config.writeAccessKeyId,
                    "region": 3,
                    "bucket": config.bucket,
                    "secretKey": config.writeSecretAccessKey,
                    "vendor": 1,
                    "fileNamePrefix": [
                      "directory1",
                      "directory2"
                    ]
                  }
                }
              })

        };

        request(options1, function (error, response, body) {
            if (error) throw new Error(error);
            console.log(response.statusCode);

我提到了 Agora 的云录制 API。身份验证和 resourceId 工作正常。 response.statusCode 始终为 404。无法找到错误。我在 Postman 上进行了测试,但 URL 也无法正常工作。我可以知道是否输入了错误的任何属性吗?用户是否必须先加入频道才能开始录制?

【问题讨论】:

    标签: api live-streaming agora.io agora-web-sdk-ng


    【解决方案1】:

    在您的 url 中,您指定了 mode/2/start。 它应该是模式/混合/开始。

    您可以参考此处的文档以获取更多信息: https://docs.agora.io/en/cloud-recording/cloud_recording_api_rest?platform=All%20Platforms#parameters-1

    【讨论】:

    • 我可以知道录制的视频是开始保存还是停止保存?
    • 它应该在开始时开始保存。
    • 我已经确保获取和启动的uid与频道中的用户不同。我还需要处理 transcodingConfig 之类的其他事情吗?
    • transcodingConfig 是可选的。
    • 是否可以使用不同的频道名称但相同的uid开始多个录制?
    【解决方案2】:

    云录制是否也适用于 Android 和 iOS?

    【讨论】:

    • 是否必须生成令牌才能开始云录制,而且我正在使用 AWS s3 服务进行云存储,所以我的供应商是 1,但我位于印度孟买,所以对agora docs 中的区域谁能帮我解决这个问题。
    • 这是强制性的。该区域将是 s3 区域,而不是您所在的区域。
    • 我从查询 api 得到响应为 {"resourceId":"resourceId Value","sid":"sidvaule","serverResponse":{"status":6,"fileList" :"","fileListMode":"string","sliceStartTime":0}}。但视频文件名不存在我没有得到什么磨损响应
    • 你可能想检查你在开始录制时传入的令牌
    • 我从节点 js 生成令牌,然后将其传递给启动 api 并获取此 {"resourceId":"resourceId Value","sid":"sidvaule","serverResponse":{"status" :6,"fileList":"","fileListMode":"string","sliceStartTime":0}}。但在某些情况下,我会得到这样的响应{“resourceId”:“rid”,“sid”:“sid”,“code”:404}。你能帮我解决这个问题吗
    猜你喜欢
    • 2021-12-31
    • 1970-01-01
    • 2021-12-09
    • 2021-09-02
    • 2023-03-30
    • 2022-08-06
    • 2022-08-16
    • 2021-11-27
    • 1970-01-01
    相关资源
    最近更新 更多