• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

using .smil files for dynamic streaming in playlists

New Here ,
Apr 21, 2009 Apr 21, 2009

Copy link to clipboard

Copied

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

Views

14.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 24, 2009 Apr 24, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 28, 2009 Apr 28, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 28, 2009 Apr 28, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 29, 2009 Apr 29, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 29, 2009 Apr 29, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2009 Jun 15, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 15, 2009 Jun 15, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 22, 2009 Jun 22, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 22, 2009 Jun 22, 2009

Copy link to clipboard

Copied

In regards to the last post about the continous buffering issue-

When I used Telestream's Episode application I would get the same problem.  Episode's provided templates seem to add something to the video compression that FMS 3.5 does not like.  Though, I had great results with Square1's MPEG Streamclip and Apple's Compressor application.  Have not tried Adobe's Encoder application.  Here's an example of how I have been using dynamic streaming.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 22, 2009 Jun 22, 2009

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 18, 2009 Jun 18, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 22, 2009 Jun 22, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 12, 2009 Jul 12, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 05, 2009 Aug 05, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 06, 2009 Aug 06, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 06, 2009 Aug 06, 2009

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 07, 2009 Aug 07, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 07, 2009 Aug 07, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 07, 2009 Aug 07, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 07, 2009 Aug 07, 2009

Copy link to clipboard

Copied

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();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 07, 2009 Aug 07, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 07, 2009 Aug 07, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 07, 2009 Aug 07, 2009

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 07, 2009 Aug 07, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines