Location>code7788 >text

How do I implement recording video conferences on the server side?

Popularity:782 ℃/2024-10-28 14:43:02

With the remote office and off-site collaboration is more and more frequent, the use of video conferencing system is also more and more common. At the same time, users of video conferencing system features also put forward higher requirements, for example, one of them is the hope that the entire video conferencing process can be recorded, in order to prepare for later access to watch.

We can choose to record the whole video conference process on the server side or client side of the video conference system, and there are advantages and disadvantages of recording on the server side and recording on the client side. For example, recording on the server requires a higher server configuration because there may be many meetings recorded at the same time; while recording on the client side, the recorded file is stored on the client's local computer, and can only be played locally, and if other people need to watch it, they need to upload the file to the server after the recording is completed.

The technical principles are the same whether you record on the server side or on the client side. Here's what I'm going to doOrad Video Conferencing(OrayMeeting) on the server side (Windows, Linux, CCTV domestic OS, Galaxy Kirin, Unicorn UOS) to record the technical principles and implementation of the meeting process is introduced to you.

The following picture is the effect of a conference recording file played using QQ Video:

Next, we'll explain exactly how Orad's video conferencing enables meeting recording.

I. Description of the recording process

(1) The Conference Information Center contains a field that indicates whether recording is turned on for this conference.

(2) When the first person enters the conference, the recording is initiated.

(3) When it is time for the meeting to end: if there is no one in the meeting room, this immediately ends the recording; if there are still people in the meeting room, end the recording when the last person exits.

(3) Any time the moderator ends the session, the recording will end at the same time.

(4) If there is no one in the meeting room in the middle of the session, the recording will be paused; when someone enters the meeting again, the recording will be resumed.

II. Screen Layout of Omnicom Conference Recording

(1) At the top of the recording screen, there is a line with a 30px high title bar, which will display the following information in real time: the name of the meeting, the system time, and the number of participants.

(2) The remaining area below the title bar is the content area, which is used for rendering user videos/avatars, or for rendering desktop images of users sharing the screen.

(3) When the number of participants does not exceed four, a 2x2 four-panel grid is used; when the number of participants is more than four, a 3x3 nine-panel grid is used.

(4) Renders videos or avatars of up to 9 people (3x3) while recording, with users with video turned on at the top of the list, followed by users with microphone turned on.

(5) If the user has video turned on, its video image is rendered when recording, otherwise, the user's default avatar is rendered.

(6) If one of the attendees has screen sharing turned on, the content area of this recording screen will no longer render the user's video/avatar, but will instead render the desktop image of the screen being shared.

III. Technical elements of program implementation ......................

(1) Acquire PCM sound data and RGB image data of participants.

utilizationOMCS MicrophoneConnector and DynamicCameraConnector are provided to capture the voice data and image data of each participant.

(2) Splice and render the video image frames to be recorded

Stitching and rendering of recorded image frames can be accomplished using GDI+ technology on Windows and Skia technology on Linux.

if (desktopShare) //If someone shares a desktop, this body content area is the desktop image
{
    //Get the latest desktop image frames for screen sharing
    Image image = this.(null);
    (image);
}
else
{
    for (int i = 0; i < ; i++)
    {
        string userID = recordMembers[i];
        Image image = null;
        if (!(userID))
        {
            //Get the latest video image frames of participating members
            image = this.(userID);
        }
        
        DrawInfo renderModel = this.(userID);
        (image);
        (!(userID));
    }
    //Drawing the main content area
    (this.());
}
byte[] bytes = (); //Prepare the image to be recorded
if (bytes != null)
{
    this.videoFileMaker?.AddVideoFrame(bytes); //Submit to Recorder    
}

(3) Mixing

Using the MicrophoneConnectorMixer provided by OMCS it is possible to mix the voices of the participants all the way through.

IConnectorManager connectorManager = new OMCSConnectorManager(globalCache);
 += ConnectorManager_AudioMixed;

private void ConnectorManager_AudioMixed(string userID, byte[] data)
{
    if (recording && data != null)
    {
        this.videoFileMaker?.AddAudioFrame(data);  //Submit mix data to the recorder
    }
}

(4) Timer

Use timers to schedule sound data and image data. For example, every 10 milliseconds a frame of voice data is fetched from each MicrophoneConnector and they are mixed. Every 40 milliseconds, the corresponding image data is fetched from each DynamicCameraConnector, stitched together, and rendered according to the screen layout described earlier.

//Open a recording thread and call it at regular intervals
internal void StartRecord()
{
    recording = true;
    Task.(() =>
    {
        RecordThread();
    });
}

private void RecordThread()
{
    int sleepSeconds = 1000 / frameRate;
    while (true)
    {
        .Thread.Sleep(sleepSeconds);
        //record ...
    }
}

(5) Encode image frames and sound frames and generate MP4 files.

Submit the mixed sound data, stitched rendered images to theMFileMFile will encode them and write them to the MP4 file.

At the end of the session, the recording will end and the associated resources will be released.

internal void FinishRecord()
{
    recording = false;
    //Release microphone, camera, desktop device connectors
    ();
    //Release Recorder
    videoFileMaker?.Close(true);
}

IV. Concluding remarks

After the process of recording the meeting, the screen layout, the technical points made a brief introduction, I believe that you have a preliminary understanding of the video conferencing server in the program how to achieve the function of recording the meeting.

This article is just a rough introduction to the principle of video conferencing recording and technical implementation, if you have more specific implementation details need to know, welcome to discuss with me.