• How to use LongTail JW Player with adaptive bitrate streaming from Wowza Media Server

    Use this technique to generate the client-side RSS or SMIL file that is used by JW Player's Flash Dynamic Streaming implementation from a server-side SMIL (Synchronized Multimedia Integration Language) file, Wowza Transcoder Stream Name Group (ngrp) or MediaList (amlst).

    Also take a look at JW Player's Quality Monitor plugin

    Note: This requires Wowza version 3.0.3.08

    Note: There is a similar technique, documented separately here, for generating smil on Liverepeater (edge) servers using Wowza Transcoder Stream Name Group (ngrp) or MediaList (amlst) that is on the origin.

    Follow these steps:
    1. Add this HTTPProvider to /conf/VHost.xml /HostPort /Port "1935" /HTTProviders container (make it 2nd from last, above the server version HTTPProvider):

      Code:
      <HTTPProvider>
      <BaseClass>com.wowza.wms.http.HTTPProviderMediaList</BaseClass>
      <RequestFilters>*jwplayer.rss</RequestFilters>
      <AuthenticationMethod>none</AuthenticationMethod>
      </HTTPProvider>
    2. Restart Wowza for changes to VHost.xml to take effect.

    3. With a smil file, Wowza Transcoder Stream Name Group (ngrp) or MediaList (amlst), you can now generate the client-side RSS for JW player using a URL in this form:

      Code:
      http://[wowza-ip-address]:1935/[application]/[prefix]:[stream-name]/jwplayer.rss
      For example, with a file named sample.smil in the content folder alongside sample.mp4 and sample_250.mp4:
      Code:
      <smil>
      	<head>
      	</head>
      	<body>
      		<switch>
      			<video src="mp4:sample_250.mp4" system-bitrate="250000"/>
      			<video src="mp4:sample.mp4" system-bitrate="450000"/>
      		</switch>
      	</body>
      </smil>
      You can use the following URL with JW Player 5 in place of a local rss
      Code:
      http://[wowza-address]:1935/vod/smil:sample.smil/jwplayer.rss
      For JW Player 6, which uses client-side .smil, use this url:
      Code:
      http://[wowza-address]:1935/vod/smil:sample.smil/jwplayer.smil
    4. Following the JW Player instructions here but skip making the local xml file. You will use the above url instead:

      Code:
      <script type='text/javascript' src='/jwplayer/jwplayer.js'></script>
      
      <div id='mediaplayer'></div>
      
      <script type="text/javascript">
        jwplayer('mediaplayer').setup({
          'flashplayer': 'player.swf',
          'id': 'playerID',
          'width': '720',
          'height': '306',
          'playlistfile': 'http://[wowza-address]:1935/vod/smil:sample.smil/jwplayer.rss',
          'plugins': {
             'qualitymonitor-2': {}
          }
        });
      </script>

    This URL:
    Code:
    http://[wowza-address]:1935/vod/smil:sample.smil/jwplayer.rss
    generates this RSS:
    Code:
    <rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:jwplayer="http://developer.longtailvideo.com/" version="2.0">
    <channel>
    <item>
    <title>sample.smil</title>
    <description>sample.smil</description>
    <jwplayer:streamer>rtmp://[wowza-address]:1935/vod/_definst_</jwplayer:streamer>
    <media:group>
    <media:content url="mp4:sample_250.mp4" bitrate="250"/>
    <media:content url="mp4:sample.mp4" bitrate="450"/>
    </media:group>
    </item>
    </channel>
    </rss>
    This URL:
    Code:
    http://[wowza-address]:1935/vod/smil:sample.smil/jwplayer.smil
    generates this SMIL file:
    Code:
    <smil>
    <head>
    <meta base="rtmp://localhost:1935/vod/_definst_"/>
    </head>
    <body>
    <switch>
    <video src="mp4:sample_250.mp4" system-bitrate="250"/>
    <video src="mp4:sample.mp4" system-bitrate="450"/>
    </switch>
    </body>
    </smil>
    This techique can also be used if you are Media List (amlst) or have defined Stream Name Group (ngrp) in Wowza Transcoder template by using "amlst:" and "ngrp:", resp., for [Prefix]

    Two examples:
    Code:
    http://[wowza-address]:1935/vod/ngrp:myStream_all/jwplayer.rss
    
    http://[wowza-address]:1935/vod/amlst:sample/jwplayer.rss
    Stream Name Groups are described in the Wowza Transcoder Tutorial

    Generating MediaList (amlst) is described in this article
    Comments 27 Comments
    1. prasad -
      Hi, I'm trying to use this technique but it does not seem to work...
      I set-up a ec2 wowza instance for test, version 3.0.3 and jw player 5.8.
      the url
      Code:
      http://[wowza-address]:1935/vod/smil:sample.smil/jwplayer.rss
      does return expected xml file in a web browser, but if I use this url as playlistfile source in jw player, the player does not load the playlist and remains black, with no error returned...
      If I copy/paste url xml result in a new xml file and I set this xml as playlist in jwplayer, it works.
      So my smil file is correct...
      Have someone else encountered this kind of problem?

      Best regards,
      Prâsad.
    1. rrlanham -
      Did you restart Wowza after change to VHost.xml? Check for typos?

      You can test in a browser, you should see the RSS file:

      Code:
      http://[wowza-address]:1935/vod/smil:streams.smil/jwplayer.rss
      Richard
    1. prasad -
      Hi Richard,

      as I said, the url works fine in web browser, and if I copy/paste xml returned by the url in a xml file hosted on web server, jw player launches playlist and plays videos...
      But if I use url directly in jw player setup code, the screen remains black and nothing happens... Code I use for jw player is exactly the same as your article...

      Prâsad.
    1. rrlanham -
      Prâsad,

      Are you getting sandbox security error? Are you using debug player so you see messages?

      Richard
    1. prasad -
      Richard,

      when using debug player with output to console, I can see a call to crossdomain.xml which return HTTP 200, then a call to vod/smil:sample.smil/jwplayer.rss which never returns...
      I can reproduce this with a browser, a call to vod/smil:sample.smil/jwplayer.rss just after a call to crossdomain.xml don't return...

      Prâsad.
    1. rrlanham -
      Prâsad,

      Zip up conf and logs and this player and send to support@wowza.com.

      Include a link to this thread for reference.

      Richard
    1. meneceur -
      Quote Originally Posted by rrlanham View Post
      Prâsad,

      Zip up conf and logs and this player and send to support@wowza.com.

      Include a link to this thread for reference.

      Richard

      Hi, we have the same problem. Is it resolved?
      thank you
      Nicolas.
    1. prasad -
      Hi Nicolas,

      I still have an opened ticket about this issue.
      I'm awaiting an answer from Richard.
      As soon as I have it, I will let you know.

      Best regards,
      Prâsad.
    1. rrlanham -
      I was going to replicate, try to improve the documentation, however it did work for me in all my tests, including running a player locally that referenced the RSS output of HTTPProvider on your server, ruling out sandbox error.

      Richard
    1. prasad -
      Hi Nicolas, could you please describe your problem?
      Do you have a test url to share?

      Best regards,
      Prâsad.
      PS: I tried to contact you with private message, but it seems that you have not activated it on the forum.
    1. najibx -
      Hye,

      I have got the VOD Dynamic Streaming playback working using a sample.smil file I created manually (mysiteurl:1935/vod/smil:sample.smil/jwplayer.rss)
      For Live Streaming I use, auto-generated SMIL by transcoderAddon to create the mRSS (mysiteurl:1935/live/ngrp:myStream_all/jwplayer.rss). It look like a valid mRSS format. Similar to the VOD (sample.smil).

      however, simply replacing 'playlistfile' in the code is no good, only show me a black screen.

      'playlistfile': 'mysiteurl:1935/live/ngrp:myStream_all/jwplayer.rss',

      Tips and comment please. Thanks.
    1. rrlanham -
      Do you see the RSS file in a browser?:

      Code:
      http://mysiteurl:1935/live/ngrp:myStream_all/jwplayer.rss
      If so, try copying that to a file alongside player.swf

      Richard
    1. najibx -
      The mRSS output from Chrome browser,

      Code:
      This XML file does not appear to have any style information associated with it. The document tree is shown below.
      <rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:jwplayer="http://developer.longtailvideo.com/" version="2.0">
      <channel>
      <item>
      <title>myStream_all</title>
      <description>myStream_all</description>
      <jwplayer:streamer>rtmp://mysiteurl:1935/live/_definst_</jwplayer:streamer>
      <media:group>
      <media:content url="mp4:myStream_source" bitrate="333" width="320" height="240"/>
      <media:content url="mp4:myStream_360p" bitrate="882" width="480" height="360"/>
      <media:content url="mp4:myStream_160p" bitrate="232" width="214" height="160"/>
      </media:group>
      </item>
      </channel>
      </rss>
      html { padding-top: 34px !important;}
      Then I use this code (the same for VOD is working, only change playlistfile) :

      Code:
      <script type="text/javascript">
        jwplayer('mediaplayer').setup({
          'flashplayer': '/jwplayer/player.swf',
          'id': 'playerID',
          'width': '720',
          'height': '406',
          'playlistfile': 'http://mysiteurl:1935/live/ngrp:myStream_all/jwplayer.rss',
          'plugins': {
             'qualitymonitor-2': {}
          }
        });
      </script>
    1. rrlanham -
      I'm not sure how myStream_source is included in the rss, and the settings seems wrong for it. Is the source h.264 and AAC or MP3 audio?

      Send a working url so that I can test to support@wowza.com

      Include a link to this thread for reference.

      Richard
    1. najibx -
      Thanks for the reply.
      The source h.264 and AAC (Mono) from Wirecast

      This morning, without doing anything, I broadcast again, with the same mRSS output, the JWplayer is loading/playing the live video! But seems something not right. (my laptop is slowing down or internet is slow).

      Anyway, send further info to support@wowza.com.
    1. daveuofu -
      Using JW's adaptive.swf provider, JW can connect to and play an individual stream live stream from a transcoder name group. However, attempting to connect JW to the name group itself results in an error.

      This works fine:
      http://[server]/livetc/livetc.mp4_360p/playlist.m3u8

      This results in JW error "Cannot load M3U8: crossdomain access denied":
      http://&#91;server]/livetc/ngrp:livetc.m.../playlist.m3u8

      Any idea why this is happening? The crossdomain.xml is set to allow access from domain "*". Thanks!

      ... adding more information here:

      the ngrp provider returns this:
      #EXTM3U
      #EXT-X-VERSION:2
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1255969,CODECS="avc1.77.31,mp4a.40. 2",RESOLUTION=896x504
      /livetc/_definst_/mp4:livetc.mp4_source/playlist.m3u8?wowzasessionid=626634819
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=548873,CODECS="avc1.77.30,mp4a.40.2 ",RESOLUTION=640x360
      /livetc/_definst_/mp4:livetc.mp4_360p/playlist.m3u8?wowzasessionid=626634819
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=248873,CODECS="avc1.66.12,mp4a.40.2 ",RESOLUTION=284x160
      /livetc/_definst_/mp4:livetc.mp4_160p/playlist.m3u8?wowzasessionid=626634819


      and the single stream returns this:
      #EXTM3U
      #EXT-X-VERSION:2
      #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=909315,CODECS="avc1.77.31, mp4a.40.2",RESOLUTION=896x504
      playlist.m3u8?wowzasessionid=18471989

      I can see some obvious differences in the paths but am not sure how to investigate further. Thanks!
    1. maven2 -
      I've set this up as instructed.

      http://itv.sg:1935/prerecord/smil:st...l/jwplayer.rss in my browser gives:

      <rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:jwplayer="http://developer.longtailvideo.com/" version="2.0">
      <channel>
      <item>
      <title>streamschedule.smil</title>
      <description>streamschedule.smil</description>
      <jwplayer:streamer>rtmp://itv.sg:1935/prerecord/_definst_</jwplayer:streamer>
      <media:group></media:group>
      </item>
      </channel>
      </rss>

      But my JW Player gives a "Playlist not found" error.

      the JW Player is in the main public_html folder.
      the video files and streamschedule.smil file are in a folder /mv folder which is the <StorageDir> of the "prerecord" application.

      I've set the playlistfile on my site as http://itv.sg:1935/prerecord/smil:st...l/jwplayer.rss.

      Why am I still receiving this error?
    1. rrlanham -
      The .smil file used for the scheduler is not the same as the .smil used for multi-bitrate, or what is used to generate rss for JW Player RTMP Dynamic streaming.

      Take a look at this example:
      http://www.wowza.com/forums/content....-Multi-bitrate

      You will use the .smil in step #4 to generate the rss for JW Player.

      Richard
    1. 64vision -
      For VODS3.. Will I also place the smil file on amazon S3?
    1. rrlanham -
      Yes, right, in the same folder with the videos.

      Richard