Add metadata to live stream

Hi!
I'm having some trouble finding out how you can add metadata to a live stream. I'm streaming the webcam over fms and recording it in main.asc. So far so good.
I have 2 applications. One that sends data and one that recieves data. The functionality is more or less like this example. The article says: "Note: If you record the             video on the server side (a functionality of FMIS), the  injected events are             also being triggered by the recorded file." That is what I want, but I have no idea how to make it happen.
The problem is that I can't find any good examles for as3 and I have never looked into as2 (still new to flash in general )
Does anybody have an example on how to do this or a link for me? That would have been great!

Just to clarify a bit..
I anybody could tell me how to call: application.myStream.send("sendTest", test); on the server side and recieve that on the client side I think I've got it At least I hope so..
What works in as3 where you would write:
netstream.sendTest = function(test) {
   txtTextfield.text = test;
in as2?

Similar Messages

  • Availability of HTML5 Live streaming tools on Snow Leopard

    I'm looking to stream video as part of my class offerings at the University that I teach at. The Tech Services at our university currently only provides a flash based streaming service, but a large number of my students have iPhones/iPads/etc. I want to add an HTTP5 Live Streaming option.
    According to the article at:
    http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conce ptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html#//a pple_ref/doc/uid/TP40008332-CH102-SW1
    the tool filestreamsegmenter is supposed to available in the default install of Snow Leopard. I bought the retail box upgrade of snow leopard (my Macbook Pro came with Leopard/10.5). I don't seem to have the file. I also checked the linkes on connect.apple.com mentioned in the article, but they don't seem to be available there. Do I have to buy an iPhone developer membership just to get the tools in order to add HTML5 live streaming to my class website? I hope not..
    Tom

    I'm having same problem. The tool is neither in the local dir, not in downloads.

  • Live stream Facebook

    I can easily add a facebook like button or likewise to my Iweb page, but I would like to add the Facebook Live stream to my page. On the facebook developer page ( http://developers.facebook.com/docs/reference/plugins/live-stream/ ) I can get the code for "html5" but when choosing "Iframe", it says that the Iframe does not have an implementation.
    How do I than add my Facebook Livestream?

    you need to enter the app id - replace client_id with app id, see this for short intro to fb live stream:
    http://www.kimwoodbridge.com/livestream/
    also facebook generated bad code for js.src . compare the following and what you got from fb:
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id;
      js.src = "http://connect.facebook.net/en_GB/all.js#xfbml=1&appId=APP_ID";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    <div class="fb-live-stream" data-event-app-id="client_id" data-width="400" data-height="500" data-always-post-to-friends="true"></div>

  • Trying to add metadata to a live stream completely fails

    Hi.  I've been following this document http://help.adobe.com/en_US/flashmediaserver/devguide/WS5b3ccc516d4fbf351e63e3d11a0773d56e -7ff6Dev.html for adding metadata to an FMS live stream from a Flash widget.
    I've created a stripped-down version of the code (listed below); the same as the original code except the controls are removed.  It works fine only if I comment out the ns.send calls.  If I leave in the ns.send calls, no clients are ever able to view anything.  I'm using a stock FMS 4.5 install on Amazon EC2 -- the AMI is ami-904f08c2.  And I'm compiling the swf using Flex SDK 4.6 on Linux with the command "mxmlc -compiler.library-path+=./playerglobal11_0.swc -swf-version=13 -static-link-runtime-shared-libraries Broadcaster.as".
    package {
        import flash.display.MovieClip;
        import flash.net.NetConnection;
        import flash.events.NetStatusEvent; 
        import flash.events.MouseEvent;
        import flash.events.AsyncErrorEvent;
        import flash.net.NetStream;
        import flash.media.Video;
        import flash.media.Camera;
        import flash.media.Microphone;
        public class Broadcaster extends MovieClip {
            private var nc:NetConnection;
            private var ns:NetStream;
            private var nsPlayer:NetStream;
            private var vid:Video;
            private var vidPlayer:Video;
            private var cam:Camera;
            private var mic:Microphone;
            private var myMetadata:Object;
            public function Broadcaster(){
                setupUI();
                nc = new NetConnection();
                nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
                nc.connect("rtmp://myserver/live");
             *  Clear the MetaData associated with the stream
            private function clearHandler(event:MouseEvent):void {
                if (ns){
                    trace("Clearing MetaData");
                    ns.send("@clearDataFrame", "onMetaData");
            private function startHandler(event:MouseEvent):void {
                displayPlaybackVideo();
            private function onNetStatus(event:NetStatusEvent):void {
                trace(event.target + ": " + event.info.code);
                switch (event.info.code)
                    case "NetConnection.Connect.Success":
                        publishCamera();
                        displayPublishingVideo();
                        break;
                    case "NetStream.Publish.Start":
                        sendMetadata();
                        break;
            private function asyncErrorHandler(event:AsyncErrorEvent):void {
                trace(event.text);
            private function sendMetadata():void {
                trace("sendMetaData() called")
                myMetadata = new Object();
                myMetadata.customProp = "Welcome to the Live feed of YOUR LIFE, already in progress.";
                ns.send("@setDataFrame", "onMetaData", myMetadata);
            private function publishCamera():void {
                cam = Camera.getCamera();
                mic = Microphone.getMicrophone();
                ns = new NetStream(nc);
                ns.client = this;
                ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
                ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
                ns.attachCamera(cam);
                ns.attachAudio(mic);
                ns.publish("livestream", "live");
            private function displayPublishingVideo():void {
                vid = new Video(cam.width, cam.height);
                vid.x = 10;
                vid.y = 10;
                vid.attachCamera(cam);
                addChild(vid); 
            private function displayPlaybackVideo():void {
                nsPlayer = new NetStream(nc);
                nsPlayer.client = this;
                nsPlayer.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
                nsPlayer.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
                nsPlayer.play("myCamera", 0);
                vidPlayer = new Video(cam.width, cam.height);
                vidPlayer.x = cam.width + 100;
                vidPlayer.y = 10;
                vidPlayer.attachNetStream(nsPlayer);
                addChild(vidPlayer);
            private function setupUI():void {
            public function onMetaData(info:Object):void {

    Also, emitting other events in the ns.send calls works; eg. if I do ns.send("blah", "onMetaData", myMetadata), nothing happens (because there's no "blah" function to do anything), but at least this doesn't cause the entire stream to fail.

  • Archiving live stream at FMS and injecting metadata: VP6 good h264 not

    When I record a live stream at FMS, one in which I've injected  metadata in my main.asc file, the archived file plays back fine.  The  metadata plays back too.  I'm able to retreive it just fine - if I  encode VP6.
    If I encode h.264 the file plays back but  the metadata does not.  The fact that the archived file is created and  plays back tells me things are wired correctly.  The only thing I  changed is the format.
    According to FMS docs (http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11afc9 5e-7e42.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7f35)
    ..."The recording format is determined by the filename you pass to the Stream.get()
    method."
    So my record code looks like the following:
    application.onPublish = function(client, stream) {
         trace("onPublish");
         s = Stream.get("mp4:streamname.f4v");
         if(s){
             s.record();
         this.doRepublish(this.nc, stream);
    My code that injects the data in to the stream looks like this:
    Client.prototype.sendDataEvent = function(data) {
         trace("Call to sendDataEvent...");
         this.newStream = Stream.get("mp4:streamname.f4v");
         this.newStream.send("onTextData",data);
    All must be wired  correctly because the metadata comes through during the live stream.  On  play back of the archive though, the metadata doesn't appear to be  there.
    Any thoughts?
    Thanks

    My apologies on the s.play() confusion.  I had been trying different versions of the code and posted the one without it.
    Whether I include s.play() or not the file gets created.  Here are the various versions of the onPublish() function I've tried (differences in red):
    1.
    application.onPublish = function(client, stream) {
        trace("onPublish");   
        s = Stream.get("mp4:streamname.f4v");
        if(s){
            s.record();
            s.play("mp4:streamname.f4v");
        this.doRepublish(this.nc, stream);
    2.
    application.onPublish = function(client, stream) {
        trace("onPublish");   
        s = Stream.get("mp4:streamname.f4v");
        if(s){
            s.record();
            s.play(stream);
        this.doRepublish(this.nc, stream);
    3.
    application.onPublish = function(client, stream) {
         trace("onPublish");   
         s = Stream.get("mp4:streamname.f4v");
         if(s){
             s.record();
         this.doRepublish(this.nc, stream);
    All produce the same result - an archived file called mp4:streamname.f4v in my streams folder.  This file plays back fine but does not play back the commands.
    On your other question, about things working fine for VP6, it works fine for FLV.  A file called streamname.flv is produced.  This file plays back fine and does indeed play back commands baked into the file as well.  This is what makes me believe the code is not the problem.  If it works perfectly for one format, there would seem to be very little I could do in my code to break things for the other.
    Can you try this using the record() code snippets in the live docs Stream.record() section?
    http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11afc9 5e-7e42.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7f35
    All you'd need is the code snippets there to record your live stream and another server side function to inject commands into that live stream. Here is that function:
    Client.prototype.sendDataEvent = function(data) {
        trace("Call to sendDataEvent...");
        this.newStream = Stream.get("mp4:streamname.f4v");
        this.newStream.send("onTextData",data);
    Do something simple like call onTextData and pass some text in the data parameter.  Then on the client side viewer, handle the onTextData method.  It will receive the text.  Display it in a text area or something.
    If you record while injecting this text into your stream, the text should display on playback of the archived file.  It will if you encode VP6/FLV, but not if you encode H.264/F4V.
    Let me know what you discover.

  • Add an Intro FLV before live stream starts

    Hi,
    I have a console that has a main VideoDisplay that will
    broadcast a live stream.
    I'm using FME 2.5 with FMS 3.02.
    What I would like to have the ability to run a looping FLV in
    the VideoDisplay until the Live stream begins which will then cut
    in.
    I know this may be a FMS 3.02 config, but any advise would be
    appreciated...
    If it is also possible to play an Exit FLV when the live
    stream stops..that would be a bonus....
    Cheers

    Hi Macnimation,
    The tutorial is helpful only if you are using some Flash Authoring tools to write your playback client (which is playing back the video from the FMS at your side). In that case, inside your client code, there must be a NetStream object ns, and a statement like ns.play(filename, 0, -1), where filename is the name of your final video which you have created by combining the various videos you want to play.
    So to create a playlist (as described in the tutorial), you need to modify the ns.play() statement. If your video files are named A.flv, B.flv, and so on, while the short intro video is named X.flv, you can write the following sequence of statements to create  a playlist:
    ns.play("X", 0, -1, true);
    ns.play("A", 0, -1, false);
    ns.play("X", 0, -1, false);
    ns.play("B", 0, -1, false);
    The last parameter (true/false) is the reset parameter. For the first time, it is true, to indicate that reset the play and start playing stream X immediately. For the following statements, it is false, indicating that play the stream A after the previous stream (i.e. x) is completed.
    Thanks.

  • HTTP Live streaming test in Flash Player, HTML5 player, iphone, android and other smart phones.

    Hi,
    Can anyone please tell me how can I play http live streaming from FMLE 3.2 to Flash player, iphone, ipdad, HTML5 player, Android and other devices?
    I have tried my best to play live streaming usine FMLE 3.2 with help of "http://help.adobe.com/en_US/flashmediaserver/devguide/WSd391de4d9c7bd609-52e437a812a3725df a0-8000.html" but not able to play video using HTTP.
    When I tried to play url-  "http://localhost/hds-live/livepkgr/_definst_/liveevent/livestream.f4m" even in in Strobe Media Player it was showing "Buffering" that's it. But I can play same RTMP URL in Flash AS3 using the netstream very fine.
    Now I want to test the livepkgr content via HTTP to Flash Player, HTML5 Player (on Web browser and smartphones), iphone and other devices.
    Thanks
    Best regards,
    Sunil Kumar

    Hi Sunil,
    It's difficult to debug an issue when you don't have access to the machine and you can't see what's happening, so I request you to please have a little patience.
    For playback just check the following steps and make sure if you have followed them :
    1) Delete the streams folder and any .stream file in the livepkgr
    2) Restart FMS
    3) Make sure you have a crossdomain.xml under root_install/webroot
    4) Publish a stream from FMLE as 'livestream?adbe-live-event=liveevent'
    5) Use this player to playback the stream : http://osmf.org/dev/2.0gm/StrobeMediaPlayback.html?src=http://<your-ip>/hds-live/livepkgr/_definst_/liveevent/livestream.f4m
    If there is no playback, here are some checks you can do :
    1) Request for the http://<your-ip>/hds-live/livepkgr/_definst_/liveevent/livestream.f4m in your browser. You should receive an xml that looks something like this :
    <?xml version="1.0" encoding="UTF-8" ?>
         <manifest xmlns="http://ns.adobe.com/f4m/1.0">
              <id>livepkgr/events/_definst_/liveevent</id>
                      <mimeType />
              <streamType>live</streamType>
              <duration>0</duration>
              <bootstrapInfo profile="named" url="../../../streams/livepkgr/events/_definst_/liveevent/livestream.bootstrap" id="bootstrap7158" />
              <media streamId="livestream" url="../../../streams/livepkgr/events/_definst_/liveevent/livestream" bootstrapInfoId="bootstrap7158">  
                          <metadata>AgAKb25NZXRhRGF0YQgAAAAAAAhkdXJhdGlvbgBAJUUeuFHrhQAFd2lkdGgAQHQAAAAAAA=</m etadata>
                </media>
    </manifest>
    2) Check the access log under Apache to see if the .f4m, .bootstrap and Frag files have been requested and delivered. If a particular entry has a status code of 200 then the file has been served by FMS. You can confirm the same on the client side using a software like fiddler.
    Coming to the player issue, a playback of *f4v via the vod directive is a progressive download, whereas playback of an *f4m file via hds-vod is HTTP streaming. 
    I have personally used Spark VideoPlayer and hence suggested the same.
    You need to add a component like :
    <s:VideoPlayer width="100%" height="30%" chromeColor="#CCCCCC" color="#000000"
                     fontSize="12"
                     source="http://<your-ip>/hds-live/livepkgr/_definst_/liveevent/livestream.f4m"
                        symbolColor="#000000"/>
    Let me know if any of these suggestions help.
    Thanks,
    Apurva

  • Doubt regarding HTTP Live Streaming for windows phone 8.1 silverlight app?

    Hi,
    I am developing a Windows phone 8.1 silverlight app.
    I want to add live streaming youtube channel , thats why I used  https://phonesm.codeplex.com/ this link as a reference , and I am able to play the links given in the samples, but I am unable to play my link https://www.youtube.com/watch?v=p2GF-QQS6n0
    I am getting 3108 unable to play media error with my link,
    My question Is there any need of streaming server ?
    If yes can anyone help how to  create the streaming server.
    Thanks....
    Suresh.M

    Hi Suresh.M
    As I can see a similar question on the Windows Phone Streaming Media discussion:
    https://phonesm.codeplex.com/discussions/545737
    You may need check into the call stack and find out what is the root cause, for instance if there any chance that your phone cannot reach to the video address, and did you enable some network capabilities, etc.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do I use multiple cameras to live stream through FME?

    I am looking to live stream pool tournaments from multiple angles but don't know what software or hardware I might need. Anybody have any good how to advice or links they might share? I stream through Ustream.tv if that makes a difference. Should I look for something different? Thanks

    I am working on getting just the counter working by using
    the program posted previously, and I am running into issues. Periodically I get
    the error:
    Error -200141
    occurred at DAQmx Read (Counter DBL 1Chan 1Samp).vi
    Possible reason(s):
    Data was overwritten
    before it could be read by the system.
    If Data Transfer
    Mechanism is Interrupts, try using DMA. Otherwise, divide the input signal
    before taking the measurement.
    It seems to work better if I use cascaded counters, but I need timer 0 for
    analog channels when I run this code along with the program for the other
    measurements.
    I have tried averaging, and selecting different values for the millisecond
    timer, and these did not seem to have an effect.
    I tried different DAQms configurations and "Counter DBL 1Samp" seemed
    to work the best.
    The program will work for a while and then it will give me the above error
    message.
    If I use counter 0 as a cascaded counter input, the program runs fine. If I run
    this with other analog channels, it errors out because the analog channels use
    counter 0.
    If I use counter 1 as a cascaded counter input, it seems to work better than a
    single channel, but it will still error out with the above error.
    If I use only counter 1, I get the error above even faster.
    Also, none of the
    configurations give measurements outside the While Loop.
    The only place I can add a speed dial for the front panel is within the While
    Loop.
    Is there someway to get the signal to continuously send out of the while loop?
    I thought if I could get the signal out of the while loop, I could condition it
    anyway I wanted without the program erroring out.
    Any suggestions would be much appreciated.
    Thank you.
    Attachments:
    Counter_error.jpg ‏45 KB

  • Running a live stream from an XML playlist

    I have just successfully installed Adobe FMS on my server.
    I would now like to know how to program a script to run a continuous live stream, of MP4 videos, from an XML playlist.
    Can anyone tell me how to do this? ...or provide me a good tutorial? (I am a complete newbie to ActionScript.)
    Thanks in advance...

    application.allowDebug = true;
    application.onAppStart = function(){
    this.userID =0;
    this.playObj = new Object();
    this.timObj = new Object();
    this.passCli = new Object();
    this.couObj = new Object();
    this.couObj.count = 1;
    application.so0 = SharedObject.get("so",false);
    this.dates = new Object;
    this.dates.dat0 = new Date().valueOf()+"a";
    this.dates.dat1 = new Date().valueOf()+"b";
    this.dates.dat2 = new Date().valueOf()+"c";
    this.dates.dat3 = new Date().valueOf()+"d";
    this.myStream = new Object;
    this.myStream.st = Stream.get (this.dates.dat0.toString());
    this.myStream.st1 = Stream.get (this.dates.dat1.toString());
    this.myStream.st2 = Stream.get (this.dates.dat2.toString());
    this.myStream.st3 = Stream.get (this.dates.dat3.toString());
    this.int0
    this.int1
    this.int2
    this.int3
    this.int4
    this.lock0=0;
    this.lock1=0;
    this.lock2=0;
    this.lock3=0;
    this.lock4=0;
    listen();
    function listen(){
    clearInterval(application.int3);
    application.int0 = setInterval(time,1000,application.myStream.st);
    application.myStream.st.onStatus = function(info){
    if(info.code == "NetStream.Play.Stop"&&application.lock0==0){
      trace("code0"+info.code);
      clearInterval(application.int0);
      application.timObj.tim = 0;
      application.int1 = setInterval(time,1000,application.myStream.st1);
      application.couObj.count = 2;
      playcurr(application.passCli.cli);
      switchStream(application.so0);
      listen1(application.myStream.st1);
      application.lock0=1;
      function listen1(mystreamst1){
      mystreamst1.onStatus = function(info){
    if(info.code == "NetStream.Play.Stop"&&application.lock1==0){
      trace("code1"+info.code);
      mystreamst1 = null;
      clearInterval(application.int1);
      application.timObj.tim = 0;
      application.int2 = setInterval(time,1000,application.myStream.st2);
      application.couObj.count = 3;
      playcurr(application.passCli.cli);
      switchStream(application.so0);
      listen2(application.myStream.st2);
      application.lock1=1
      function listen2 (mystream2){
    mystream2.onStatus = function(info){
    trace("code2"+info.code);
    if(info.code == "NetStream.Play.Stop"&&application.lock2==0){
      clearInterval(application.int2);
      application.mystream2 = null;
      application.timObj.tim = 0;
      //application.int3 = setInterval(time,1000,application.myStream.st3);
      application.couObj.count = 4;
      playcurr(application.passCli.cli);
      switchStream(application.so0);
         application.lock2=1;
      listen3(application.myStream.st3);
      function listen3(mystream3){
    mystream3.onStatus = function(info){
    trace("code3"+info.code);
    if(info.code == "NetStream.Play.Stop"&&application.lock3==0){
      trace("yes yes yes yes yes yes");
      clearInterval(application.int3);
      application.couObj.count = 1;
      mystream3 = null;
      application.timObj.tim = 0;
      //application.int4 = setInterval(time,1000,application.myStream.st);
      playcurr(application.passCli.cli);
      switchStream(application.so0);
      application.lock0=0;
      application.lock1=0;
      application.lock2=0;
      application.lock3=0;
    application.dates.dat0 = new Date().valueOf()+"e";
    application.dates.dat1 = new Date().valueOf()+"f";
    application.dates.dat2 = new Date().valueOf()+"g";
    application.dates.dat3 = new Date().valueOf()+"h";
    application.myStream.st = Stream.get (application.dates.dat0.toString());
    application.myStream.st1 = Stream.get (application.dates.dat1.toString());
    application.myStream.st2 = Stream.get (application.dates.dat2.toString());
    application.myStream.st3 = Stream.get (application.dates.dat3.toString());
    application.myStream.st.play(application.playObj.vid[0],0,-1,0);
    application.myStream.st1.play(application.playObj.vid[1],0,-1,0);
    application.myStream.st2.play(application.playObj.vid[2],0,-1,0);
    application.myStream.st3.play(application.playObj.vid[3],0,-1,0);
    listen();
    ///here next
    application.onConnect = function(client){
    application.acceptConnection(client);
    application.passCli.cli = client;
    client.call("setUserID",null,this.userID);
    this.userID++;
    if(application.clients.length == 1 ){
    videoArray = new Array();
    var playlist = new XML();
    playlist.ignoreWhite = true;
    //parse xml play list for individual elements
    playlist.onLoad = function( success ) {
    if(playlist.loaded == true) {
    if (playlist.firstChild.hasChildNodes()) {
    for (var aNode = playlist.firstChild.firstChild; aNode != null; aNode=aNode.nextSibling) {
    if (aNode.nodeType == 1) {
    //create array from parsed xml elements.
    videoArray[aNode.attributes.id] = aNode.attributes.name ;
    //pass array out of onload function
    application.playObj.vid = videoArray;
    application.myStream.st.play(application.playObj.vid[0],0,-1,0);
    application.myStream.st1.play(application.playObj.vid[1],0,-1,0);
    application.myStream.st2.play(application.playObj.vid[2],0,-1,0);
    application.myStream.st3.play(application.playObj.vid[3],0,-1,0);
    pass0(videoArray);
    //play first video on playlist
    playlist.load("http://www.privatechatnow.com/fmsuser/playlist.xml");
    }//end onetime if statement
    function pass0(videoArray){
      //receive array
      //play intial video
      if(application.clients.length == 1){
    // application.playObj.vid=videoArray;
    playcurr(application.passCli.cli);
    for (var key in application.playObj){
    trace(key + ": " + application.playObj[key]);
       //put currently playing videio into object
      //isolate playlist switching loop for each connected client
      //listen to currently playing stream with onStatus
      //change to next video in playlist
      //use onStatus and current duration and seek to scrub to cuurently playin video each time a user connects.
      //continue untill playlist is played then loop back to first video in playlist.
        //onConnect play currently playing video
    if (application.clients.length >1){
    playcurr(application.passCli.cli);
    //message client with currently play flv
    //message client when flv changes
    //message client with metadata
    application.onPublish = function(clientObject, streamObject){
    trace("Stream name :: "+streamObject.name);
    function switchStream(so0){
    if(application.couObj.count == 1){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[0].length;
        nextlen = application.playObj.vid[1].length;
    so0.send("playSecond",application.playObj.vid[0],clength,currlen,nextlen);
    if(application.couObj.count == 2){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[1].length;
    nextlen = application.playObj.vid[2].length;
        so0.send("playSecond",application.playObj.vid[1],clength,currlen,nextlen);
    if(application.couObj.count == 3){
    clength = application.timObj.tim-3;
    currlen = application.playObj.vid[2].length;
      nextlen = application.playObj.vid[3].length;
        so0.send("playSecond",application.playObj.vid[2],clength,currlen,nextlen);
    if(application.couObj.count == 4){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[3].length;
      nextlen = application.playObj.vid[0].length;
        so0.send("playSecond",application.playObj.vid[3],clength,currlen,nextlen);
    function playcurr(client){
    trace("count = "+application.couObj.count.toString());
    if(application.couObj.count ==1){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[0].length;
      nextlen = application.playObj.vid[1].length;
        client.call("playZero",null,application.playObj.vid[0],clength,currlen,nextlen); 
    if(application.couObj.count ==2){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[1].length;
      nextlen = application.playObj.vid[2].length;
        client.call("playZero",null,application.playObj.vid[1],clength,currlen,nextlen); 
    if(application.couObj.count ==3){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[2].length;
      nextlen = application.playObj.vid[3].length;
        client.call("playZero",null,application.playObj.vid[2],clength,currlen,nextlen); 
    if(application.couObj.count ==4){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[3].length;
      nextlen = application.playObj.vid[0].length;
        client.call("playZero",null,application.playObj.vid[3],clength,currlen,nextlen); 
    application.onDisconnect = function(oldclient){
    if(application.clients.length ==0){
    this.userID--;
    function time(myStream){
    application.timObj.tim = myStream.time;

  • About Flash P2P live streaming from non-webcam sources

    Hello, I am a university student. Our lab is attempting to work on a p2p live streaming using flash p2p features. The media source is not from a webcam but a file from a certain server, which is not directly supported by any of the 4 methods flash player offers(posting, direct routing , object replication,and multicast.) As some of the forum threads mentioned, our method is to use NetStream.publish() a stream and use send("callbackname", data)  to all subscribers that have joined in a NetGroup. So we can use p2p transmission. Now here are our questions:
    1. We know from MAX 2009 that flash p2p camera video multicasting implements pull-push mechanism inside which makes full use of p2p features like buffer map exchange. If we use NetStream.send() API to send non-webcam source data, will it also make use of this pull-push mechanism to spread data among all peers(subscribers) with proper data exchange?
    or more detailedly,
    I saw the P2P Gaming Libs at flashrealtime.com. It uses DIRECT_CONNECTIONS when creating publish-used NetStream in order to send data with lowest latency. My question is if I do not use DIRECT_CONNECTIONS, than when the NetGroup grow large (1000), will those peers that are not direct neighbors to the publisher in the same group relay data to each other using pull-push via buffer map?
    2. I have written a sample app and use send() to deliver data only (NetStream.bufferTime = 0) without camera video and audio. When the publisher sends the data  in a "for()" stantence for 20 times, the subscribers can only receive about 8 of them. But when I set a timer and periodically send them(e.g., 500ms), the subscribers can receive them correctly. My questions are: Is the packet loss caused by UDP unreliability? Can this be solved by setting the NetStream.dataReliable = ture? Can this totally be solved by setting a timer? How to set the delaytime property in timer? Are all data sent are orderedly received?
    I'm very appreciated if you can answer my questions? thanks.

    1. NetStream.send() data is delivered in the order it was sent, whether in client-server, DIRECT_CONNECTIONS, or multicast mode.
    2. the lowest latency will be achieved with DIRECT_CONNECTIONS.  however, that isn't scalable to large numbers of recipients.  the P2P multicast system trades low latency for scalability.
    3. there are no plans to support a natural NetStream streaming source that's not a camera/microphone.  Flash Media Server can perform that function.
    4. you should never need to implement "bitmap exchange"; the object replication system handles all the communication needed to accomplish its function. typically you will divide a file into segments, giving each one an index number. object replication uses ranges internally, so the index numbers should be contiguous.  nodes that have indices use NetGroup.addHaveObjects().  nodes that want indices they don't have use NetGroup.addWantObjects().  nodes that have objects will send them to nodes that want the objects.  when a node receives an object, it's automatically removed from its "want" set; once the node decides the object is acceptable, it adds it to its "have" set, at which point it can answer requests from other nodes who still "want" it.  eventually every node will have all the pieces and not want any.  for an example, please see Tom Krcha's articles on using object replication:
       http://www.flashrealtime.com/file-share-object-replication-flash-p2p/
       http://www.flashrealtime.com/video-on-demand-over-p2p-in-flash-player-101-with-object-repl ication/
    5. please see Tom Krcha's articles.  for VOD you will probably want to use the "LOWEST_FIRST" replication strategy, as that may allow you to start playing earlier.  for general file replication you'll get better sharing if you use RAREST_FIRST.

  • Help understand Visual Communicator Live Streaming

    Up to know I run live streaming through our Steaming server using FMS and Flash Media Live Encoder as we only needed one camera for live video feeds.
    We are looking at the ability now to use 2 live cameras and also the ability to snap in pre recorded video during live feeds and also provide lower third titles.
    I am looking at:
    Adobe Visual Communicator 3
    Wirecast 4
    CutFour
    All of these provide the possible live switching I need.
    I'm at the moment looking at the Trial version of Visual communicator and I am struggling getting my head around a few things.
    I can hook up 2 -3 Sony A1 HD cameras in SD no problem and running it though FMS is fine. During test streams clicking on the cameras using the mini switcher is straight forward.
    howevr I am struggling to work out how to do the following:
    Add prerecorded video clips to Camera 3? ( in the Setup Tab it says " No Camera found - please connect a camera or replace with Photo or video Clip) How do I replace with a Video Clip?
    How do I add premade titles, so that during the live feed I can put lower third titles in?
    Finally, How do Provide an intro looping video to play before the live feed starts?
    Any instructions would be appreciated

    Hi there
    The forums are user-to-user. The older incarnation of the forums used to have a disclaimer on each page. Now there is one that appears at:
    http://forums.adobe.com/index.jspa
    If you want to bring something to Adobe's attention, you need to use the proper channel. That channel is the Wish Form/Bug Reporting form.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Add metadata (non-image data) to an image

    Hello,
    I want to read an image and add metadata (non-image data) like copyright... to the image and write it. I am able to read metadata of an image but couldn't add (write) into it...
    Help required urgently
    Regards
    Mamatha

    instead of data streams, why not just write the blob's bytes to the response output stream directly, then in the applet, you don't need a URLConnection object to get the image, just call getImage() in the applet with the URL.

  • Custom metadata in HDS stream bound for OSMF

    Can someone tell me which "BOX" (atom) type in a HDS stream I could use to embed custom timeline metadata?  I have access to, and can modify, the raw HDS stream.   MDAT, MOOF,etc....? The stream will be played back in OSMF, and presumably I can modify BoxParser and HHTPStreamingF4FFileHandler to parse the appropriate box.  Presumably this is how CuePoints and such are tunneled from AMS/FMS.
    Thanks.
    -- Brad

    Another point to note is that once I start publishing to the
    recording app, I get the metadata of the stream with
    objMetadata = Stream.getOnMetaData("streamname");
    and trace the properties of the objMetadata object every 1/2
    second (this is purely for debugging purposes while I work out what
    the hell is going on). But for around the first 30 seconds, nothing
    is output! Then all of a sudden, the output starts tracing to
    screen. IF my customduration metadata is there, it has its initial
    value as indicated in my post above (for example 7), and never
    increments. But more interestingly, the duration metadata that FMS
    automatically inserts might say 39.076 once the traces start coming
    through! So I would at least think that my customduration would be
    around 39 give or take. Also the FMS duration says 39.076, but then
    it stays at the same value for a while, even though it's being
    traced every 1/2 a second, then it might say 71.200, then stays the
    same for about 30 seconds, then 104.863 and so on.
    This makes sense if this is only being updated in memory
    every 30 seconds or so (the docs state that the 'data keyframe is a
    special data message that can be added to a live stream and stored
    in the memory of the server'), but then it also means that when
    reading it, we will never know if this is actually correct! I mean
    if I connect and get the metadata and the duration says 71, I'm
    going to assume that I connected to the live stream 71 seconds in,
    but it could have been saying 71 for the past 20 seconds, and I'm
    really 91 seconds into the live stream!
    K.

  • How to understand live stream is online

    Hi,
    First sorry about my english, i search my problem, but i couldnt find my answer,
    We have more then 80 live stream videos. More than 20 PC with capture cards, send cam streams to FSM with FME,
    Problems,
    PC can crush, capture card can crush, fme can crush, camera connection can crush,
    so with below code, i can unterstand if FMS server is alive, "NetConnection.Connect.Success"
    but is my stream  alive? How i can understand "1test1" is alive,
    for example i can unterstand with onMetaData info, if there is no meta info, no stream,
    but i am a noob, what is the true way to understand live stream is alive, meta info isn't true way i think
    i change var videoURL:String ="1test1" to a false value
    but no error i get, it never says "NetStream.Play.StreamNotFound":
    my goal is, i will make a web page, it will find all livestreams from xml, and cheack them, so systemadmin will see problem easly,
    last question, if there is a camera problem, livestream gives a blank black screen, can i understand automaticly  this screen
    var videoURL:String ="1test1"
    var nc:NetConnection = new NetConnection();
    nc.client = this;
    nc.connect("rtmp://myFMS/live/");
    nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    function netStatusHandler(event:NetStatusEvent):void{
    trace(" trace netStatusHandler: " +event.info.code);  
    switch (event.info.code)
    case "NetConnection.Connect.Success":
    connectStream();
    break;
    case "NetStream.Play.StreamNotFound":
    trace("Stream not found: " + videoURL);
    break;
    function connectStream():void
    var vid:Video = new Video(640,480);
    var ns:NetStream = new NetStream(nc);
    ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    var meta:Object = new Object();
    meta.onMetaData = function(info:Object){
    trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate)}        
    ns.client = meta;
    addChild(vid);     
    vid.attachNetStream(ns);
    ns.play(videoURL);

    thanks, now i am able to understand what's your requirement.
    first you create a sample live chat application. just for testing purpose. 
    1- create video object.; 
    2- create camera object; 
    3- attache camera object to video object; 
    4- create a button and register a event and listener function write below code. 
    5- download adobe.image.PNGEncoder class 
    hope, you can capture photo from video object into you testing application 
    package
        import com.adobe.image.PNGEncoder;
        import flash.display.Sprite;
        import flash.display.DisplayObject;
        import flash.events.*;
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.media.Video;
        import flash.media.Camera;
        import flash.geom.*;
        import flash.net.FileReference;
        import flash.utils.ByteArray;
        public class SavePng extends Sprite
            private var cam:Camera;
            private var video:Video;
            private var ab:FileReference;
            public function SavePng()
                cam = Camera.getCamera();
                cam.setMode(800,600,25);
                cam.setQuality(0, 90);
                video = new Video(1024,768);
                video .smoothing=true;
                video.attachCamera(cam);
                addChild(video);
                btn.addEventListener(MouseEvent.CLICK,saveImage);
                ab=new FileReference();
            private function saveImage(evt:MouseEvent):void
                var count:int = 0;
                var scaleW:Number = .5;
                var scaleH:Number = .5;
                var m:Matrix = new Matrix();
                m.scale(scaleW,scaleH);
                var bmd:BitmapData = new BitmapData(320,240,true);
                bmd.draw(video);
                var img:Bitmap=new Bitmap(bmd);
                img.x=250;
                img.y=200;
                addChild(img);
                var ba:ByteArray = PNGEncoder.encode(bmd);
               ab.save(ba,"sushil.png")

Maybe you are looking for