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?
flvmeta --check
can be used to diagnose such problems. It might tell you exactly how the file is broken. – Iceman0x00000000: fatal F11002: FLV signature not found in header 1 error(s), 0 warning(s)
– Giarla