Skip to main content
Linux C++
Linux Java

Individual Recording

The On-Premise Recording SDK supports two recording modes:

  • Individual recording mode: This is the default recording mode. The SDK generates one audio and/or video file for each UID.
  • Composite recording mode: Generates a single mixed audio and video file for all UIDs in a channel, or mixes the audio of all UIDs in the channel into an audio file and the video of all UIDs into a video file.

This page shows how to record audio and/or video in individual recording mode by the command line.

Before proceeding, ensure that you have compiled the Agora Recorder Demo and know how to record a call by the command line. For more information, see Record by Command Line. You must select either individual recording mode or composite recording mode when you start the recording. You cannot switch between the two modes after a recording starts.

See Differences between individual recording mode and composite recording mode to decide which mode you should use.

For simplicity, we assume that every UID in the channel sends both audio and video streams. If a UID neither sends audio nor video, such as the audience in interactive streaming, there will be no file for this UID.

Implementation

Individual recording mode is the default recording mode, and you can directly start recording.

In individual recording mode, the audio and video profiles of the recording file are as follows:

  • Audio profile: The sample rate of the recording file is 48 kHz, and the bitrate and number of audio channels of the recording file are the same as those of the original audio stream.
  • Video profile: The video profile of the recording file is the same as that of the original video stream.

The recording files and formats depend on your choice of recording audio, video, or both.

SettingRecording Files and Formats
Record only audioSet isAudioOnly as 1One audio file in AAC format for each UID
Record only video (no audio)Set isVideoOnly as 1
  • One video file in MP4 format for each UID that uses the Agora Native SDK
  • One video file in MP4 or WebM format for each UID that uses the Agora Web SDK
  • Record both audio and videoThe default setting
  • One audio file in AAC format and one video file in MP4 format for each UID that uses the Agora Native SDK
  • One audio file in AAC format and one video file in MP4 or WebM format for each UID that uses the Agora Web SDK
  • The format of the recording video file on the Web client depends on its codec:

    • If the codec is set as "vp9", the format is WebM.
    • If the codec is set as "h264", the format is MP4.

    Example

    The following example shows how to record only video (no audio) in a communication channel in individual recording mode.


    _1
    ./recorder_local --appId <Your App ID> --channel <The name of the channel to be recorded> --uid 0 --appliteDir ~/Agora_Recording_SDK_for_Linux_FULL/bin --isVideoOnly 1

    Considerations

    • If you want to merge each UID's audio and video files into one file, you can use our Transcoding Script.
    • In individual recording mode, file splitting may occur under certain conditions. For more information, see Why is the recording file split?
    • If you choose to record only video (no audio) or record both audio and video but a Web user in the channel does not send any video stream, a black video file will be generated for this user.
    vundefined