Stage Video Frustrations

I was recently asked by a client to take a look at Flash Player 10.2’s new Stage Video.  This isn’t for your typical web video display, but for digital signage.  There is no nice way to put it but large scale Flash displays (720p, 1080p) have sucked in the past, and when you added in Flash video, it got worse. My client came up with their own solution that, interestingly enough, is very Stage Video-like.  It isn’t perfect, and can only run on Linux boxes, so that’s why I was asked to look at Stage Video.   I’ve worked with video before in Flash, and have even done my fair share of work with OSMF, but I’m in no ways one of the many experts out there.  I know enough to get’r done.  There are far more people out there more deeply entrenched in Flash video, so if you feel that I’ve stated anything incorrectly, please let me know and I’ll be happy to update my post.

All my example code (FlashBuilder 4.5 project) is hereLINK
I’m putting the project up instead of links to examples online because I dont want bandwidth issues to play a part in anyones testing, and the clients stuff is all loaded locally as well.

So I started looking at Stage Video about a week ago.  I didn’t touch it at all during the beta period.  Now, my client was interested in some baseline tests that mimicked some of their use cases.  During my tests, I immediately starting running into little issues, that really got me frustrated.  I’ve tweeted a few of the problems I’ve encountered, but at this point, I’d have a hard time recommending Stage Video to my client.

Issue #1:  Looping of Stage Video [ OSMF Looping fixed with OSMF 1.6 Sprint 5]

My first attempt with SV was extremely basic.  I just wanted to play a video and loop it.  Easy enough, right?  You’d think.  I set up my SV example pretty much just like I would when using the “old” way with NetConnection and NetStream, listening for the NetStatusEvent “NetStream.Play.Stop” and then seek(0) and have it loop.  In all my tests, I got a noticeable “blink” when the video would loop.  I never noticed any blinking of the video if I didn’t seek, or if I paused and did a seek, but if it was just a seek(0), and the NetStream was playing, “blink”.  I even tried pausing, seeking and then resuming, and still got a blink.   Two interesting tidbits:  1) If I set up a timer to watch the time, and manually looped it about .5 second before the end of the stream, it worked fine, but didn’t work if I tried to manually loop it right at the end, instead of waiting for the NetStatusEvent   2)  According to a response to my original tweet, this is fixed in OSMF.  Great.  really? I have to use OSMF to loop? Okay.. I’m game. . whatever.  I’ll be honest, I probably should look at what OSMF is doing under the covers to get around this, because the moment I moved over to using OSMF 1.6 Sprint 3, it was able to loop w/o blinking.  Problem solved, right? Just use OSMF 1.6..   Yeah.. not so fast….

[Update]

I was able to confirm this blink on my 2010 iMac, 2011 MacbookPro and also a quad-core Dell running Vista.  All the computers were running the latest FP 10.2.159.1, except the iMac which is running the latest RC of 10.3

I put an example here on line with the test showing the blink:
http://www.yapiodesign.com/test/stagevideo/StageVideo_LoopBlink.html

I also put a Quicktime capture of the blink on my iMac:
http://www.yapiodesign.com/test/stagevideo/StageVideoBlink.mov

[UPDATE – June 16th]
With the latest OSMF 1.6 Sprint 5, the issue of the video blinking when looping has been resolved.  One issue down, more to go!

Bug logged: Flash Player JIRA #6806

Issue #2:  Starting OSMF using Stage Video after a Mouse Click

Yeah..  the title should confuse you. What?  A mouse click?  seriously.  After I got over the blinking issue using OSMF, I was setting up tests and using buttons to display the various tests.  All the sudden, my videos were playing audio, but not video, until they looped around once, and then the video played on the 2nd loop.  WTF?  If I forced OSMF to not use Stage Video, things worked just great. No problems.   If I took out the button control and had the OSMF Stage Video test start after ApplicationComplete event, things worked just fine.   Add in a button and things got weird.  I’m completely stumped WTH is going on here.   I’ve narrowed down the issue ( I THINK), to autoPlay = true, and loop = true.  If I set autoPlay = false, and then mediaPlayer.play() things work.    I’m going to chalk this up to a bug in OSMF 1.6 Sprint 3 and I’ll be submitting a bug to the OSMF Jira once I post this and post the Bug report # here.   OSMF 1.6 is beta. I get that.

Bug logged: OSMF(Strobe) JIRA #1297

Issue #3: SerialElement

Ok.. This isn’t related to Stage Video, but while I have your attention….here goes.  According to Adobe, the Serial Element definition includes “The media elements that make up a SerialElement are treated as a single, unified media element.”.  So my silly thinking would say that using a SerialElement that OSMF would handle making sure all those elements are ready to go when needed.  Turns out I’m wrong.  As OSMF encounters a progressive media element as part of SerialElement, it loads it when it encounters it, and doesn’t preload it at all.  So if you have 4 child elements in your serial element, child 2 is only loaded once child 1 has completed.  I’m using local assets and its bad enough, so I imagine loading from a web server is only that much worse.  After doing a few google searches, turns out that is the intended behavior.. or that’s what I read on an Adobe forum.  I’m sure I could dig up the link if anyone is interested.  But what a silly thought.  Who would want that?  So my answer is to preload all the elements myself.  Luckily, I found a solution buried (yes, buried) in the OSMF examples.  …and guess what? It works fine when using “regular” OSMF, but failed me when I was trying to use OSMF 1.6 with Stage Video.  Great..   All I’m asking if for Adobe OSMF team to a) add the ability to tell OSMF to preload the SerialElement child elements….and maybe in the process, take care of the duration issue as well. If I have to handle preloading the child elements myself, and have to tell OSMF the default duration of each child media element, I’m not really sure why I’m using Serial Element at all.

Issue #4:  SerialElement Looping

Ok.. so after all the drama of #3 above, I said hell with preloading the SerialElement child mediaElements, and just told OSMF 1.6 to loop the SerialElement using Stage Video.  I got pauses between the child media elements, and then it looped, and then things got very weird.   I set up  4 child media elements as part of my Serial Element.  The first time around, all the videos played. Once the loop started, it played child 1, but nothing displays for child 2, 3, 4.. loops around plays child 1, skips 2, 3, 4..and repeat.    Ok.. Another OSMF Jira bug going to get logged.

Ok.. appears this one may already be logged:  JIRA # 1226

Issue #5:  Stage Video Hardware Decoding and Rendering

What is the secret sauce to get Stage Video to use hardware decoding?  I know the hardware requirements on Apple seem to be limited to nVidia GPUs.  So that rules out nearly every top of the line Apple system since Apple has switched to ATI.  Doesn’t matter who we place blame on for this, but not having hardware decoding sucks.  Ok.. on to Windows.  I tried my wife’s fairly new Dell quad core with Windows Vista (we didn’t’ get Win7 b/c her office hasn’t upgraded).  No dice.  Hardware rendering.. no hardware decoding.  Okay.. I’ll try one of the Linux boxes at my clients office.  yeah. dont laugh…I know.. but for kicks, right? You guessed it, didn’t work.   So I really have no idea what magic secret hardware sauce is required for users to get hardware decoding.

Where I’m left at this point:

Even after all the issues above, I’ve managed to find workarounds to at least get my tests working.  Stage Video, either when using it as-is, or with OSMF is definitely not a drop-in replacement.  I put part of that on OSMF 1.6 still in beta. I’m sure it will get better (hopefully).  I have no idea what hardware is required to get hardware decoding, and I’m not even sure if it would solve the video tearing I was seeing when I was using it. Right now, I really can’t see myself recommending Stage Video over my clients home-grown Linux Flash & video solution.  It would sure be nice to use Flash for everything, but that’s not a reality at this point.  So I’m going to log those bugs in OSMF Jira, keep watching twitter and the Adobe blogs for updates, and maybe we’ll get there eventually.

Side note (and a little more ranting):  We really need better examples out there for OSMF and Stage Video.  When OSMF first came out, the examples were overly simplistic, or buried deep in the OSMF svn.  Documentation was lacking.  Now we have StageVideo , and we have some great getting started examples, but I believe if there were anything beyond the extreme basics, some of these issues would have already been spotted.

Thanks for reading and providing any insight into workarounds.  I’m really interested to see what sticks I need to rub together to make hardware decoding fire.  Who knows…. maybe I’m holding it wrong.

 

 

 

17 thoughts on “Stage Video Frustrations

  1. Paul Gregoire

    Wow John, I really feel your frustration here 🙁 Luckily for me, I haven’t had to use OSMF or StageVideo yet but I know some of our guys at IR5 have run into issues. This kinda stuff makes me glad to be a server-side guy!

  2. Tim

    I have never figured out the hardware issue either. The SV events offer very little information and it is impossible to guarantee SV will even work, so it’s a crapshoot if a user will get any benefit from it. It’s a great technical advance for the flash player but it’s not really ready for prime time. I wonder if the HTML5 video implementation has the same issue with limited hardware profiles?

  3. Mihai

    Hi John,

    As a member of Adobe’s OSMF engineering team, I would like to thank you for trying out our product and for the feedback you have provided here. The OSMF version that supports StageVideo mode is indeed a beta one and we are focusing our efforts in making sure that the release version will provide the best experience to OSMF users. To achieve this we need feedback like the one you have provided in this article.

    Thank you for helping us getting better!

    Regards,
    Mihai

  4. YopYop

    hi,
    we’ve got a complete digital signage solution based on Stage Video in AS3 (video image and swf loader).
    It turns like a charm on a atom 1.8Ghz + ion2 in fullHD with multiple layer transparency and falloff + 108Op video.
    flash 10.2 hardware decompression works fine on our box under linux.
    The only prb is the microlag when we make addChild over the video

    sorry 4 my english, but it was only to say linux +ion +flash 10.2 are prefect for video even in 1080p

  5. Jundi

    Hi,

    I tying to play StageVideo with looping w/o blinking with OSMF

    but , unsuccessfully….

    can u please email – me with your code?

    thanks

  6. Jundi

    Hey John,

    I did it the Stagevideo looping without the “blinking” and without OSMF

    just in onPlayStatus put _netStream.seek(0);

    and worked just fine (my project is made by as3 but i think is not different)

    • Chris

      This actually seems to work, haha. Just move the seek from the “onNetStatus” method to the “onPlayStatus” method.

      I still get black flashes in between video streams (when chaining together videos), sure would be nice if you could grab bitmap data from StageVideo to use as buffering screen between videos.

      Anyways, thanks for the post!

  7. mike bresnahan

    I have tried Stage Video with very limited success.

    Macbook Pro, Flash Player: available
    Macbook Pro, AIR Runtime: unavailable
    iPhone4: available
    HTC EVO: unavailable
    HP corporate laptop, Flash Player: unavailable

    On my Macbook Pro, StageVideo works in the Flash player, but not in the AIR runtime. Can anyone explain that one?

    Flash Player:

    Capabilities.version=MAC 11,3,300,257 Capabilities.version=Mac OS 10.6.8

    AIR Runtime:

    NativeApplication.nativeApplication.runtimeVersion=3.3.0.3650 NativeApplication.nativeApplication.runtimePatchLevel=3650 Capabilities.version=MAC 11,3,300,257 Capabilities.os=Mac OS 10.6.8

    My app is very simple:

    And yes I have specified renderMode:

    direct

  8. mike bresnahan

    Note: my code snipets were scrubbed from my post above.

    • mike bresnahan

      I read that paragraph more than once, but I guess I wasn’t able to comprehend it. Without desktop support, how is someone supposed to develop an iOS app that uses Stage Video; sync with itunes every single compile-debug cycle? Port Flash Builder to iOS? Oh joy!

    • mike bresnahan

      Thanks for the heads up. I read that paragraph more than once, but I guess I wasn’t able to comprehend it. Without desktop support, how is someone supposed to develop an iOS app that uses Stage Video; sync with itunes every single compile-debug cycle? Port Flash Builder to iOS? Oh joy!

  9. mike bresnahan

    Oh cool. Thanks!

    Now if I could just get gpu decoding of a camera stream via Flash Media Server working on my iPhone4. StageVideo displays the stream, but StageVideoEvent.status == “software”. I’ve read that StageVideo will only use the gpu if the video format is H264 and I’ve read how to use H264 encoding of camera via H264VideoStreamSettings, but no go. I would like to verify that the stream is actually H264, but there are no obvious properties on NetStream or any of the NetStream events, nor does the Media Server admin console display any information. I also do not know how to determine the dimensions of the incoming video, because I never receive any metadata events. Streaming video is frustrating.

Comments are closed.