Agora video recording: File recording being display only background. Not video and audio

167 Views Asked by At

We create online events and use agora to communicate ( agora rtc ).
But when recording the event with agora, it only shows the background in video record
enter image description here

All steps to create channel by agora SDK web:

  1. I create rtc token ( ruby on rails gem agora_dynamic_key )
{
 app_id: @app_id,
 app_certificate: ENV['AGORA_CERTIFICATE'],
 channel_name: @channel_name,
 uid: 0,
 role: AgoraDynamicKey::RTCTokenBuilder::Role::PUBLISHER,
 privilege_expired_ts: EXPIRATION_TIME_IN_SECONDS
}
  1. All my client join channel agora
agoraEngine.join(appId, channel, token, uid)
  1. I check list users in the channel by "https://api.agora.io/dev/v1/channel/user/#{@app_id}/#{@channel_name}"
    This return two uses ids ( 45, 201 )
  2. acquire_recording ( mode mix )
body: {
        cname: @channel_name,
        uid: "45",
        clientRequest: {
          region: 'AP',
          resourceExpiredHour: 24,
          scene: 0,
        }
      }
  1. start_recording
{
        cname: @channel_name,
        uid: "45",
        clientRequest: {
          token: signature,
          recordingConfig: {
            maxIdleTime: 30,
            streamTypes: 2,
            audioProfile: 1,
            channelType: 0, 
            videoStreamType: 0,
            transcodingConfig: {
              width: 640,
              height: 360,
              fps: 15,
              bitrate: 400,
              mixedVideoLayout: 1,
              backgroundColor: "#FF0000",
            },
            subscribeVideoUids: [
              "45", "201"
            ],
            subscribeAudioUids: [
              "45", "201"
            ],
            subscribeUidGroup: 0
          },
          recordingFileConfig: {
            avFileType: [
              "hls",
              "mp4"
            ],
          },
          storageConfig: {
            vendor: AMAZON_S3,
            region: AP_SOUTHEAST_1,
            bucket: ENV['BUCKET_NAME'],
            accessKey: ENV['AWS_ACCESS_KEY_ID'],
            secretKey: ENV['AWS_SECRET_ACCESS_KEY'],
            fileNamePrefix: ["agoraRecording", "eventId#{@event.id}"],
          }
        },
      }
  1. Stop recording
{
        cname: @channel_name,
        uid: "45",
        clientRequest: {
          async_stop: false,
        }
      }

When all steps are success
enter image description here
Open file .m3u8 by VLC media player
Just display like this

enter image description here
Only background, no video, no audio
Even though user 45 shared the screen and mic

0

There are 0 best solutions below