media server logo

Nonstop recording amid stream interruptions

Jun 19, 2024

In this tutorial, we’ll explain how to maintain a single continuous recording of your stream in Callaba, even if your stream gets interrupted.

This technique is useful for handling unexpected network issues or when you need to update settings, like the bitrate, during the stream.

Using this lifehack will allow you to keep your live stream recordings in one piece, saving you the time and hassle of merging segments later.

About Callaba

Callaba is a streaming software that can stream, multi-stream, record, facilitate multi-lingual streaming, pay-per-view streaming, host video calls and more.

Subscribing to Callaba Cloud will take no more than 5 minutes.

🔹 Callaba on AWS’ Marketplace

📖 Step-by-step guide: How to Launch Callaba on AWS.

Video Recording setup

For this tutorial, we’re going to be using a simple set up in Callaba :

● 1. Create an SRT Server (to send and receive the videostream)

Go to SRT Server > Add New

  • Create a Name for your server
  • Publisher Port — use to send your stream to Callaba
  • Receiver Port — use to take/retrieve your stream from Callaba

● 2. Create a Recording process (to record the stream)

Go to Recording> Add New

  • Name the process
  • Input type : SRT Server
  • SRT Server : Select your SRT Server name from the list

● 3. Send your video stream to Callaba. 

To do that, go back to your SRT Server. Click “info” (i) icon. 

Copy SRT Publisher URL. Use it to send your stream.

● 3.1 Alternatively, you can use a Generated Test Video to test your setups if you don’t have a livestream at hand.

Go to Re-streaming > Add New

  • Name the process
  • Input type : Generate test video
  • Stream destination : SRT Output URL
  • Output Stream URL : copy and paste SRT Publisher URL of your SRT Server

Why recorded files split in the first place?

Ongoing live stream is essentially a flow of data packets that contain video frames, audio and other metadata.

When there is an interruption, this flow of packets stops for a while and thus gaps in the video appear.

When there’s a “gap” in the packet flow, the system initially waits briefly for the flow to resume. If the packets do not resume soon enough, the system will disconnect and stop recording — resulting in creation of a video file.

If after a while the stream starts coming again, the system starts recording a new file, separate from the previous one.

This is why and how recorded files gets splitted due to interruptions.

Lifehack : Protect Recorded Files from splitting

Now that you know the reasons why the splitting occurs, let’s make our recordings “splitting-proof”.

To do that, we’ll need to increase the period of time the system waits for the stream to continue.

Go to SRT Servers > open your SRT Server’s settings (click “Edit”).

Find the “Stream inactivity timeout” setting.

💡 By default, it is 20 seconds long — the system will wait 20 seconds for your stream to continue. If it does not resume within this time, the system will then disconnect.

Increase “Stream inactivity timeout” to be a sufficiently long time for most interruptions to resolve. 

60–90 seconds is usually enough to avoid most instances of file splitting, but you can set an even bigger value if you want to.

How this will affect the video file

As previously mentioned, splitting occurs due to gaps created when no incoming video packets are received.

So meanwhile your recorded file will remain unsplit, it will still miss a few seconds when the video frames were not coming. 

In practice, it will look like the video jumped forward.

We’ve demonstrated this phenomena in the video version of this tutorial. 

This concludes this short lifehack.

If you have any questions, you can contact us at [email protected], and we’ll respond within 48 hours.

Happy streaming!

Learn more

Follow us on social media

LinkedInRedditInstagramFacebookYoutubeX (Twitter)Discord