Copy link to clipboard
Copied
We are using the dvrcast application. I've modified application.onPublish() to call onStartRecord() on the stream object so that recording automatically starts immediately. Correspondingly it calls onStopRecord() in application.onUnpublish(). Thre problem is the code looks like this:
var strm = application.getStream(streamFullName, true);
strm.publish(client);
strm.onStartRecord();
And similarly in the onUnpublish, it's also using application.getStream(streamFullName).
The problem is when the network drops between the encoder and AMS. I've modified ExDVRStream to ensure it will always record in append mode. This should ensure that streams recover gracefully and recording picks up where it left off. However, there seems to be some kind of race condition because I see onStartRecord() called in the log, followed immediately by onStopRecord(). I am guessing it's calling application.getStream() to clean up the old stream of the same name, and that's why onStopRecord() is being called.
Is there a way to gracefully handle stream dropouts?
Thanks