How to record a transcoders output?

Some background: I have an RTSP stream coming into Wowza (configured via a .stream file). Afterward, this stream will be transcoded to HLS and broadcasted to a browser. While I have this flow working, I also want to trigger a recorder via an API call to the Wowza engine.

While this works in theory, the transcoding latency keeps the browser ~30 seconds behind the source stream. So essentially, what is seen on the browser is not what is recorded, rather what is happening in the source stream. To mitigate this, I would like to trigger a recording on either the re-streamed output or the transcoder output (whichever feature is available on Wowza).

I configured a transcoder (which get’s displayed in “incoming Streams”) but, calling a recorder on it, simply records its input (which is the same source stream). How can I instead make it record the output?

Thanks, @Karel Boek-Senior Consultant. Yes, your assumptions are correct, I will look into what you have suggested. Am I correct in assuming that Wowza does not directly support recording any transmuxed output (HLS or otherwise)? I have to do some transmuxing since the browser cannot play the source RTSP directly.

If you are using an App or software like VLC or other software-based players, you can use playback over SRT - this will allow you to control the latency of the stream, and you can get it in sync to a certain extent (presumably milliseconds). If you must use browser-based playback, then you can look into WebRTC. It won’t be as accurate as SRT, but at least you have low-latency (about 1 sec.) and that’ll give you a more accurate sync than HLS.

Since I am focusing on the browser, do you think DASH would have some latency improvement over using HLS?

@Uvin Withana, that is correct, Wowza does not support recording of transmuxed output. That will require a plug-in or 3rd party software.

Approx the same. There’s low-latency CMAF-streaming over MPEG-DASH and Apple LL-HLS, that’ll give you 3-5 seconds latency. But both of these aren’t production-ready AFAIK.

Thanks @Karel Boek-Senior Consultant. Regarding WebRTC, I understand it can be made to work in a LAN (and even without SSL/TLS encryption). Do you know if this is viable with Wowza as well?

There’s a difference between “transcoding” and “transmuxing”. The first is to convert the stream to a different audio or video format, or to change the bitrate and/or resolution of a stream (typically for use in ABR). The second one - also referred to as “packetizing” or “packaging” is to convert from one transport protocol to another (e.g. when your incoming stream uses RTMP and you want to convert to HLS)

In this case, I think you’re talking about “transmuxing”, correct? And do I understand that you want to record the HLS chunks?

If my assumptions are right, then there are no built-in features in Wowza Streaming Engine that can record the HLS output of a stream. However, it’s possible to develop a plug-in that can do it. There’s an article that includes a sample - the article itself is about SCTE, but it shows code where they write HLS output to disk.

Another option is to write a simple process of your own, running via Nginx, or a separate Node.js process that pulls the HLS output from Wowza and stores it to disk.

It seems to be a problem with HLS, that output streams are never in sync. So 2 different browsers can display the same HLS stream, with a few seconds out of sync. This same issue will plague whatever tool I use to record the stream, since the end-user will be using the browser’s output as a reference to when they want to start and stop recording. Given client-side recording is not an option, do you have any thoughts on this?