Skip to content
Snippets Groups Projects
Commit 4291dce4 authored by Richard Alam's avatar Richard Alam
Browse files

- add timestamp on filename so it will be unique

parent 12c5b34c
No related branches found
No related tags found
No related merge requests found
......@@ -110,13 +110,14 @@ public class VideoApplication extends MultiThreadedApplicationAdapter {
* @param stream
*/
private void recordStream(IBroadcastStream stream) {
IConnection conn = Red5.getConnectionLocal();
String streamName = stream.getPublishedName();
IConnection conn = Red5.getConnectionLocal();
long now = System.currentTimeMillis();
String recordingStreamName = stream.getPublishedName() + "-" + now;
try {
log.info("Recording stream " + streamName + " " + System.currentTimeMillis());
try {
log.info("Recording stream " + recordingStreamName );
ClientBroadcastStream cstream = (ClientBroadcastStream) this.getBroadcastStream(conn.getScope(), stream.getPublishedName() );
cstream.saveAs(streamName, false);
cstream.saveAs(recordingStreamName, false);
} catch(Exception e) {
log.error("ERROR while recording stream " + e.getMessage());
e.printStackTrace();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment