Skip navigation
ewhutson
Currently Being Moderated

using .smil files for dynamic streaming in playlists

Apr 21, 2009 11:40 PM

I have multiple questions, but I feel I would make more sense to explain my intentions.

 

I have a video player with a playlist written with AS3, along with an .XML settings file to edit the playlist.  I can successfully play rtmp:/ streams from my FMS server on the video player.

 

Though, I would like to use dynamic streaming using the dynamicStream.smil file with my existing video player/playlist.  Is this a proper approach for what I am trying to achieve?

 

Lastly, I have been unsuccessful taking the snippet code from the FMS, Dynamic Streaming sample page, and using it within an HTML document.  I assumed all I would need to change were the paths to where the rtmp:// video file, .smil, and the video player files were located on the FMS.  Any ideas?

 

Any help will be greatly appreciated.

 

Using: Linux, FMS 3.5, CS4

 
Replies
  • Currently Being Moderated
    Apr 24, 2009 3:25 PM   in reply to ewhutson

    This worked for me:

     

    1. I edited the SMIL example in the FLVPlayback 2.5 doc to point to the vod app and to the sample files that install with the vod app. I saved the file as "test.smil":

     

    <smil>
    <head>
    <meta base="rtmp://localhost/vod/" />
    </head>
    <body>
    <switch>
    <video src="mp4:sample1_150kbps.f4v" system-bitrate="150000"/>
    <video src="mp4:sample1_500kbps.f4v" system-bitrate="500000"/>
    <video src="mp4:sample1_700kbps.f4v" system-bitrate="700000"/>
    </switch>
    </body>
    </smil>

     

    2. I created an AS3 file in Flash, added the FLVPlayback 2.5 component, and saved the file to the same folder as the test.smil file.

    3. In the Component Inspector I set the source parameter to test.smil.

     

    HTH,

    Jody

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2009 12:36 PM   in reply to Jody Bleyle

    Ok, we'll get this dynamic streaming thing working by hook or by crook!  (Whatever that means)

     

    Jody, I followed your very easy-to-follow instructions above, and I am indeed seeing video playing (the lovely helicopter footage).

     

    However, it still doesn't seem to be swapping video files when the bandwidth changes.

     

    If I restrict the bandwidth (using NetLimiter)  way down to, say, 2Kbps, I don't see the quality of the video change.  After about five seconds of playing, the video starts stopping and starting, (barber pole and all), but I don't see things switching to a more highly compressed video file.

     

    What am I missing?

     

    Thanks,

     

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2009 3:27 PM   in reply to mrwizzer2

    i spoke with Brad Outlaw who created the DynamicStream class. he said all you need to do is point to a propertly formed SMIL file from the source property of the component. he also said your issue could be attributed to a bug he found in the component. he's planning to push an update (2.5.0.15) very soon to www.adobe.com/fms_tools.

     

    seems like we're dealing with a bug...

     

    jody

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2009 8:06 AM   in reply to Jody Bleyle

    Can you see if Brad can recommend the best way to test the Dynamic Streaming Class he created?  Would it be by using NetLimiter or similar?   The problem may be in the testing.

     

    I'm sure he's come up with a way to test multiple bandwidths in a typical authoring environment.

     

    Thanks Jody.

     

    Mike

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2009 10:38 AM   in reply to mrwizzer2

    Brad says:

     

    There are a number of ways you can test it.  NetLimiter is one option.  With that you can throttle back the bandwidth at an OS driver level and properly test the behavior of maxBytesPerSecond.  Some of the more advanced scenarios involve things like Shunra (which is expensive and cumbersome to set up but good if someone has access to it).  The simplest test case would be to use the setBandwidthLimit method on the DynamicStream class.  Since it overrides the values returned by maxBytesPerSecond, you can arbitrarily assign values there more easily.  The only caveat to the setBandwidthLimit approach is that if your actual maxBytesPerSecond is lower than the values you set for bandwidth limit, maxBytesPerSecond takes precedence.

     

    HTH,

    Jody

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 15, 2009 1:31 PM   in reply to ewhutson

    Hi Jody,

     

    Could you ask Brad if he can confirm that Dynamic Streaming works with SMIL files and H.264/AAC encoded content in MP4 format?  I was wanting to rebuild our video player using his new FLVPlayback 2.5. component but I have been frustrated to the point that I'm ready to give up.

     

    We use Limelight as our CDN and I have placed a SMIL file on our HTTP progressive download server "x.com" at the following location:

    http://x.com/test/waf_2385_preview.smil

     

    Here are the contents of the SMIL:

     

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/2001/SMIL20/SMIL20.dtd">
    <smil xmlns="http://www.w3.org/2001/SMIL20/Language">
        <head>
            <meta base="rtmp://x.com/myapp/" />
        </head>
        <body>
            <switch>
                <video src="mp4:test/waf_2386_preview_180p.mp4" />
                <video src="mp4:test/waf_2386_preview_360p.mp4" system-bitrate="600000" />
                <video src="mp4:test/waf_2386_preview_720p.mp4" system-bitrate="1200000" />
            </switch>
        </body>
    </smil>

     

    I have the <meta> base pointing to the proper location and have made sure to include the mp4: in the stream names to allow it to properly play H.264 MP4 content.

     

    Finally, I point the source property of the FLVPlayback instance to the http location of the SMIL file:

    video.source = http://x.com/test/waf_2385_preview.smil;

     

    The trouble I am having is related to the NetConnection manager(s) that FLVPlayback uses. With the above code, if I set the following before the source:

    VideoPlayer.iNCManagerClass = fl.video.NCManagerNative;

    the first video in the playlist (the 180p file) begins to play fine but it's ALWAYS the 180p file that it plays.  It's as if the FLVPlayback component never performs a bandwidth calculation to determine which stream it should connect to. Setting the video.bitrate property to a static value such as 800000 to have it automatically connect to the 360p file doesn't seem to do anything either... it will still load the first file in the list, which happens to be the 180p file.

     

    However, to take advantage of dynamic streaming, all the articles I have said you need to use the following code:

    VideoPlayer.iNCManagerClass = fl.video.NCManagerDynamicStream;

    When I use this code, FLVPlayback seems to pull the SMIL file off the server but then does absolutely nothing with it... it doesn't buffer, doesn't fire any video events, nada.

     

    Any help or advice in getting this to work would be greatly appreciated.

     

    Regards,

     

    Sean Smith

    Digital Media Developer

    www.ORLive.com

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 15, 2009 3:18 PM   in reply to seanhsmith

    Sean,

     

    For the NCManagerNative method, reverse the order of the bitrates in the SMIL file.  Highest to lowest.

     

    For the DynamicStream NCManager (which is by default in FLVPLayback 2.5) try defaulting the lowest system-bitrate to 0.

     

    - brad

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 18, 2009 5:57 AM   in reply to ewhutson

    I too have noticed some unpredictable playback issues, even with FLV Playback 2.5.0.15. When I was testing with the sample dynamic streaming content that comes with FMS 3.5, I found two possible scenarios.

     

    1) Download the video stream as normal over LAN. Quickly, the player will adjust to playback the highest quality. During playback, I enable NetLimiter to significantly reduce my bandwidth so that I would fall into the lower streaming bracket. Eventually the video buffer depletes and the player goes into buffer mode; however the player never reduces video quality. It eventually becomes a stop-and-go experience for the remainder of the video.

     

    2) On the same stream, I stopped the video and reset the source. When the video started (NetLimiter is enabled here), I noticed the player continued to run the highest quality and remained there. It spent a couple seconds buffering and once again went into a stop-and-go experience.

     

    Maybe NetLimiter is to blame here, I don't really trust it and I would have preferred to limit the bandwidth from FMS (the server options don't seem to work). If the OP does get this to work, I would like to know so that I can feel better about my testing environment.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 22, 2009 7:10 AM   in reply to Brad.Outlaw

    Brad,

     

    Thanks for the extremely timely response! I hadn't even finished driving home from work when I received the email on my phone.

     

    In short, I've discovered that the reason I could not get the Dynamic Streaming to function with FLVPlayback and our Limelight account is the fact that the server we are on has apparently not yet been upgraded to FMS 3.5.  I installed the Developer Edition of FMS 3.5 on a spare machine here at work and now Dynamic Streaming works fine.

     

    Also, to augment what another user has posted, I too am noticing some inconsistencies when using NetLimiter to test stream switching.  Sometimes it works, sometimes it just sits there and buffers repeatedly... I am guessing this is probably an effect of how NetLimiter throttles the bandwidth.

     

    Thanks again for your help and suggestions!

     

    Regards,

     

    Sean Smith

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 22, 2009 7:36 AM   in reply to Brad.Outlaw

    Brad,

     

    Sorry, I have one more quick question... how does the FLVPlayback component handle nonexistent/invalid stream names in a SMIL file?  Will it successively try each one until it finds one that works?  Does it "skip over" these invalid files when it dynamically switches streams?

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 22, 2009 12:13 PM   in reply to ewhutson

    @seanhsmith - NetLimiter is sufficient but not really the best to be testing the dynamic streaming with.  In short, NetLimiter works by sending data, then withholding data for a few seconds alternating.  It isn't necessarily characteristic of real world behavior.  We've mostly switched to using the Shunra desktop client now since it's more reliable.

     

    Regarding the invalid stream names.  It won't check the validity of the stream names for unsupported characters, etc....  However, the failover behavior in the DynamicStream class (which is what FLVPlayback uses) falls back to the previous stream ID it was playing before it attempted to switch.  If the initial stream play doesn't work, it will likely fail.  I have a note to myself to do some house keeping in this area.  I just don't know when I'll be getting around to it.

     

    @ewhutson - I'm not familiar of any issues using Telestream content, but that is helpful to know.  I will let our Quality Engineer's know about this.  If you don't have an issue sharing the broken content, I would like to get that to our QE's so that they can add it to our testing metrics.

     

    Thanks.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 12, 2009 11:54 AM   in reply to Brad.Outlaw

    Hi Brad,

     

    Thanks again for your responses; they have been extremely helpful.  I have one more question that hopefully is quick to answer, but it is somewhat unrelated to the original post of this thread and it involves full-screen mode using the stage.fullScreenSourceRect property.  I noticed the FLVPlayback component automatically takes over the screen when entering this mode and that it can be prevented by setting FLVPlaybackInstance.fullScreenTakeover = false; -- however, this causes it to render at its native size.  My goal is to set the stage.fullScreenSourceRect to the screen resolution of the user's CURRENT monitor (i.e., the monitor the browser uses when going into full-screen mode in a multi-monitor setup).  I have had some success in using ExternalInterface to get the Javascript screen.width and screen.height values, but this only appears to work in Firefox, Safari and Chrome.  IE and Opera always report the primary monitor's resolution... which is also what the screenResolutionX and screenResolutionY properties of the flash.system.Capabilities class apparently always report as well.

     

    Since we cannot set a "scalable" value to the width and height properties of FLVPlayback (i.e., 100% of the container its container), is there a way to use the fullScreenTakeover method but also allow control elements to be layered on top of it?  Or, is there another, reliable way to detect the current monitor (not primary monitor) through Flash that you know of?  Hulu's media player does not appear to be affected by this issue in any browser and I haven't been able to find a solution for it either.

     

    Regards,

     

    Sean Smith

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 5, 2009 2:11 PM   in reply to Brad.Outlaw

    Brad,

     

    I've run into another problem using FLVPlayback with Dynamic Streaming that I have tried to solve unsuccessfully myself.  In essence, my player is designed so that Javascript can call into it and tell it to load a different video.  It downloads the XML that defines the player's look (background image, whether video is live or on-demand, etc.) and then sets up the FLVPlayback component again after removing all of its event listeners, etc.  The first video that is loaded into the player works fine, but subsequent calls into the player to load the video result in a "NO_CONNECTION" VideoError being thrown.  It seems that any attempt to set the source property of the FLVPlayback instance when using the NCManagerDynamicStream class is not allowed.  Choosing the initial video to load again results in the video loading and playing normally.  Do you have any suggestions to get around this error and accomplish what I'm trying to accomplish?  Limelight has just activated FMS 3.5 for us and I'm anxious to get the new player out there to take advantage of Dynamic Streaming, but I need to get around this issue first as we are going to be using playlists in the future.

     

    In case I wasn't making any sense above, an easy way to test and see what I'm talking about is create a simple app with two buttons.  When you click each button, set the source property of the FLVPlayback instance to a different SMIL file -- the first one you do should load fine but trying to switch to the other one results in nothing happening if you have no event listeners or the VideoError.NO_CONNECTION event error being thrown during the VideoEvent.STATE_CHANGE event.

     

    I should note that this does NOT seem to happen if you are simply pointing to a single video file through the source property -- it seems to be only switching sources between SMIL files that present a problem.

     

    Regards,

     

    Sean Smith

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2009 8:29 AM   in reply to seanhsmith

    I posted this defect as well as a workaround a while back. You can read about it here: http://forums.adobe.com/thread/443428?tstart=0

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2009 7:02 PM   in reply to TheNuttyNut

    Thanks for the suggestion.  I tried this earlier today while I was at work and it didn't seem to solve the problem I'm having.  As I said before, we are using SMIL files for all of our video content since we offer multiple bitrates for the same content and I wanted to take advantage of dynamic streaming now that it's available. The first time I set the source property to a SMIL file when the player loads, everything works fine.  The problem is when I try to load another video into the player... every other SMIL file other than the inital one that loads results in a VideoEvent.STATE_CHANGE event firing with a VideoEvent.CONNECTION_ERROR type and the video(s) never play.  As soon as I load the initial SMIL file again, it works fine.  What I don't understand is that everytime I go to load another video, I stop/close the current video, unregister all of the FLVPlayback instance's event listeners, and then literally re-create the instance again by using = new FLVPlayback() so it should be creating a new instance each time, yes?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 7:27 AM   in reply to seanhsmith

    Are all your SMIL playlists multibitrate or are you switching between multibitrate and common progressive / RTMP protocols? I didn't notice any problem switching between SMIL playlists in our player. It was only when switching between dynamic and regular streams that the FLVPlayback threw an exception. It didn't matter if they were SMIL or not. Also, if memory serves, the net stream class is a static member in the video player. Since that was the class I had issues with, if you didn't patch it then your new FLVPlayback instance is likely still using a corrupted state and hence why you're still getting the error.

     

    I would suggest you load the FLVPlayback source code into your project. Generate the exception again and trace the issue back into their source code to find out what's causing it.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 9:12 AM   in reply to TheNuttyNut

    Pretty much all of our SMIL files are multi-bitrate... we've done two encodes for all of our content since before I've been working here.  There are a few pieces that could possibly only have a single video element in the SMIL file, but I have not even tested any of those yet.

     

    I've gotten close to solving the problem I think... I essentially took the code you suggested for the fix and after doing _isDynamicStream = false;, I did _owner = new VideoPlayer(); which prevents the exception from being thrown but it also still doesn't make the video play again.  I've spent a good portion of the day already pouring over the source code for all of the classes that comprise the fl.video package and I still haven't figured this one out yet.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 10:49 AM   in reply to ewhutson

    Recreating with a new FLVPlayback() shouldn't carry over any state from the previous instance.  You mentioned Limelight, so I'm curious to know if you're testing this locally or with Limelight?  I apologize in advance that I am not up to speed on the various authentication techniques that all of the CDN's use, but is it possible that subsequent videos you're passing in may be failing authentication?  Also, are you certain all the server's you're connecting to are FMS 3.5?  You must be connected to FMS 3.5.x or else it won't work.  There is a server version check in the component that ensures this.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 11:02 AM   in reply to Brad.Outlaw

    Yes, we use Limelight as our CDN.  We were told that they had upgraded 20% of their servers but that we were included in that 20% and were basically given the "green light" to start using the FMS 3.5 features.  To my knowledge, there is no authentication technique to use for on-demand content or at least there wasn't before (live is a different story).  Is there a variable I can access from the FLVPlayback instance so that I can check what version of FMS it is currently connected to?

     

    After having played around with this issue for awhile, I'm beginning to think the problem lies somewhere in either the NCManagerDynamicStream, ConnectClientDynamicStream or something to do with SMILManager (or one of their parent classes) because I don't have this issue at all when using the standard NCManager class.  When I call into the player to load a new video, it downloads the "player" XML file from our server that defines a bunch of things like video title, auto play, video state (pre, ready, live, etc.) which, in turn, determines whether it is a live stream or an on-demand stream.  It then calls another function after parsing this information that prepares the video player. I use this line to set the NCManager class based on whether the XML file says the video is "live" or "ready" (live or on-demand):

     

    // Set the appropriate NCManager class

    if (_isLive) VideoPlayer.iNCManagerClass = com.orlive.NCManagerLimelight;

    else VideoPlayer.iNCManagerClass = fl.video.NCManagerDynamicStream;

     

    // Create new date to use in URL to prevent caching

    var date:Date = new Date();

     

     

    // Create new FLVPlayback

    _video = new FLVPlayback();

     

    // Here I add all my video event listeners

    // Here I set all the video properties like autoPlay, isLive, width, height, etc.

     

    _video.source = "http://www.server.com/path/to/smilFile.smil?" + date.getTime.toString();

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 11:10 AM   in reply to seanhsmith

    in NCManagerDynamicStream, at line 176 (try..catch for fmsvers), add a trace statement before it, i.e. trace("version is " + e.info.data.version).

    Save, make sure you have/add a source path to the file you just edited and make sure you include it in an import statement.

    "import fl.video.NCManagerDynamicStream;"

     

    Run it through a debugger.  If it traces undefined or blank, then you're not on FMS 3.5.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 11:27 AM   in reply to Brad.Outlaw

    Brad,

     

    I haven't tried your suggestion yet but you might've hit the nail on the head.  It might've just been blind luck that the video I was testing with as the initial video is coming off of an upgraded server and the rest are not because I set the player's initial video to one of those that failed and it fails immediately.  If I set it back to the other video, it plays fine.  I have sent our Limelight rep an email asking them to verify if this is the case or not... if it is, I apologize for the wild goose chase and am kicking myself for not testing another video sooner.

     

    - Sean

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 12:49 PM   in reply to Brad.Outlaw

    Brad,

     

    Just out of curiosity, would FLVPlayback throw a VideoState.CONNECTION_ERROR state change if you had set the VideoPlayer.iNCManagerClass to NCManagerDynamicStream and it tried connecting to an FMS server that was not upgraded to FMS 3.5?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2009 1:23 PM   in reply to seanhsmith

    It shouldn't.  It would set that state if a) it didn't get connected to FMS for some reason or b) the stream name you requested was not found.  Even if the version check fails, it should simply procede forward and establish a NetStream instead of a DynamicStream.  Are you certain the stream names you're passing in are formatted correctly?  If they're MP4 types instead of FLV, are you defining the stream names as e.g. mp4:stream.mp4?  MP4 files on FMS require mp4: prefix and extension unlike FLV which doesn't require the prefix and extension.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2009 5:56 AM   in reply to Brad.Outlaw

    Hi Brad,

     

    I just wanted to let you, and others posting to this thread, know that a Limelight Operations Technician helped us diagnose what the issue was.  It turns out it wasn't the player or their servers... it was the SMIL files.  He informed me that we should no longer include file extensions when referencing the path to the files/streams.  As soon as I removed the .FLV extensions from all of the stream names, everything began to work perfectly.  Brad, when you mentioned above that it doesn't need the prefix or file extension, I assumed that you meant it was optional to use the file extension for FLV, as it always had been.

     

    - Sean

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 27, 2009 11:48 PM   in reply to seanhsmith

    I understand from this post that switching smil-s in the FLVPlayBack class appears to be supported.  I am starting with the videoPlayer sample that ships with the dev FMS server.  I've tried a bunch fo things, including adding a call to vp.close()  and I cannot get a second smil to play.  At first it gets stuck in the loading state.  If I force through by this by calling close() then VideoPlayer._play() only gets called intermittentaly.  More of the story is that I get exceptions in DynamicStream getQOSAndSwitch() and others.

     

    Can anyone provide a code snippet or example which is working for them?  Preferably using the videoPlayer sample as a starting point?


    Thanks,

    Doug 

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2009 9:51 AM   in reply to DaddyDog1

    Hi Doug,

     

    The video player sample that ships with FMS doesn't support dynamic streaming. The FLVPlayback component v2.5 supports dynamic streaming.  You can download it at http://www.adobe.com/fms_tools. It uses the DynamicStream classes created by Brad Outlaw, the Adobe developer on this thread.

     

    The other option is to use ActionScript to write your own dynamic streaming solution. For more information see, http://www.adobe.com/go/learn_fms_dynstream_en.

     

    HTH,

    Jody

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2009 10:08 AM   in reply to Jody Bleyle

    Hi Jody,

    I must be confused on where I got the videoPlayer, but I have dynamic streaming working thanks to the sample code.  I am unable to switch between two different smil-s.   Per a post in this thread by Brad this should work, unless there is more confusion on my end, which is entirely possible.   I am able to switch between flv-s.  I do not have the need to switch between flv -> smil or the converse.   Can you point me to any known to be working code which switches smil-s on the fly without using stacking/hiding FLVPlayBack.  The flv analogy to this is swtiching the .source.  Thanks,

    Doug

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2009 10:24 AM   in reply to DaddyDog1

    Hi Doug,

     

    Are you using the source property of your FLVPlayback instance?  I think I ran into the same problem where it was throwing a run-time error on me if you simply try to set the source property again to a different file.  The way I was able to get around this is to actually re-instantiate my instance of FLVPlayback and then change the source property... in essence, you have to set it up all over again.  For example, you have your instance of FLVPlayback defined:

     

    private var player:FLVPlayback;

     

    And then you could define a method that you pass a URL for the SMIL file into that sets everything up for you:

     

    private function setupVideoPlayer(url:String):void {

     

         player = new FLVPlayback(); // Create a new instance
         // Any extra properties you need to setup, such as autoPlay, etc.

         player.source = url; // Parameter that is the URL to the SMIL file

     

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2009 10:44 AM   in reply to seanhsmith

    Hi Sean,

     

    Thanks a ton for the input, I've read and re-read your posting here.

     

    I'm trying to avoid a new FLVPlayback() because I have eventing hooked up to the original, but I may end up going this route.

     

    Can you clarify which FLVPlayback you are using, I may be on the wrong code base.  I am using the sample/source/videoPlayer project as a starting point, the one that ships with Adobe Flash Media Server 3.5.1 r516.  (Sorry I can't be more specific).   The smil parsing is done by a wrapper videoPlayer class which wrapps FLVPlayBack.  Setting the FLVPlayback.source = *.smil is not an option.   Under the covers play2() is called with a DynamicStreamItem, all of which was initialized in videoPlayer.

     

    For my use case, we have a limited number of videos, so it may be that I can use the FLVPlayback::videoPlayer array and do the management -- hide and show -- of these objects. 

     

    Does anyone have any input on if the later option will work, should work, has worked in the paste.   Restating, has anyone had success managaing the FLVPlayerback::VideoPlayer array with a stack of video players?

     

    --Doug

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2009 10:50 AM   in reply to DaddyDog1

    Well, I'm using the SWC for FLVPlayback 2.5 that was updated a couple of months ago from the Adobe Tools website:

    http://www.adobe.com/products/flashmediaserver/tool_downloads/

     

    Some bugs related to it were fixed... I'm not sure if what you're experiencing is one of them.  And the way my player works is that each time I need to setup my player again, I first remove all of its event listeners and then set them back up again after I've re-created my instance of FLVPlayback.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2009 11:06 AM   in reply to seanhsmith

    Hi Sean,

    Thanks for the reply. I did a diff of the two FLVPlaybacks, and it looks like there are a few bug fixes.  Can you confirm that you are able to point FLVPlayback.source = "http://your.playlist.smil",call play() and not play2() and everything just works?  Thanks a ton!

    --Doug

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2009 11:20 AM   in reply to DaddyDog1

    Oh yeah... I've never used the play2() method.  And actually, unless you are explicitly setting the autoPlay property to false, you can just set the source property to the URL of your SMIL and, assuming the SMIL is well-formed and properly defined, it should just begin to play.  Another way to do it is with autoPlay set to false, add an event listener to it for VideoEvent.READY, and then call the play() method from the event handler method but it's just easier to leave autoPlay set to true.

     

    On a side note, I did run into some issues defining stream names in the SMIL files depending on what type of file(s) the streams are -- specifically a standard FLV vs. an H.264 encoded MP4 file.  It turns out that if it's a standard FLV, you want to leave the file extension off of the stream in the SMIL file.  For example, here's a SMIL file using two FLV's:

     

    <smil>

         <head>

              <meta base="rtmp://your.fms.server.com/root/path/"/>

         </head>

         <body>

              <switch>

                   <video src="myvids/lowbitrate" system-bitrate="250000"/>

                   <video src="myvids/higherbitrate" system-bitrate="650000"/>

              </switch>

         </body>

    </smil>

     

    The above example is correct if your application path is rtmp://your.fms.server.com/root/path/  and you are using files located in a folder called myvids that are named lowbitrate.flv and higherbitrate.flv (and are 250 Kbps and 650 Kbps respectively).

     

    Now, let's say they were MP4 files and not FLV's. The SMIL changes slightly here; you have to include the mp4: prefix before the stream paths and you have to include the file extensions, which is the complete opposite of what is expected for FLVs:

     

    <smil>

         <head>

              <meta base="rtmp://your.fms.server.com/root/path/"/>

         </head>

         <body>

              <switch>

                   <video src="mp4:myvids/lowbitrate.mp4" system-bitrate="250000"/>

                   <video src="mp4:myvids/higherbitrate.mp4" system-bitrate="650000"/>

              </switch>

         </body>

    </smil>

     

    This is also true for F4V and M4V files -- essentially anything that's not an FLV video. Hopefully this will also save you another "gotcha" later on.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2009 4:37 PM   in reply to Jody Bleyle

    I'm wrong -- the sample video player that ships with 3.5 does support dynamic streaming, but it doesn't use Brad's DynamicStream class.

     

    Sorry about that!

    Jody

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2009 5:12 PM   in reply to Jody Bleyle

    But DynamicStream.as is part of the code base and the does get executed.   Jody, which version of DynamicStream.as is more current?   The one that ships with FMS 3.5 or the one in tools?

     

    Can anyone answer my original question (I think) which is: should I be able to switch source = http://dynamicStream1.smil -> source = http://dynamicStream2.smil and back and forth etc.  It seems to work.    Are there any caveats?  I am not switching back and forth between flv-s and smil-s

     

    It turns out that there are a couple of lines of code in NCManger.as::bitrateMatch() which is concatenating the streamName and this results in 404 on the FMS side.   I'm not sure what this is supposed to do or if this is just a bug, but the upshot was that I could not specify source = http://dynamicStream.smil on a remote server.  The uncanny part of this issue is if I serve the same smil locally, referencing remote remote smil and media, it works.  Maybe this has something to do with the bit rate.    Bottom line is that this cost me 3 days, becuase I was under the incorrect impression that you could not reference *.smil directly and I blindly followed the handrail provided by the the FMS videoPlayer sample.  Shame on me for trying to leverage working code shipped with a production version.

     

     

    NCManger.as::bitrateMatch()

    ...

     

     

     

    if

     

     

    (_streamName != null

    ) {

    _streamName += _streams[whichStream].src;

    }

     

     

    My incling is to change the += above to an = and get on with it.

     

    If someone at adobe or anywhere can have a look and give me some other guidance, it would be much appreciated.

     

    Thanks to Sean for the kind and detailed responses and giving me the green light that source=http://dynamicStream.smil _should_ work.

     

    Thanks to all.

     

     

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 29, 2009 11:55 AM   in reply to DaddyDog1

    Hope I can clear up some confusion here...

     

    The sample Video Player that ships with FMS installer uses FLVPlayback as its base, but that code is a few versions behind the actual FLVPlayback 2.5 that was released on the FMS tools website.  I would recommend working with the FLVPlayback from the FMS tools page so that you get the bug fixes.

     

    Alternately, you might want to consider the Open Source Media Framework (http://www.opensourcemediaframework.com) which is the successor to the FLVPlayback.

     

    - brad

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points