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:
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.
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.
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!
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:
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.
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:
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.
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?
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!
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.
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.