Talk to us
Talk to us
menu

Video Recorder: How to Record Video

Video Recorder: How to Record Video

Are you in need of a user-friendly and dependable video recording solution? ZEGOCLOUD video recorder is your answer. With flexible recording modes, personalized layouts, and automated cloud storage, ZEGOCLOUD is the ideal option for all your video recording requirements. Whether it’s a single-stream or mixed-stream recording, it has got you covered. Begin recording your videos now with ZEGOCLOUD and never miss a moment.

ZEGOCLOUD Cloud Recording to Record Video

ZEGOCLOUD offers a versatile cloud recording solution known as ZEGOCLOUD Cloud Recording SDK, that allows users to easily capture and store video content for various use cases.

zegocloud cloud recording

With its user-friendly interface and powerful features, ZEGOCLOUD makes it easy for anyone to record and store high-quality video content in the cloud.

1. Multiple Recording Modes

ZEGOCLOUD’s cloud recording SDK supports various recording modes, including single-stream recording and mixed-stream recording. With single-stream recording, users can record a single stream of video content, while mixed-stream recording allows users to capture multiple streams of video content and combine them into a single output file.

2. Customizable Layouts

With ZEGOCLOUD, users can customize the layout of their video content to match their specific needs. The SDK provides a MixMode parameter that enables users to adjust the layout of the recorded content. Additionally, users can also specify the format of the output file, choosing between mp4, flv, and hls.

3. Whiteboard Recording

ZEGOCLOUD’s cloud recording SDK also supports whiteboard recording, enabling users to capture whiteboard content along with their video content. Users can specify the configuration of the whiteboard using an array in JSON format.

4. Screenshot Capture

In addition to recording video content, ZEGOCLOUD’s cloud recording SDK also supports screenshot capture. Users can set the OutputFileFormat parameter to jpg and specify the SnapshotInterval to take screenshots at regular intervals. The captured screenshots are automatically uploaded to the user’s third-party cloud storage and can be accessed through a callback notification.

How to Start Recording Video with ZEGOCLOUD SDK

This section is the most exciting part where we will learn how to use the ZEGO Cloud Recording SDK in our video call applications. Let’s dive right into it!

Preparation

Steps on How to Start Recording Video with ZEGOCLOUD SDK

To initiate HD video call recording using ZEGO Cloud Recording, follow the steps given below:

1. Start Cloud Recording

To begin cloud recording using ZEGO Cloud Recording, you can use the StartRecord method along with a room ID to join a specific room. After successfully calling the method, you can obtain the taskID (UID) from the response, and the body proceeds with the recording process.

2. View Recording Status

To check the progress of your cloud recording, repeatedly call the DescribeRecordStatus method. The response body contains the current recording status and uploads the address upon successful execution.

3. Modify Mixed-Stream Layout

Modify your video’s stream mixing layout while recording with ZEGOCLOUD by repeatedly using the UpdateLayout method. For more information on editing stream mixing layout, refer to the Set Stream Mixing Layout feature.

4. Update the Whiteboard

To update the Whiteboard ID during recording, use the UpdateWhiteboard method repeatedly. For more information on Whiteboard Recording, please refer to the relevant feature.

5. Stop Cloud Recording

To stop cloud recording, use the StopRecord method. This will end the recording process and save the recorded video to your third-party cloud storage.

6. Managing Recorded Files

Follow the steps below to manage your recorded files in the ZEGO Cloud Recording SDK.

Upload recorded files

Upon completion of the cloud recording task, the recorded files are uploaded to the designated third-party cloud storage. To review uploading details, utilize the DescribeRecordStatus method.

FileUrl: Provides the URL for uploaded recorded files.

Status: Reports the uploading status of the recorded files.

VideoId: Vod returns the VideoId recorded files.

Once the recorded files are uploaded, the cloud recording triggers a callback to the specified callback URL.

Manage recorded file names

The name of the recording file contains critical data, including the StreamId and start recording timestamp. For detailed information, review the OutputFileRule parameter specified in the StartRecord method.

How to Record Different Types of Streams

After discussing the fundamental concepts of cloud recording, let’s now explore the practical aspects of recording streams using the ZEGOCLOUD Cloud Recording SDK.

1. Recording a Single Stream

To begin single-stream recording, set RecordMode to 1 in StartRecord and select the desired file format (mp4, flv, or hls) using the OutputFileFormat parameter.

Here’s a sample request:

{
    "RoomId": "xxxx",
    "RecordInputParams": {
        "RecordMode": 1,
        "StreamType": 3,
        "MaxIdleTime": 60
    },
    "RecordOutputParams": {
        "OutputFileFormat": "mp4",
        "OutputFolder": "record/"
    },
    "StorageParams": {
        "Vendor": 2,
        "Region": "oss-xxxx",
        "Bucket": "xxxx",
        "AccessKeyId": "xxxx",
        "AccessKeySecret": "xxxx"
    }
}

2. Mixed-stream Recording

To start mixed-stream recording, set RecordMode parameter to 2 and choose mp4, flv, or hls as the OutputFileFormat parameter.

See an example below:

{
    "RoomId": "xxxx",
    "RecordInputParams": {
        "RecordMode": 2,
        "StreamType": 3,
        "MaxIdleTime": 60,
        "MixConfig": {
            "MixMode": 2,
            "MixOutputStreamId": "mix",
            "MixOutputVideoConfig": {
                    "Width": 1280, 
                    "Height": 720, 
                    "Fps": 15, 
                    "Bitrate": 1130000
            }
        }
    },
    "RecordOutputParams": {
        "OutputFileFormat": "mp4",
        "OutputFolder": "record/"
    },
    "StorageParams": {
        "Vendor": 2,
        "Region": "oss-xxxx",
        "Bucket": "xxxx",
        "AccessKeyId": "xxxx",
        "AccessKeySecret": "xxxx"
    }
}

3. Define Mixed-Stream Layout

During mixed-stream recording, you can define the video layout by setting the MixMode parameter in StartRecord and make further adjustments using the UpdateLayout method.

Take a look at the following sample request for UpdateLayout:

{
    "TaskId": "xxxx",
    "MixMode": 1,
    "MixInputList": [
        {
            "StreamId": "xxxx", 
            "ViewType": 1, 
            "Top": 0, 
            "Left": 0, 
            "Bottom": 720, 
            "Right": 540, 
            "Layer": 1
        },
        {
            "StreamId": "", 
            "ViewType": 1, 
            "Top": 0, 
            "Left": 540, 
            "Bottom": 360, 
            "Right": 1080, 
            "Layer": 1
        },
        {
            "StreamId": "", 
            "ViewType": 1, 
            "Top": 360, 
            "Left": 540, 
            "Bottom": 720, 
            "Right": 1080, 
            "Layer": 1
        }
    ]
}

4. Multi-sector recording

To activate whiteboard recording during mixed-stream recording, set the HasWhiteboard parameter to true when calling StartRecord. You can configure the whiteboard by using a JSONarray of whiteboard settings, but only one whiteboard can be set at a time.

Here’s a sample request for enabling whiteboard recording in mixed-stream mode:

{
    "RoomId": "xxxx",
    "RecordInputParams": {
        "RecordMode": 2,
        "StreamType": 3,
        "HasWhiteboard": true,
        "Whiteboard": [
            {
                "HorizontalRatio": 16,
                "VerticalRatio": 9,
                "Width": 1280,
                "Height": 720,
                "WhiteboardId": "0000"
            }
        ],
        "MaxIdleTime": 60,
        "MixConfig": {
            "MixMode": 3,
            "MixOutputStreamId": "mix",
            "MixOutputVideoConfig": {
                    "Width": 1280, 
                    "Height": 720, 
                    "Fps": 15, 
                    "Bitrate": 1130000
            }
        }
    },
    "RecordOutputParams": {
        "OutputFileFormat": "mp4",
        "OutputFolder": "record/"
    },
    "StorageParams": {
        "Vendor": 2,
        "Region": "oss-xxxx",
        "Bucket": "xxxx",
        "AccessKeyId": "xxxx",
        "AccessKeySecret": "xxxx"
    }
}

5 . Take Screenshots

To take screenshots during single-stream recording, specify the jpg format for OutputFileFormat and adjust the SnapshotInterval parameter as required in the StartRecord method. Note that screenshots cannot be captured in mixed-stream mode or for StreamType 1. You can use the DescribeRecordStatus method to retrieve task information, and once the screenshots are captured, they will be uploaded to your third-party cloud storage, with callback notifications for each completed task.

{
    "RoomId": "xxxx",
    "RecordInputParams": {
        "RecordMode": 1,
        "StreamType": 3,
        "MaxIdleTime": 60
    },
    "RecordOutputParams": {
        "OutputFileFormat": "jpg",
        "OutputFolder": "record/",
        "SnapshotInterval": 10
    },
    "StorageParams": {
        "Vendor": 2,
        "Region": "oss-xxxx",
        "Bucket": "xxxx",
        "AccessKeyId": "xxxx",
        "AccessKeySecret": "xxxx"
    }
}

For more details on how to use ZEGO Cloud Recording SDK, please visit the SDK’s documentation.

Conclusion

ZEGOCLOUD provides an easy-to-use and versatile solution for all your video recording needs. With its various recording modes, customizable layouts, and cloud storage capabilities, ZEGOCLOUD SDK is the perfect choice for developers seeking a powerful and reliable video recording platform. Start recording your videos today with ZEGOCLOUD and enjoy the benefits of seamless cloud recording.

Let’s Build APP Together

Start building with real-time video, voice & chat SDK for apps today!

Talk to us

Take your apps to the next level with our voice, video and chat APIs

Free Trial
  • 10,000 minutes for free
  • 4,000+ corporate clients
  • 3 Billion daily call minutes

Stay updated with us by signing up for our newsletter!

Don't miss out on important news and updates from ZEGOCLOUD!

* You may unsubscribe at any time using the unsubscribe link in the digest email. See our privacy policy for more information.