Can storing a live stream using actionscript fail by the cache filling up with overhead?
Hi,
Lately we have been seeing a problem with the archives of live streams we create using FMS. We use FMS for live streaming and concurrently store the stream in a file using ActionScript. We use the following code to record:
var s2 = Stream.get('mp4:' + mp4name);
application.publishedStreamMP4= s2;
application.publishedStreamMP4.record();
application.publishedStreamMP4.play(application.publishedStream.name,-1,-1);
(some lines have been removed that are used for logging, etc).
Sometimes some of these functions fail and return false. In these cases FMS's core log shows that the cache is full:
2013-06-11 11:45:55 13863 (w)2611372 The FLV segment cache is full. -
In investigating this issue I have not yet been able to recreate this exact situation. By lowering the cache to 1MB I have however been able to create a situation where storing a stream can stop because the cache is full. The situation occurs as follows:
* The server is restarted, the cache is empty.
* A live stream is started, which is also recorded.
* Via the Administration API the cache values <bytes> and <bytes_inuse> show to be exactly the same as the <overhead> of the object that relates to the file being saved. The <bytes> and <bytes_inuse> values of the object are 0.
* This continues in the same way untill the cache is full.
* When the limit of the cache is reached the message
2013-06-11 12:07:35 13863 (w)2611372 The FLV segment cache is full. -
is shown in the core log and storing of the file stops. The instance log also show status changes:
2013-06-11 12:07:35 13863 (s)2641173 MP4 recording status for livestream.mp4: Code: NetStream.Record.NoAccess Level: status Details: -
2013-06-11 12:07:35 13863 (s)2641173 MP4 recording status for livestream.mp4: Code: NetStream.Record.Stop Level: status Details: -
In the filesystem I can confirm that the last change of the file is on this moment (in this case 12:07). The live stream continues without problems.
I have reproduced this several times. Though I can understand that caches can fill up and this can cause trouble I feel like this situation is a bug in FMS. The cache fills up with overhead, which is apparently reserved untill writing the file ends.
I hope someone here can help out. Has anyone seen a situation like this and is there any remedy for it? Or even a workaround where this overhead in the cache can be released so the cache does not fill up?
We use FMS version 4.5.1.
