Talk to us
Talk to us
menu

Stream Recorder: How to Record Live Stream

Stream Recorder: How to Record Live Stream

If you’ve ever wanted to save a live stream for later viewing, a stream recorder can be a lifesaver. With a stream recorder, you can effortlessly record live streams. In this article, we’ll show you how to create a stream recorder to capture and store live streams for future viewing, so you never have to miss a moment. Enough of talks, let’s get to it!

ZEGOCLOUD Cloud Recording to Record Live Stream

With the rise of live streaming, missing out on an event can be frustrating. Luckily, ZEGOCLOUD Cloud Recording offers a solution. From capturing single-stream recordings to mixed-stream recordings with customizable layouts, whiteboard recordings, and even screenshots, this versatile platform makes it easy to record and manage your live streams. With ZEGOCLOUD Cloud Recording, you can enjoy your favorite live events on your own schedule.

zegocloud cloud recording

ZEGOCLOUD Cloud Recording is a powerful software development kit (SDK) that enables developers to easily integrate cloud recording capabilities into their live streaming applications. With this SDK, you can record and save live streams in the cloud, making them available for viewing later.

But what makes ZEGOCLOUD Cloud Recording stand out? Here are a few features of this SDK that make it an excellent choice for live stream recording:

1. Easy to Use

ZEGOCLOUD Cloud Recording is incredibly user-friendly and easy to integrate into your application. With detailed documentation and support, developers can quickly get up and running with cloud recording.

2. Reliable and Secure

The SDK is built on a highly secure and reliable cloud infrastructure, ensuring that your recorded streams are safe and accessible at all times.

3. Customizable

ZEGOCLOUD Cloud Recording is highly customizable, allowing developers to tailor the cloud recording solution to their specific needs. You can choose from different recording modes, bitrates, and other settings to achieve the desired outcome.

4. Cost-effective

With ZEGOCLOUD Cloud Recording, you can save costs by using cloud storage instead of local storage to store your recorded streams. Additionally, the SDK offers flexible pricing plans, making it accessible to developers of all sizes.

Preparation

How to Start Recording Live Stream with ZEGOCLOUD

Follow the steps below to record a live stream with ZEGOCLOUD’s Cloud Recording SDK:

1. Start Cloud Recording

Start cloud recording with ZEGO Cloud Recording by using the StartRecord method with a room ID. Receive a taskID (UID) to manage the recording process. This efficient method is ideal for educators, businesses, and content creators who want high-quality recordings.

2. Monitor Recording Status

Use the DescribeRecordStatus method to monitor your cloud recording progress. It returns the current recording status and upload address. This efficient method helps you keep track of your cloud recordings and ensure they’re saved correctly.

3. Update Mixed-Stream Layout

Use the UpdateLayout method to modify your video’s stream mixing layout in ZEGOCLOUD while recording. Refer to the Set Stream Mixing Layout feature for more information on editing the layout. Customize the way video streams are mixed and displayed during recording for greater control over the final output.

4. Update the Whiteboard

Use the UpdateWhiteboard method to update the Whiteboard ID during recording with ZEGOCLOUD. Refer to the Whiteboard Recording feature for more information. Record your whiteboard activities in real time and collaborate with others. Use the UpdateWhiteboard method to ensure accurate recording of the presented information.

5. End Cloud Recording

Putting an end to your cloud recording session with ZEGOCLOUD is as easy as calling the StopRecord method. This method immediately stops the recording process and saves your recorded video to your desired third-party cloud storage. With this feature, you can effortlessly produce high-quality recordings and store them safely for later use.

6. Managing Recorded Files

To effectively manage your recorded files with ZEGO Cloud Recording SDK, follow these steps. Check the DescribeRecordStatus method for uploading details like FileUrl, Status, and VideoId for Vod. The files will be automatically uploaded to your third-party cloud storage and trigger a callback to the specified URL. Manage file names with essential information using the OutputFileRule parameter in the StartRecord method.

Record Different Stream Types

1. Single Stream Recording

Initiate single-stream recording with ZEGO Cloud Recording SDK by setting RecordMode to 1 in StartRecord method and selecting the file format (mp4, flv, or hls) via OutputFileFormat parameter.

{
    "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. Recording Mixed-stream

Begin mixed-stream recording by selecting RecordMode as 2 and the file format (mp4, flv, or hls) through OutputFileFormat.

{
    "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

Modify video layout during mixed-stream recording by adjusting MixMode in StartRecord and making further changes with UpdateLayout method.

{
    "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

Activate whiteboard recording in mixed-stream mode by setting HasWhiteboard as true in StartRecord and customizing it with a JSON array. Note that only one whiteboard can be configured at a time.

{
    "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 . Capture Screenshots

Set OutputFileFormat it to jpg and adjust SnapshotInterval in StartRecord for capturing screenshots in the single-stream recording. The screenshot feature is not available in StreamType 1 or mixed-stream mode. Get task information using DescribeRecordStatus and receive callback notifications for completed tasks once the screenshots are uploaded to third-party cloud storage.

{
    "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"
    }
}

Conclusion

ZEGOCLOUD Cloud Recording SDK offers a user-friendly way to record live streams and customize the output. With features such as stream mixing layout and whiteboard recording, content creators have more control over their recordings. By using the ZEGOCLOUD SDK, businesses, educators, and creators can produce high-quality recordings that can be stored securely in their preferred third-party cloud storage.

Talk to Expert

Learn more about our solutions and get your question answered.

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.