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.
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.
|Setting||Recording Files and Formats|
|Record only audio||Set
||One audio file in AAC format for each UID|
|Record only video (no audio)||Set
|Record both audio and video||The default setting|
The format of the recording video file on the Web client depends on its
- If the codec is set as "vp8", the format is WebM.
- If the codec is set as "h264", the format is MP4.
The following example shows how to record only video (no audio) in a communication channel in individual recording mode.
./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
- 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.