Not realizing scyber had performed major updates to the tivo plugin I took it upon myself to refactor and update it.
In the process I did find his updates and have been looking at those as well. I also incorporated a fix for the famous tivo cookie issue from the code for pyTivo which has had that patched for awhile.
In any case, this led to a specific question which is how to deliver media to the server from a plugin. All of the documentaiton for the API seems centered on the idea of delivering URLs to the server which then goes out and fetches the media from there. But what if I want to deliver media directly from the output of a process, such as tivodecode? Is this not possible, is the correct model to always host an http server locally and direct Plex to this for the stream? Would it be better to write to a temporary file for Plex to open?
A local http server would probably be the best approach to take, but that's just a guess. I've never seen anything in the channel framework options that allow accessing a local file so if you can "host" it via http and then have the channel pick up that local URL it would work the best I think.
Definitely not a stupid question. The channel framework is definitely geared towards accessing online media. As such, hosting an HTTP-server and directing PMS to the stream that way is probably the simplest in terms of channel development. However, it adds extra work setting up the server and more CPU overhead on the server machine which can reduce performance (or so I've read). There used to be a(n undocumented) way to access local file resources for streaming. I made a plugin using it just a proof of concept but I haven't touched it in quite a while and the code should really be updated to the latest framework for continuing support. That being said, here's a link to the relevant section of the code on my github repo.
Perhaps @Jam has some more insight, I'll try to direct his attention here.
Does anyone have an example of the setting up and accessing the HTTP server in a plugin? I can't seem to be able to figure out how to pass the URL of the local streaming HTTP server to Plex correctly. Do I pass the URL to the stream as a URL in a VideoClipObject or as a Key in some other kind of object?
The plugin is starting and running an HTTP server that takes a specially formatted URL. The server the goes and grabs the file from the server, feeds it into a decode process and returns an mpeg2 stream.
Whenever you pass url=XXXX in a video object it will try to look for a URL service to process things. I'm not positive how to get around that with v2.1 and higher framework. Maybe someone else can answer this one.
Yeah, you can use something like key=Callback(PlayVideo), where PlayVideo returns a Redirect to the final stream, if I'm understanding the problem.
I had mixed results with this method and still resorted to using a URL service.
I have not had any luck with the redirect method. It doesn't look like Plex ever initiates a request to the server. Looks like I may need write a URL service, hopefully that will do the trick.
what hapens with this is, plex does make repeated requests to the server process, but nothing ever plays and I wind back up at frown face. I am confused as to why Plex makes about 5 or 6 requests but nothing ever plays. Does anyone have any suggestions on how to debug this?
That code was very helpful. I do make it to the web player now. However, I keep getting a 404 error with no M308 found. What does this mean exactly? Should the URL I generate point to an M3U8 file that then points to the actual source?
I am not familiar with M3U8 files and streaming media architecture in general.
Plex/Web is probably not the best client to do your first debugging in, it adds an extra layer of complication (what browser you're using, what video format, is it flash or html5 playback ,etc). If possible I would suggest using one of the desktop clients first, and then once you're playing there move on to trying Plex/Web and other clients. It's possible that's it is getting hung up at the transcoder (it uses M3U8 for when it transcodes things) -- but again this may be something specific with Plex/Web.