Skip to main content
Participant
September 26, 2011
Question

Cue points and live streams?

  • September 26, 2011
  • 1 reply
  • 2389 views

Does anyone know how to embed cue points into a live stream?  I have been searching around and trying to figure out how to make it work properly.  I have played around with stream.send functions and onmetadata.  It works just fine for pre-recorded files with embedded cue points.  But I am having problems getting it working with a live dvr stream.  It also seems if you modify the metadata keyframe using the stream.send("@setDataFrame"... while you are appending to a file, that the metadata change is only in memory, it does not get flushed to the file.  If you stop and restart the stream and start appending the new metadata is not retained.

I am using the dvrcast application to serve and record the streams.  The stream is recorded over a period of time, but recording is started and stopped.  So the file is actually appended to instead of just over writing.  So the problem lies in the metadata, if you actually want to know the exact time something happened and there is a break in the stream there is no way to calculate the actual time.  So my thought was ever time the stream is appended to add a cue point that contains a date time stamp when recording began, so the actual time can be determined by calculating the difference between the last time stamp/cue point and the time elapsed.

Also I believe all of this only applies to flv files for f4v files the process would be completely different.  Any suggestions?

    This topic has been closed for replies.

    1 reply

    Adobe Employee
    September 26, 2011

    Are you saying stream.send("onCuePoint"... is not working? I mean if you send this send message , are you saying it does not get recorded in live recording?

    r_ciraAuthor
    Participant
    September 27, 2011

    I was not able to get the send("onCuePoint" working server side.  I don't remember the exact error I was getting when I first tried.  But I just found an example and tried it again.  I get a message saying:

    ReferenceError: CuePointType is not defined

    Sending error message: Failed to execute method (DVRSetStreamInfos).

    This was my code from the example:



    var CuePoint = new CuePoint(CuePointType.ACTIONSCRIPT, 10, "MyCuePoint", {key1:"value 1", key2:"value 2"});


    s.send("onCuePoint",CuePoint);

    So I am probably doing something wrong?  Keep in mind I am trying to set the cue point server side when the recording starts and not client side.  I think that may be where the problem lies?  I say that because most of the examples I see seem to be using the flv playback component and sending cuepoints from the client.

    The problem I was talking about with metadata when using @setDataFrame, it seemed as if the change was never written to the recorded file, but it would push the change to the connected clients.  It was like it was staying in memory and never getting flushed to the file.  I really only went down that the road of playing with the setDataFrame becaue I see the cuepoints are all listed in the metadata received from that frame... well at least in other peoples recorded examples with already embedded cue points. So I figured I would just write the data myself into the frame myself.  But they did not behave the same.  I assume it was probably a bad assumption on my part, and there is really some data frame inserted into the stream too that triggers events at the cuepoint instead of using timers and maintaining a list of the cuepoints.

    r_ciraAuthor
    Participant
    September 29, 2011

    I went back found more examples and revisited stream.send("onCuePoint" ..  I guess the syntax was not right server side for the object being passed to the stream send command.  Building the cuePoint object differently fixed the problem for me.

    ExDVRStream.prototype.onStartRecord = function()

    {

              clearInterval(this.startRecTimer);

              this.startRecTimer = null;

     

              s = Stream.get(this.name);

              this.toString(this.streamInfo)

              if (this.streamInfo.append)

              {

                        //s.syncWrite = true;

                        slenght = Stream.length(this.name);

                        s.record("append");

                        currDate = new Date();

                        info = new Object();

                        info.type = "LiveCutPoint";

                        info.time =slenght;

                        info.abstime = currDate;

                        info.name = "StartNewRecording";

                        info.parameters = null;

                        s.send("onCuePoint",info);

                        trace("Sending CuePoint");

              }

              else

              {

                        s.record("record");

              }

     

              this.isRecording = true;

     

              //notify the downstream server immediately

              this.broadcastStreamInfo();

     

              //also start the periodic broadcast because the stream is growing

              this.startStreamInfoBroadcast();

    }