Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: HDS Streaming with jwplayer.smil loses querystring parameters

  1. #1

    Exclamation RTMP Dynamic Streaming with jwplayer.smil loses querystring parameters

    Hello,
    We use custom token authentication to authorize users to be able to watch a stream. This works great for most all types of streaming, but I just found a problem with HDS streaming and the use of jwplayer.smil. See the problem is that the output generated when /jwplayer.smil is requested doesn't have the querystring parameters on it. Here's an example:

    Request for the smil:
    http://74.121.236.123/ChaosMedia/_definst_/smil:2014/1383-baker_solo/1383-baker_solo.smil/jwplayer.smil?AuthToken=ERvU3kupA9dB-Ww-nqKZZ49Sk6zuhkn82WTfw9CU_dbUMeaVBjSMxdOP1mi7rWGSLSwPpS3t9RcUqsWnu0OhgFuFYxSH9_D5NHUiHH-nj4aq4HgGeBrZlNxYOcRPGjJYitRaAXJQVV9He84l6DyUmw%3D%3D
    Generated smil:
    <smil>
    	<head>
    		<meta base="rtmp://74.121.236.123/ChaosMedia/_definst_"/>
    	</head>
    	<body>
    		<switch>
    			<video src="mp4:2014/1383-baker_solo/1383-chaosmen_baker_320.SM.mp4" system-bitrate="751000"/>
    			<video src="mp4:2014/1383-baker_solo/1383-chaosmen_baker_640.MD.mp4" system-bitrate="1451000"/>
    			<video src="mp4:2014/1383-baker_solo/1383-chaosmen_baker_1024.LG.mp4" system-bitrate="1956000"/>
    			<video src="mp4:2014/1383-baker_solo/1383-chaosmen_baker_1280.HD.mp4" system-bitrate="2285000"/>
    		</switch>
    	</body>
    </smil>
    Notice that the video src attributes don't have the AuthToken querystring param that the original request for the smil has. This is a major issue for us because without that, our system can't authorize the request. This works perfectly fine with HLS streaming:

    Request for m3u8:
    http://74.121.236.123:80/ChaosMedia/_definst_/smil:2014/1383-baker_solo/1383-baker_solo.smil/playlist.m3u8?AuthToken=ERvU3kupA9dB-Ww-nqKZZ49Sk6zuhkn82WTfw9CU_dbUMeaVBjSMxdOP1mi7rWGSLSwPpS3t9RcUqsWnu0OhgFuFYxSH9_D5NHUiHH-nj4aq4HgGeBrZlNxYOcRPGjJYitRaAXJQVV9He84l6DyUmw%3D%3D
    Generated m3u8:
    #EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=751000
    chunklist_w2083149689_b751000.m3u8?AuthToken=ERvU3kupA9dB-Ww-nqKZZ49Sk6zuhkn82WTfw9CU_dbUMeaVBjSMxdOP1mi7rWGSLSwPpS3t9RcUqsWnu0OhgFuFYxSH9_D5NHUiHH-nj4aq4HgGeBrZlNxYOcRPGjJYitRaAXJQVV9He84l6DyUmw%3D%3D
    #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1451000
    chunklist_w2083149689_b1451000.m3u8?AuthToken=ERvU3kupA9dB-Ww-nqKZZ49Sk6zuhkn82WTfw9CU_dbUMeaVBjSMxdOP1mi7rWGSLSwPpS3t9RcUqsWnu0OhgFuFYxSH9_D5NHUiHH-nj4aq4HgGeBrZlNxYOcRPGjJYitRaAXJQVV9He84l6DyUmw%3D%3D
    #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1956000
    chunklist_w2083149689_b1956000.m3u8?AuthToken=ERvU3kupA9dB-Ww-nqKZZ49Sk6zuhkn82WTfw9CU_dbUMeaVBjSMxdOP1mi7rWGSLSwPpS3t9RcUqsWnu0OhgFuFYxSH9_D5NHUiHH-nj4aq4HgGeBrZlNxYOcRPGjJYitRaAXJQVV9He84l6DyUmw%3D%3D
    #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2285000
    chunklist_w2083149689_b2285000.m3u8?AuthToken=ERvU3kupA9dB-Ww-nqKZZ49Sk6zuhkn82WTfw9CU_dbUMeaVBjSMxdOP1mi7rWGSLSwPpS3t9RcUqsWnu0OhgFuFYxSH9_D5NHUiHH-nj4aq4HgGeBrZlNxYOcRPGjJYitRaAXJQVV9He84l6DyUmw%3D%3D
    Notice that the AuthToken querystring param was preserved in the output.

    Is there anyway I can get the /jwplayer.smil to carry over the querystring params? This is a major show stopper for us right now...

    Thanks,
    Sean
    Last edited by seanngreen; 03-23-2014 at 05:48 PM.

  2. #2
    Join Date
    Feb 2014
    Posts
    129

    Default

    Sean
    JWPlayer does not support HDS.

  3. #3

    Default

    Quote Originally Posted by shueardm View Post
    Sean
    JWPlayer does not support HDS.
    Please read the post rather than just the title.

  4. #4
    Join Date
    Feb 2014
    Posts
    129

    Default

    I did but didn't understand it., if he is trying to use HDS with JW Player it is not possible.

  5. #5

    Default

    I updated the title to say RTMP Dynamic Streaming. But as Roger was alluding to, my problem is not getting the streaming to work. my problem is that the querystring params are not present when requesting jwplayer.smil. Also, regarding RTMP dynamic streaming you can see what I mean in this post (scroll down to the Dynamic Streaming section): http://www.longtailvideo.com/support...tmp-streaming/

  6. #6

    Default

    Quote Originally Posted by seanngreen View Post
    Hello,
    We use custom token authentication to authorize users to be able to watch a stream. This works great for most all types of streaming, but I just found a problem with HDS streaming and the use of jwplayer.smil. See the problem is that the output generated when /jwplayer.smil is requested doesn't have the querystring parameters on it. . . .

    Is there anyway I can get the /jwplayer.smil to carry over the querystring params? This is a major show stopper for us right now...
    Hi Sean,

    The JW Player smil is actually returning RTMP information and not HDS information.

    The reason that your query string is not appended to the streams in the returned smil is because there isn't anything in the http provider to do so. If you needed this functionality, you would need to edit the http provider code and add that. The source code for this http provider is here, Source code for HTTPProviderMediaList in Wowza Media Server.

    The original query params are stored in a map called queryMap. It would just be a matter of re-attaching this to your stream urls when the smil output is created.

    This is an example of how I would do it. the first part deals with standard query params that probably shouldn't be in the output.

    			String queryStr = req.getQueryString();
    			if (queryStr == null)
    			{
    				WMSLoggerFactory.getLogger(HTTPProviderMediaList.class).warn("HTTPProviderMediaList.onHTTPRequest: Query string missing");
    				break;
    			}
    
    			Map<String, String> queryMap = HTTPUtils.splitQueryStr(queryStr);
    
    			String streamName = null;
    			String comboAppStr = null;
    			String formatStr = "smil";
    			String domainStr = req.getHeader("host");
    			String protocolStr = "rtmp";
    
    			String url = req.getHeader("context");
    			if (url == null)
    				break;
    
    			if (url.indexOf("crossdomain.xml") >= 0)
    			{
    				WMSLoggerFactory.getLogger(HTTPProviderMediaList.class).warn("HTTPProviderMediaList.onHTTPRequest: crossdomain.xml request");
    				crossdomainHandler.handleCrossdomainRequest(vhost, req, resp);
    				return;
    			}
    
    			int qloc = url.indexOf("?");
    			if (qloc >= 0)
    				url = url.substring(0, qloc);
    
    			url = HTTPStreamerUtils.urlDecode(url);
    
    			// change get for remove so the default params are removed.  remove will return the same result but will also remove the entry from the map.
    			if (queryMap.remove("streamname") != null)
    				streamName = queryMap.get("streamname");
    
    			if (queryMap.remove("format") != null)
    				formatStr = queryMap.get("format");
    
    			if (queryMap.remove("application") != null)
    				comboAppStr = queryMap.get("application");
    
    			if (queryMap.remove("protocol") != null)
    				protocolStr = queryMap.get("protocol");
    
    			if (queryMap.remove("domain") != null)
    				domainStr = queryMap.get("domain");
    
    
    			// new code
    			//set queryStr to null and then rebuild with remaining params.
    			queryStr = null;
    			if(!queryMap.isEmpty())
    			{
    				for(String key : queryMap.keySet())
    				{
    					if(queryStr != null)
    						queryStr += "&";
    					queryStr += key + "=" + queryMap.get(key);
    				}
    			}
    
    			. . . 
    
    			String urlStr = "";
    			if (rendtion.getName() != null)
    				urlStr = " src=\""+rendtion.getName() + (queryStr != null ? "?" + queryStr : "") + "\"";
    
    			. . .
    This code sample will strip the default params from the query string and then rebuild it with you custom params. It can then be added to the stream urls.

    Roger.

  7. #7

    Default

    You should probably urlencode queryMap.get(key) as it would have been decoded when stored in the map.

    Roger.

  8. #8

    Default

    Thank you Roger,
    I'm going to try this today...

  9. #9

    Default

    Hi Roger,
    I finally got around to trying this and it works great, however I've noticed something strange. The bitrates returned by my version of the httpprovider are all wrong. They have all been divided by 1000.

    Here's the output of the original HTTPProviderMediaList:
    <switch>
    <video src="mp4:2014/1391-santiago_solo/1391-chaosmen_santiago_solo_1024.LG.mp4" system-bitrate="1956000"/>
    <video src="mp4:2014/1391-santiago_solo/1391-chaosmen_santiago_solo_1280.HD.mp4" system-bitrate="2285000"/>
    <video src="mp4:2014/1391-santiago_solo/1391-chaosmen_santiago_solo_320.SM.mp4" system-bitrate="751000"/>
    <video src="mp4:2014/1391-santiago_solo/1391-chaosmen_santiago_solo_640.MD.mp4" system-bitrate="1451000"/>
    </switch>

    And here's my version using the code you linked to:
    <switch>
    <video src="mp4:2014/1391-santiago_solo/1391-chaosmen_santiago_solo_1024.LG.mp4" system-bitrate="1956"/>
    <video src="mp4:2014/1391-santiago_solo/1391-chaosmen_santiago_solo_1280.HD.mp4" system-bitrate="2285"/>
    <video src="mp4:2014/1391-santiago_solo/1391-chaosmen_santiago_solo_320.SM.mp4" system-bitrate="751"/>
    <video src="mp4:2014/1391-santiago_solo/1391-chaosmen_santiago_solo_640.MD.mp4" system-bitrate="1451"/>
    </switch>


    Notice the following line in the code you pointed me to for the HTTPProviderMediaList:
    bitrateStr = " bitrate=\""+(rendtion.getBitrateTotal()/1000)+"\"";


    Are you sure the code you pointed me to is the latest version? If it is the latest, why doesn't the original HTTPProvider divide the bitrate by 1000?


    Thanks,
    Sean

  10. #10

    Default

    Hi Sean,

    That was changed in the source code back in December but it looks like the article was never updated.

    I'll update the article with the current source code now. There have also been some logging changes since then.

    Roger.

Page 1 of 2 12 LastLast

Similar Threads

  1. VOD Adaptive ABR Streaming (with JWPlayer) needs to edit the SMIL File?
    By arkarwmh in forum Media Players and Devices
    Replies: 27
    Last Post: 07-29-2016, 08:47 AM
  2. parameters handover from jwplayer to wowza?
    By oomworld in forum General Forum
    Replies: 1
    Last Post: 02-23-2014, 06:11 AM
  3. force rtmpt in SMIL generated by jwplayer.smil?
    By SONIC-HZ in forum Video On Demand Streaming Discussion
    Replies: 2
    Last Post: 05-14-2013, 07:39 AM
  4. Parameters for HDS live streaming
    By tavius in forum Live Streaming and Encoder Discussion
    Replies: 1
    Last Post: 02-28-2013, 01:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •