Skip to main content
BenSimonI2X
Participating Frequently
July 8, 2013
Question

What is a reliable way to keep FMS from broadcasting streams when recording to disk fails?

  • July 8, 2013
  • 1 reply
  • 493 views

Howdy,

We're running FMS 4.5.3 on a Linux box.

We've got a video conferencing system that streams out video as well records it to .flv files.  Both operations, as you can imagine, are critical.

Today, I discovered that a number of videos were properly streamed out to individuals but were not saved on disk.  I can't quite explain what happened, though I do know that I found instances of:

The FLV segment cache is full

in core.00.log.  From what I can tell, this issue relates to recording of streams, but not broadcasting them.

Is there a strategy I can use to insure under no circumstances do we broadcast a stream without recording it? I'd much rather have the whole process fail then find out after the fact that recording has failed.

Some further details about our process:

On the server side, I'm using default FMS behavior.  Our "application" consists of nothing more than a directory (say "foo") in the applications directory.  In that directory is an Application.xml that contains:

<?xml version='1.0'?>

<Application>

  <StreamManager>

    <Live>

      <AssumeAbsoluteTime>true</AssumeAbsoluteTime>

      <Queue enabled="true">

                                <AggregateMessages enabled="false"/>

      </Queue>

    </Live>

  </StreamManager>

</Application>

there's also a main.asc file, but it's empty (as in 0 bytes length).

On the client side, I'm using a small two custom flash applications.

The first is a publisher. It opens up a NetConnection to http://myserver.com/foo. I use this NetConnection to instantiate a NetStream to which I invoke publish("somename.flv", "append").

The second is a player. It opens up a NetConnection to http://myserver.com/foo. I use this NetConnection to instatiate a NetStream to which I invoke play("somename.flv").

Any suggestions?

Thanks in advance!

-Ben

This topic has been closed for replies.

1 reply

BenSimonI2X
Participating Frequently
July 9, 2013

Not sure if this is the best answer, but here's what I've figured out:

1. I changed SERVER.FLVCACHE_MAXSIZE to be 1 (meg).

2. I confirmed that if I start up a number of streams publishing, and a number of streams playing the published streams, that it's possible to trigger the FLV cache full error. I also confirmed that recording stops, yet clients who have invoked play on the stream continue to see updated video.

3. I further noted that when recording stops two events are issued to the publishing flash client: NetStream.Record.Stop and NetStream.Record.Stop

My fix therefore was to add code such as the following:

ns.addEventListener(NetStatusEvent.NET_STATUS,

                      function(evt:NetStatusEvent):void {

                        if(evt.info.code == 'NetStream.Record.Stop' ||

                           evt.info.code == 'NetStream.Record.NoAccess') {

                          ns.close();

                        }

                      });

// use the netstream as normal

In other words, I detect these recording related events and stop the stream.

With this code in place, when a recording issue happens the clients who are playing the stream now receieve an unpublish event and can no longer play the stream.

Not sure if this is the best approach, but it is *an* approach.

By the way, upgrading to 4.5.5 doesn't impact any of the following. I'm still getting the FLV cache full issue.