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.

Similar Messages

  • Trying to add more photos to photo stream from albums

    Trying to add more photos to photo stream from albums in iPhoto on ipad .would like to view them on my Apple TV. I have 6 photos on the photo stream and lots more in albums but can't seem to be able to get them into the photo stream to view.

    These links may be helpful.
    How To Create Photo Albums http://tinyurl.com/cxm4eoq
    How to Add New Albums in the Photos App on the iPad & Add Photos to the Album
    http://tinyurl.com/7qep7fs
     Cheers, Tom

  • Trying to view the recorded or live stream while recording the live stream doesnt work

    The workflow:
    I push a live feed to the rtmp url rtmp://localhost/my-app/tester where my-app is a copy of the live app in AMS but with the following addition of code in main.asc:
    application.onPublish = function( p_client, p_stream) {
       s = Stream.get("my_hello5");
       trace( s.name + " = name, " + s.publishQueryString + " = pqs");
       if(s) {
         s.record();
         trace("recording...");
         s.play(p_stream.name);
    application.onUnpublish = function( p_client, p_stream) {
       s = Stream.get("my_hello5");
       trace("getting stream my_hello5...");
       if(s) {
         trace("stopping recording...");
         s.record(false);
    And Iam facing multiple issues:
    * The file my_hello5.flv gets generated in applications/my-app/streams/_definst_/ . And Once the recording is complete, If I open it using the url below in media player (Mine is Totem movie player on ubuntu) that I have on linux, it plays. But if I open the same url in  the OSMF flash media playback setup page (http://www.osmf.org/configurator/fmp/# ) , it is always showing "buffering".
    The flv url I used is: rtmp://localhost/my-app/my_hello5
    * If I try to open either the flv url or the live feed url inside the osmf page while the recording is still going on, then Iam not able to view either. It just shows "buffering" all the time.
    Your help is valuable and much appreciated.

    As a good practice if should not play a file while it is being recorded...on other hand you can programatically create chunks of recordking at preodic intervals and use those chunks for laying or copy those chunks to a different folder where a different application and make those availabel to subscribers for rtmp streaming..

  • 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?

  • Custom metada and record live stream

    I tried to inject my own metadata into a live stream (webcam) recorded on FMS 4.5.1
    with no success. I was able to change only the standard metadata but not all my custom ones were recorded
    despite of all example on adobe livedocs, no luck.(as2 and as3)
    this example
    http://help.adobe.com/en_US/flashmediaserver/devguide/WS5b3ccc516d4fbf351e63e3d11a0773d56e -7ff6Dev.html
    doesn't work at all for custom metadat and EVEN recroded special metadata like createdby and creationdata
    example:
    metaData.createdby = String(streamTitle + " of "+fullName);
    metaData.creationdate = String(now.toString());
    metaData.tags = {createdby:metaData.createdby, creationdate:metaData.creationdate};
    metaData.width = Number(devicesQuality.width);
    metaData.height = Number(devicesQuality.height);
    nodeSendStream.send("@setDataFrame", "onMetaData", metaData);
    once the stream is recorded I can see only metData.width and height. createdby, creationdate and tags don't exist.
    notice: I encode and stream from FP11.1 in H2564 with speex or pcmu
    Thanks

    well,
    I exactly respected the example of the link you gave by modifying the Application.xml, but if it was a segment problem
    how can you explain that the NON custom metadas are successfully modified ?
    please check this link
    http://help.adobe.com/en_US/flashmediaserver/devguide/WS5b3ccc516d4fbf351e63e3d11a0773d56e -7ff6Dev.html
    I even tried the official property called createdby and creationdate without success. I was able to change only  width and height
    the code I use from the client is exactly the example of adobe manual, in AS2 and AS3
    Thanks

  • Add metadata to Flash flv file?

    I am trying to add metadata to a Flash Video file (in hoping Google can index my video).  I have Premiere CS3, and in the help menu it says, "Using Adobe Media Encoder, in the Export Settings dialog box, select XMP Info on the settings tab menu".
    For the life of me, I cannot find the XMP setting tab.  Anyone know the best way to accomplish this task?
    Thank you!

    I do not use CS3 but i think its under the little wing menu next to 'Others'
    Looks like this:

  • Reading video size without onMetaData on live stream.

    Hi,
    I am a Flash developer and practically know nothing about
    FMS.
    We encountered a situation when our encoder (not Adobe's one)
    doesn't inject metadata into a live stream. So, there is no
    onMetaData on the stream. When stream is in 16x9, our players don't
    resize the stream according to it's ratio and always display it in
    4x3.
    Is there a way to read width and height of the video even
    though there is no metsdata? Perhaps a method that can be invoked
    via responder similar to getStreamLength.
    Video is streamed via Akamai.
    Interestingly enough when we view the same stream in Akamai
    player - video is resized to the proper dimensions/ratio AFTER a
    few seconds. Obviously Akamai has a mechanism to detect video
    dimensions.
    Any help will be greatly appreciated.
    Thank you.

    My ignorance is the problem.
    AS3 Video class has videoHeight and videoWidth properties
    that can be used in case onMataData is not called.

  • Embed live cue data in live stream?

    I am currently using the new FME to encode live to a FMS.
    Both applicatioins are running on the same machine. Is there a way
    to embed live cue and metadata into the live stream? Once embedded
    we want to record the stream AND send it on to viewers. Is there a
    way to process this on the server. The live cue and metadata is
    coming in the serial port.

    Hey Flasher,
    I got the same issues as mentioned in the posts above. I am
    using FMS for live streaming and I want to embed metadata into the
    live stream. So far, I'm using a server side script that calls the
    Stream.send() method, but I'm not sure if there are other (better?)
    ways how to achieve this situation. What do you think?
    Here are some questions that came up:
    1) When using Stream.send(), is the message directly embedded
    into the stream (like some header information)?
    2) Is this message somehow comparable to cue points used in a
    FLV file?
    Thanks in advance!

  • 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.

  • My Ipad's photo program freezes while trying to add a picture to a shared stream.

    My Ipad's photo program freezes while trying to add a picture to a shared stream.
    I click into the photo click the box with the arrow and once I click "iCloud" nothing happens. I have to force quit the app to regain control. The photo does not add. I tried this with my iphone (both io ios 7) and the phone works fine.

    same discussio here https://discussions.apple.com/message/23545765#23545765

  • When trying to view the Paul McCartney live concert, I received an error that this computer does not support live streaming

    When trying to view the Paul McCartney live concert, I received an error that this computer does not support live streaming

    If you're referring to streaming via itv.com, the minimum system requirements can be found here.

  • Hi in need of help trying to add a live voting system

    i am trying to add a live voting system to my website basically two buttons one dislike and like its quite hard to explain a good example is www.truelad.com they have the set up that i want and i am quite confused on how to do this.
    any help would be mch appreciated
    oyea and i want it to be live and login feature

    Which server-side programming languages and databases are you using for your site? 
    There are several voting widgets (plug-ins) available for WordPress, Joomla! & Drupal. If you're using one of those frameworks to build your site, that's probably where you should begin searching. 
    Nancy O.

  • Having trouble watching live streams such as jtv and twitch.tv. I tried uninstalling/reinstalling adobe flash but I still get no stream just ads and pictures. Anyone have any suggestions?

    Having trouble watching live streams such as jtv and twitch.tv. I tried uninstalling/reinstalling adobe flash but I still get no stream just ads and pictures. Anyone have any suggestions?

    I just wanted to follow this up by saying that you were entirely correct in your diagnosis of the situation.  My computer did have the faulty part you linked to.  I brought my laptop in and specifically told them to run that test, had it fail and then argued with the person at the genius bar and the manager.  Eventually they offered to have it sent out and have everything replaced for free of charge.  They did so mainly because I had complained about graphical issues almost every other time I had come in with problems and no one ran the test.  They should have caught this problem during my warranty, but they didn't, even though I mentioned the problem.
    Anyhow, after having the part replaced, I haven't had my computer crash a single time since, or had many of the issues mentioned above.  I've never had this experience before.  Even brand new, I got occasional crashes.  Hopefully this new trend continues.
    I do find that web browsing is still incredibly slow.  Web browsers just chug along at a slow pace, even though I have great internet speed.  Maybe I'll try just deleting my web browsers and reinstalling them...
    Anyhow, thank you for your help and knowledge Clinton.

  • Is there a way to stream Coachella? I found last years stuff but no live stream so far. I tried to us my kids iPad but the YouTube Coachella channel requires flash.  Any thoughts?

    Is there a way to stream Coachella? I found last years stuff but no live stream so far. I tried to us my kids iPad but the YouTube Coachella channel requires flash.  Any thoughts?

    Try opening this link on your phone: http://m.youtube.com/#/user/coachella?client=mv-google&reload=3&rdm=m2075q4mp. It doesnt work on the Macbook but it works on my phone..
    FYI the resolution / quality when airplaying from iPhone to Apple TV was atrocious!
    if you figure out how to get it going good on the Apple TV let me know!

  • Trying to find lowest latency setting for FMS 3.0 live streaming app

    Hi,
    I work for a technology company in the agricultural industry,
    and we recently bought Adobe FMS 3.0 for live streaming of an
    online auction application. Initially the tests were ok, but the
    stream latency is becoming a real issue. It starts at around 1s
    delay, which is barely acceptable, but an hour into the sale it
    stretches to 2-3s, and more. This is becoming a real deal breaker
    for the Flash solution that looked very promising at the beginning.
    We need to find the absolute lowest latency setting for the
    live streaming application supplied with FMS3.0.
    Low latency (1s max) and stable latency has highest priority,
    more important than picture quality or uninterrupted streaming.
    How can we achieve this? Are there any settings where I can
    tweak the stream latency?
    I am not a Flash expert, but I can find and modify the
    configuration files on the FMS Windows 2003 server.
    Any help would be immensely appreciated.

    On server side:
    FMS installs itself with default configurations optimized for
    Max CPU efficiency. Reducing/shutting-off FMS publisher queues
    using Application.xml config should help in removing the delay that
    you experienced.
    <Application>
    <StreamManager>
    <Live>
    <Queue enabled="true">
    </Queue>
    </Live>
    </StreamManager>
    </Application>
    Changing default setting to <Queue enabled="false">
    disables live publisher queues & aggregate messages ad
    therefore "the delay". (the delay should be reduced to <100 ms
    for a perfect kind of network or LAN)
    --> On client side: Do NOT use NetStream.setBufferTime API
    at all ! i.e. do not set any buffer on client side.; Flash player
    (upto 10, the current version) would try its best to keep the
    buffer around 0.1 seconds, which is the default value.
    OmicronPersei8,
    Which publisher are you using to publish the live stream?
    Sometimes , it is possible that a some fault at stream publisher
    may make buffer at flash player grow.
    I hope this would help !

Maybe you are looking for

  • How to call stored procedure in remote database

    Hi: I have a stored procedure in Oracle 8i database A on server A. I would like to call a stored procedure in Oracle 8i database B on server B. Both servers are on the same network. Is there an easy way to accomplish this using PL/SQL? What's the "be

  • Transferring Songs from Computer to MP3 Pla

    I bought a creative zen sleek photo last July and it always takes me awhile to put new songs on it as I have to drag and drop or to rip a CD. So I was wondering if creative had anything like itunes where you could have all of your music on your compu

  • New voice file for E7 Text-to-Speech

    Hi, There is only one Language/voice file available in my Nokia E7. I want to have a female voice and there is no download available for E7 (on download language and voide webpage:  http://europe.nokia.com/support/product-support/text-to-speech). ple

  • Wrt54gs v7 wireless/wired connections

    I recently replaced my BEFSR41 with the WRT54GS to add wireless capability to my home LAN. When I initially set up the new router I had trouble getting the wired ports to accept connection, finally got it set up, now cannot get wired ports to connect

  • 5th attempt to install Oracle

    When I try to install Oracle on Slackware 3.3, after 1 hour of installation I get an error during attempt to run bin/lsnrctl start. In in lsnrctl.log following strings appears: TNS-0155: Incorrectly specified SID_LIST_LISTENER parameter in LISTENER.O