# Please help with RTMP stream

**URL:** <https://forums.plex.tv/t/please-help-with-rtmp-stream/28633>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [February 7, 2013, 3:09pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633 "2013-02-07T15:09:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 7, 2013, 3:09pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/1 "2013-02-07T15:09:54Z")

</div>

Hi all,  
  
  
  
I am busy writing a plugin for a streaming sports channel and have completed everything except getting the actual clips to play 🙂  
  
  
  
I am very new at this and I’m learning as I go along, but would really know how to add an rtmp stream to my VideoClipOnject.  
  
  
  
I have the stream url which is in the format: rtmpe://xyz.abcd.com/vod/media/abc/abc/ABC\_012345\_WWC\_INDVENG\_PC\_500K.mp4  
  
  
  
I can play this stream fine using a media player, but have no idea how to actually get this clip to play in my plugin, the documentation on this is very sparse and can’t seem to find an example of how this should be implemented.  
  
  
  
Basically I just want to add it as a video object, like:

```auto

<br />
oc.add(VideoClipObject(<br />
  url = highlights_proper_url, <br />
  title = highlights_title,<br />
  summary = highlights_summary, <br />
  thumb = Resource.ContentsOfURLWithFallback(url=highlights_thumb, fallback=ICON), <br />
  duration = highlights_duration))<br />

```

  
  
I have realised pretty quickly I cannot feed the rtmp url straight in here. How would I go about this?  
  
I have already enabled the UseRealRTMP setting in my Info.plist file.  
  
Any help would be greatly appreciated, if anybody could also point me to a page with some nice tutorials and/or examples I would also be grateful.  
  
Cheers

---

<div class="post-metadata">

**Author:** ![Gerk](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gerk/32/81980_2.png) [@Gerk](https://forums.plex.tv/u/Gerk)\
**Post date:** [February 7, 2013, 4:46pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/2 "2013-02-07T16:46:58Z")

</div>

Your best bet is to look at other examples that use RealRTMP. You will need to use RTMPVideoURL (instead of VideoClipObject). For a good example that shows most of the options required for this check out the URL Service for Hollywood Reporter (it has a couple of variations in it of that option) – it’s located within the Services.bundle. Since it is an rtmpe url it’s most likely encrypted, so you will also probably have to find the SwfURL required as well (and possibly other things too). It may or may not work, depending on how it’s locked down. You’ll also want to install rtmpdump on your development machine (command line tools to grab rtmp streams), that will help you get things figured out in terms of what options you need to make it work. Last advice is to do some googling for the specific site you’re trying to get working, maybe someone has already cracked what is needed for grabbing the rtmp streams for you … it can be a very involved, and sometimes frustrating process that may or may not result in you getting the streams working… There are also a couple of utilities (windows based) that may help you get things figured out for using rtmpdump, but the names of them escape me right now. I’ve never personally had good luck with them but lots of others have.   
  
  
  
Good luck!

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 7, 2013, 4:55pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/3 "2013-02-07T16:55:31Z")

</div>

> [@](#):
>
> Your best bet is to look at other examples that use RealRTMP. You will need to use RTMPVideoURL (instead of VideoClipObject). For a good example that shows most of the options required for this check out the URL Service for Hollywood Reporter (it has a couple of variations in it of that option) -- it's located within the Services.bundle. Since it is an rtmpe url it's most likely encrypted, so you will also probably have to find the SwfURL required as well (and possibly other things too). It may or may not work, depending on how it's locked down. You'll also want to install rtmpdump on your development machine (command line tools to grab rtmp streams), that will help you get things figured out in terms of what options you need to make it work. Last advice is to do some googling for the specific site you're trying to get working, maybe someone has already cracked what is needed for grabbing the rtmp streams for you ... it can be a very involved, and sometimes frustrating process that may or may not result in you getting the streams working... There are also a couple of utilities (windows based) that may help you get things figured out for using rtmpdump, but the names of them escape me right now. I've never personally had good luck with them but lots of others have.   
>   
> Good luck!

  
  
Thanks for the insightful reply. I have already learned a lot more about rtmp streams in the last few hours, but I agree it is quite frustrating.  
  
I do have the full rtmp string which includes the SfwURL, etc as I am trying to port the+ plugin from XBMC. I will look at the Services.bundle as you suggested and play around a bit with rtpmdump.  
  
Will ask more questions when I get stuck again :)

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 7, 2013, 9:05pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/4 "2013-02-07T21:05:43Z")

</div>

Okay, I have fooled around with rtmpdump and can get some streams to play while others just don’t for some reason. Anyway, thinking of rather using WebVideoURL and a site config.  
  
  
  
My question is, how do I use WebVideoURL? I cannot find any examples of how it should be used, could somebody please point me in the right direction!  
  
  
  
Thanks

---

<div class="post-metadata">

**Author:** ![Gerk](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gerk/32/81980_2.png) [@Gerk](https://forums.plex.tv/u/Gerk)\
**Post date:** [February 7, 2013, 10:16pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/5 "2013-02-07T22:16:50Z")

</div>

The best bet is to look at existing plugins that use it. I don’t have a good example off of the top of my head (at least one that’s easy to understand) – but I suggest taking a look around in the Services.bundle again (grep for WebVideoURL). Also lots of the site configurations are within a separate bundle as well, I forget the name but it’s in the same place as the Services.bundle  
  
  
  
Webkit based stuff can be just as frustrating if not more-so than rtmp, just letting you know that 😕

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 7, 2013, 10:23pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/6 "2013-02-07T22:23:49Z")

</div>

> [@](#):
>
> The best bet is to look at existing plugins that use it. I don't have a good example off of the top of my head (at least one that's easy to understand) -- but I suggest taking a look around in the Services.bundle again (grep for WebVideoURL). Also lots of the site configurations are within a separate bundle as well, I forget the name but it's in the same place as the Services.bundle  
>   
> Webkit based stuff can be just as frustrating if not more-so than rtmp, just letting you know that :/

  
  
The problem I'm facing now is that I get the VideoObjects listed and then when I try to play nothing happens and I also get no errors in the log file :(  
  
Can you please just check here quickly, this is a simple Site Config so long:  
  

```auto

<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<br />
<site site="http://www.supersport.com"<br />
       plugin="http://core.dstv.com/video/flash/PlayerDStv.swf?v=2"<br />
       initialState="playing"<br />
       version="1.0"><br />
<br />
	<seekbar type="simple"><br />
	  <start x="116" y="385" /><br />
	  <end x="353" y="385" /><br />
	  <played><br />
		<color rgb="0a2a38" /><br />
		<color rgb="145470" /><br />
		</played><br />
	</seekbar><br />
<br />
	<!-- PLAYING --><br />
	<state name="playing"><br />
		<event><br />
			<condition><br />
				<command name="pause" /><br />
			</condition><br />
			<action><br />
				<click x="86" y="386" /><br />
				<goto state="paused" /><br />
			</action><br />
		</event><br />
	</state><br />
<br />
	<!-- PAUSED --><br />
	<state name="paused"><br />
		<event><br />
			<condition><br />
				<command name="play" /><br />
			</condition><br />
			<action><br />
				<click x="86" y="386" /><br />
				<goto state="playing" /><br />
			</action><br />
		</event><br />
	</state><br />
<br />
</site><br />
<br />

```

  
  
Then I get the video url in the format: http://www.supersport.com/cricket/sa-team/video/212214  
  
I have tried my best to figure out how these objects work, but with me if I don't have a similar example I'm lost.  
  
Here is the portion of code which should populate the list:  
  

```auto

<br />
	mo = MediaObject(<br />
	  parts = [PartObject(key = WebVideoURL(highlights_page_url))]<br />
	  )<br />
	<br />
	vco = VideoClipObject(<br />
	  key = mo, <br />
	  rating_key = highlights_id, <br />
	  duration = highlights_duration, <br />
	  thumb = Resource.ContentsOfURLWithFallback(url=highlights_thumb, fallback=ICON), <br />
	  title = highlights_title, <br />
	  summary = highlights_summary)<br />
	<br />
	oc.add(vco)<br />

```

  
  
Could you please let me know what I'm doing wrong here?

---

<div class="post-metadata">

**Author:** ![Gerk](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gerk/32/81980_2.png) [@Gerk](https://forums.plex.tv/u/Gerk)\
**Post date:** [February 7, 2013, 11:14pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/7 "2013-02-07T23:14:26Z")

</div>

Sorry but I honestly know next to nothing about site configs and webkit based channels, maybe Sander can help you out on this one.

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 7, 2013, 11:44pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/8 "2013-02-07T23:44:02Z")

</div>

Ah, think I just wasted a whole lot of my time. Just read on another thread that PMS on Linux doesn’t support webkit plugins ☹  
  
  
  
Back to the rtmp struggle I guess then.

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 8, 2013, 12:28am UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/9 "2013-02-08T00:28:58Z")

</div>

Okay, I’m trying again…  
  
  
  
Can somebody please just let me what the correct usage should be for the objects I’m using, mine is obviously wrong:

```auto

<br />
	oc.add(VideoClipObject(<br />
	  key = RTMPVideoURL(url = highlights_rtmp_params['rtmpServer'], clip = highlights_rtmp_params['playpath'], swf_url = SWF_PLAYER_URL),<br />
	  rating_key = highlights_id,<br />
	  duration = highlights_duration,<br />
	  thumb = Resource.ContentsOfURLWithFallback(url=highlights_thumb, fallback=ICON), <br />
	  title = highlights_title,<br />
	  summary = highlights_summary))<br />

```

  
  
It's giving me a "This channel is unavailable" message when clicking on the item and no error in the log file.  
  
Thanks again.

---

<div class="post-metadata">

**Author:** ![Gerk](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gerk/32/81980_2.png) [@Gerk](https://forums.plex.tv/u/Gerk)\
**Post date:** [February 8, 2013, 2:56am UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/10 "2013-02-08T02:56:30Z")

</div>

Nothing jumps out at me as wrong in that code on a quick look … one important thing is the make sure that duration is an int (if it’s a str it will crap out). What log(s) are you looking at? And what client are you testing with? If you’re not using it already I’d suggest using a desktop client to test with, using others adds additional layers of complication and additional layers to potentially fail and cause you friend. And indeed webkit plugins don’t run on Linux based PMS.

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 8, 2013, 7:45am UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/11 "2013-02-08T07:45:32Z")

</div>

> [@](#):
>
> Nothing jumps out at me as wrong in that code on a quick look ... one important thing is the make sure that duration is an int (if it's a str it will crap out). What log(s) are you looking at? And what client are you testing with? If you're not using it already I'd suggest using a desktop client to test with, using others adds additional layers of complication and additional layers to potentially fail and cause you friend. And indeed webkit plugins don't run on Linux based PMS.

  
  
Hi, thanks for the feedback. Turns out I was running in circles because the items play just fine on all my other devices except the Plex/Web app I was testing it on \<\_\<   
  
Don't exactly know why this is, but at least I can get the streams to work.

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 8, 2013, 9:55am UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/12 "2013-02-08T09:55:13Z")

</div>

Okay, another question. I have some live streams that I want to work with too. I read in some other threads that these can be tricky to work with but it looks like I am getting PMS to fetch the stream and transcode it but nothing is getting pushed to my devices.  
  
  
  
Can you take a look here and maybe give a few pointers on what’s going wrong?  
  
  
  
Here is the code for adding the live streams to the menu container:

```auto

<br />
	oc.add(VideoClipObject(<br />
	  key = RTMPVideoURL(url = live_streams_rtmp_params['rtmpServer'], clip = live_streams_rtmp_params['playpath'], swf_url = SWF_PLAYER_URL, live = True),<br />
	  rating_key = live_streams_id,<br />
	  thumb = Resource.ContentsOfURLWithFallback(url=live_streams_thumb, fallback=ICON), <br />
	  title = live_streams_title,<br />
	  summary = live_streams_summary))<br />

```

  
  
I can get a perfect stream using rtmpdump:  
  

```auto

<br />
RTMPDump v2.4<br />
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL<br />
Connecting ...<br />
INFO: Connected...<br />
Starting Live Stream<br />
INFO: Metadata:<br />
INFO: author <br />
INFO: copyright <br />
INFO: description <br />
INFO: keywords <br />
INFO: rating <br />
INFO: title <br />
INFO: presetname Custom<br />
INFO: creationdate Fri Feb 08 05:52:55 2013<br />
INFO: videodevice Osprey-700 HD Video Device 1<br />
INFO: framerate 25.00<br />
INFO: width 480.00<br />
INFO: height 360.00<br />
INFO: videocodecid avc1<br />
INFO: videodatarate 452.00<br />
INFO: avclevel 31.00<br />
INFO: avcprofile 66.00<br />
INFO: videokeyframe_frequency5.00<br />
INFO: audiodevice Osprey-700 HD Audio Device 1<br />
INFO: audiosamplerate 22050.00<br />
INFO: audiochannels 1.00<br />
INFO: audioinputvolume 100.00<br />
INFO: audiocodecid .mp3<br />
INFO: audiodatarate 48.00<br />
787.981 kB / 8.93 sec<br />

```

  
  
Here is what the PMS log says when trying to access one of the streams: http://pastebin.com/UTYaBpa1  
  
  
Note that I am trying this remotely as I'm not at home right now, I will try at home a bit later but I don't see why it would make a difference if the stream is transcoded.  
  
Thanks for all the help so far!

---

<div class="post-metadata">

**Author:** ![Gerk](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gerk/32/81980_2.png) [@Gerk](https://forums.plex.tv/u/Gerk)\
**Post date:** [February 8, 2013, 3:00pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/13 "2013-02-08T15:00:09Z")

</div>

Live streams don’t transcode well, if at all. Another thing to not waste your time on I would say.

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 8, 2013, 3:09pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/14 "2013-02-08T15:09:19Z")

</div>

> [@](#):
>
> Live streams don't transcode well, if at all. Another thing to not waste your time on I would say.

  
  
Is this a complete hopeless case or could there possibly be a way around this (even if it involves a lot of frustration)? Do know if there are any plan on improving this functionality in PMS going forward?  
  
I also just would like to know if there is a specific reason why I cannot play the video items in Plex\Web. Do I have to add addition code to get them to work? If so, what?  
  
  
Thanks!

---

<div class="post-metadata">

**Author:** ![Gerk](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gerk/32/81980_2.png) [@Gerk](https://forums.plex.tv/u/Gerk)\
**Post date:** [February 8, 2013, 3:13pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/15 "2013-02-08T15:13:45Z")

</div>

I don’t imagine it will be forever, but the current transcoder is not capable of transcoding live streams. There’s no workaround or anything funky to do, it just won’t work. That said you can add live streams to your plugin if you want, but they will only work on the full desktop clients and not to any other types of devices (devices will require transcoding more often than not).  
  
  
  
As for Plex/Web it’s still a work in progress, some types of videos just don’t work properly in it. It also can make a difference which browser you are trying to use, some work better than others. Without seeing the full code I can’t say for sure, but it’s very likely that there’s nothing additional you can add/change to make it work in plex/web.

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 8, 2013, 3:46pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/16 "2013-02-08T15:46:34Z")

</div>

> [@](#):
>
> I don't imagine it will be forever, but the current transcoder is not capable of transcoding live streams. There's no workaround or anything funky to do, it just won't work. That said you can add live streams to your plugin if you want, but they will only work on the full desktop clients and not to any other types of devices (devices will require transcoding more often than not).  
>   
> As for Plex/Web it's still a work in progress, some types of videos just don't work properly in it. It also can make a difference which browser you are trying to use, some work better than others. Without seeing the full code I can't say for sure, but it's very likely that there's nothing additional you can add/change to make it work in plex/web.

  
  
Ahh ok, so live streams should work on the desktop clients (as there is no transcoding involved)? I can't check right now because there aren't any live streams at the moment, but will check when I can. This is great news as I will be primarily be using it on the desktop client but would have been an added bonus to have it work on all devices.  
  
I will be putting the final code up on github later today and will post the link so you can maybe see what's happening with Plex\Web.  
  
Thanks for the great feedback and have a good weekend!

---

<div class="post-metadata">

**Author:** ![Gerk](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gerk/32/81980_2.png) [@Gerk](https://forums.plex.tv/u/Gerk)\
**Post date:** [February 8, 2013, 4:45pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/17 "2013-02-08T16:45:01Z")

</div>

In theory they might work on desktop clients, it really depends on the stream format, etc. but they have a much greater chance of working on the desktop client. All you can do is try them out when there are some available and see what happens.

---

<div class="post-metadata">

**Author:** ![drzoidberg33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drzoidberg33/32/4184_2.png) [@drzoidberg33](https://forums.plex.tv/u/drzoidberg33)\
**Post date:** [February 10, 2013, 9:35am UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/18 "2013-02-10T09:35:21Z")

</div>

Just wanted to say thanks a load for all the guidance Gerk, my plugin is working great and all seems good regarding live streams on the desktop clients.

---

<div class="post-metadata">

**Author:** ![Gerk](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gerk/32/81980_2.png) [@Gerk](https://forums.plex.tv/u/Gerk)\
**Post date:** [February 10, 2013, 5:29pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/19 "2013-02-10T17:29:00Z")

</div>

Awesome, glad to hear it worked out 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 10:52pm UTC](https://forums.plex.tv/t/please-help-with-rtmp-stream/28633/20 "2019-12-20T22:52:28Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
