Skip to main content
Participant
June 11, 2010
Question

Cannot get FMS to produce DVR stream

  • June 11, 2010
  • 1 reply
  • 321 views

I have FMS 3.5 (Dev. Edition) and I'm trying to get it to add DVR features to an existing feed on another server (that I do not control).  I've created the following application on the server:

var nc = new NetConnection();
var localStream = Stream.get("dvr-148");

nc.onStatus = function(info){
  if (info.code == "NetConnection.Connect.Success" && nc.isConnected) {
    trace("We are connected");
    playVideo();
  }
}

nc.connect("rtmp://127.0.0.1:1934/live/");


function playVideo() {
  localStream.record("record");
  localStream.play("camera-148.stream", 0, -1, true, nc);

}

Basically, load the stream, record it, and play it.  From what I've read, this should give me the ability in the client to use DVR-like features on the stream.

In my client I have the following code:

nsPlayer = new NetStream(nc);
nsPlayer.client = this;
nsPlayer.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
nsPlayer.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
nsPlayer.play("dvr-148", 0, -1);

The issue is, when I run this code, I get a "StreamNotFound", if i change the "0" to a "-1" in the play() call, I get the stream (as a live feed) but cannot seek() in this stream.

I know I'm missing something obvious, but I cannot figure it out.  Any help would be appreciated.

-pete

    This topic has been closed for replies.

    1 reply

    June 12, 2010

    Hi,

    Can you try tracing out the status of Stream object.This will help nail down the issue. Place a

    localstream.onStatus = function (info) {

    trace(info.code);

    }

    Also check if you have write permissions on the stream you are recording as in here "dvr-148".

    Revert back with status details, so that we can nail down the issue.

    Thanks,

    Abhishek