T K
T K

Reputation: 11

Agora Recording Service Query returning recording status 6 right after start

I'm trying to record a video call using the Agora APIs.

To do this I've follow Agora's documentation and created the following steps:

  1. Get a recording resources - working
axios.post(`https://api.agora.io/v1/apps/${appId}/cloud_recording/acquire`, {
            cname: cname, 
            uid: uid.toString(),
            clientRequest: {
              region: "NA",
              resourceExpiredHour: 24
            },
          },
          {
            headers: {
              'Authorization': authorizationField,
              'Content-Type': 'application/json'
            }, 
          })
  1. Start the recording - working
axios.post(`https://api.agora.io/v1/apps/${appId}/cloud_recording/resourceid/${resourceId}/mode/mix/start`, {
              cname: cname,  
              uid: uid.toString(),
              clientRequest: {
                token: token, // token from token server
                recordingConfig: {
                  channelType: 0, // set for non live broadcast
                  streamTypes: 2, // subscribes both audio and video streams
                  decryptionMode: 0, // the default setting 
                  audioProfile: 0, // default setting
                  videoStreamType: 0, // default setting
                  maxIdleTime: 30, // after 30sec of no users, recording stops 
                  transcodingConfig: {
                    width: 720, // default
                    height: 1280, // default
                    fps: 15, // default
                    bitrate: 500, // default
                    mixedVideoLayout: 1, // grid layout 
                    backgroundColor: "#000000", // black background color
                  },
                  subscribeUidGroup: 0, // setup for recording 1-2 users
                },
                recordingFileConfig: {
                  "avFileType": [
                    "hls",
                    "mp4",
                  ],
                },
                storageConfig: {
                  vendor: 1, //amazon 
                  region: 3, // amazon US_WEST_2
                  bucket: "agora-practice-recording-storage",
                  accessKey: "*****************",                 
                  secretKey: "*****************",
                },
              },
            },
            {
              headers: {
                'Authorization': authorizationField,
                'Content-Type': 'application/json'
              }, 
            })
  1. Query the status - kinda working - returning status 6 before stop method is ever called/no files in filesList[]
axios.get(`https://api.agora.io/v1/apps/${appId}/cloud_recording/resourceid/${resourceId}/sid/${sId}/mode/mix/query`,
              {
                headers: {
                  'Authorization': authorizationField,
                  'Content-Type': 'application/json'
                }, 
              })
              .then(function (response) {
                console.log("Query Response", response.data.serverResponse);
              })
              .catch(function (error) {
                console.log("Query Error", error, authorizationField);
              });
            })

the response is: ​

    serverResponse: {
        status: 6,
        fileList: [],
        fileListMode: "string",
        sliceStartTime: 0
    }
  1. This leads the stop method to not work and return 404.

I was expecting the query status to return 5 and fileList[] to be populated with the file name of the recording. I was expecting the stop method to work.

Upvotes: 1

Views: 185

Answers (0)

Related Questions