• 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
New Here ,
Aug 10, 2009 Aug 10, 2009

Copy link to clipboard

Copied

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

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 ,
Oct 27, 2009 Oct 27, 2009

Copy link to clipboard

Copied

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 

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
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

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

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 ,
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

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

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 ,
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

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

}

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 ,
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

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

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 ,
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

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.

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 ,
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

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

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 ,
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

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.

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
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

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

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 ,
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

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.

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
Oct 29, 2009 Oct 29, 2009

Copy link to clipboard

Copied

LATEST

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

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