Question
Record live stream with different name
Hi all!
I have a live streaming application running with FMS2 and I have come across an issue with recording streams. My application allows a client (from a pool of multiple clients) viewing the stream to record the stream to the FMS server. I start the recording on the server side with the following (simplified) code:
application.recordStream = Stream.get(instanceName);
if (blnRecord)
{
// start recording
application.recordStream.record();
}
else
{
// stop recording
application.recordStream.record(false);
}
There is something that I'm having trouble with though - is there a way to record the stream with a different (unique) name rather than the instance name? I ask this because I need to have different names for each different recording session. Using file.renameTo( ) after the recording finishes works in theory, but in practice it seems that the recorded file is buffered before it is written to disk. So when the application.recordStream.record(false); line is invoked, trying to rename the file now is not possible, as it's still being written to the disk. It seems there is no way to know when the final, complete file has finally been written to the disk.
The problem here is that once the first recording is finished, another user can start the record process again. If the file has not been renamed or moved, the previous recording will be overwritten!
So, is it possible to record a stream, but save it to disk with a unique name?
Thanks in advance,
K.
I have a live streaming application running with FMS2 and I have come across an issue with recording streams. My application allows a client (from a pool of multiple clients) viewing the stream to record the stream to the FMS server. I start the recording on the server side with the following (simplified) code:
application.recordStream = Stream.get(instanceName);
if (blnRecord)
{
// start recording
application.recordStream.record();
}
else
{
// stop recording
application.recordStream.record(false);
}
There is something that I'm having trouble with though - is there a way to record the stream with a different (unique) name rather than the instance name? I ask this because I need to have different names for each different recording session. Using file.renameTo( ) after the recording finishes works in theory, but in practice it seems that the recorded file is buffered before it is written to disk. So when the application.recordStream.record(false); line is invoked, trying to rename the file now is not possible, as it's still being written to the disk. It seems there is no way to know when the final, complete file has finally been written to the disk.
The problem here is that once the first recording is finished, another user can start the record process again. If the file has not been renamed or moved, the previous recording will be overwritten!
So, is it possible to record a stream, but save it to disk with a unique name?
Thanks in advance,
K.
