I am using red5 server 1.0.6
Some of my recorded files are broken, I have read in some articles that if a stream is closed before the bufferLength
of the stream is greater than 0
, the recorded file will be broken. This is my code for saving and closing the stream.
@Override public void streamPublishStart(IBroadcastStream stream) {
try {
/* My script to save started stream details in database */
stream.saveAs("audio/"+username, true);
}
catch (Exception e) {
e.printStackTrace();
}
}
@Override public void streamBroadcastClose(IBroadcastStream stream) {
/* My script to save closed stream details in database */
stream.close();
}
Is the stream.close()
reason for broken recordings? What happens if I don't close the stream?