Working on making a live TV stream from a generic DVB tuner
Hi there,
first off thanks for checking my thread. I'm currently working on my first ever plugin. I've made a lot of progress I believe already but could really use some help. What I'm trying to do is use a tv tuner to stream live tv to any plex client. Before you tell me about elgato, yes I already know and no I do not have one and I think a lot of people that would be interested do not either.
So my setup consists of Ubuntu 12.04 running Plex Media Server 0.9.6.5.177-5c3cf40 attached to an ATI TV Wonder 600 USB dongle. I am using the iOS client on an iPhone 4S. I have stumbled upon [mumuDVB](http://mumudvb.braice.net/) and successfully gotten it to stream beautiful HD television that I can access from multicast (udp) or unicast (http) from anywhere on my home network with VLC. Now that's great but I want to be able to access this remotely on my iphone.
So I have gotten my plugin to appear on my iphone after basing it on the TPGTV bundle I found through the forums and comparing it with the Apple Movie Trailers bundle. However, I seem to get an error saying "No Items to Display - This directory appears to be empty". I haven't yet gotten around to studying log files because I think I might have a crucial choking point here. I don't know if Plex will transcode the local address stream from the box my server is on or if i access it remotely will it try to directly access the stream. That makes a big difference in the way I need to write my channel! I know Plex is capable of working with http and udp streams... but i just don't know how...
Any help would be appreciated!
FRITZ|FRITZ
-PS the unicast only seems to work when mapped to ip 0.0.0.0 // I also intermittently lose the ability to access the internet from wifi while streaming with mumuDVB.
Generally, if the media-stream is in a format that is direct playable by the Plex client requesting it, the client will try to direct play it. If the stream is not something that your iPhone (for example) can play, then PMS will transcode it. A good test in your case would be to try to access the stream using the Safari browser on your iPhone while connected over the local network. If it plays, then no transcoding will likely be necessary. If it doesn't play, then PMS will need to transcode the stream for playback (if it can).
I'm wondering if Plex is capable of transcoding a unicast stream? That will simplify the process.
I've changed my approach after doing more researching into accessing a streaming video on the iPhone. If Plex won't prepare the live stream then I will need to implement it outside of Plex. Apparently, iOS is extremely picky on accessing a live stream. Specifically, I am now running an Apache server and using VLC to access the tuner, transcode the video, and then segment the video ala the HTTP Live Stream (HLS) format. I am currently testing getting the content to a state that is accessible via Safari as there are too many questions still remaining in how Plex will handle the video source. Supposedly Plex supports the HLS format(?) from some of the posts I've read. My plan is once I can verify that VLC is properly preparing the stream I will then execute building the plugin to access via Plex (so I don't have to have my firewall open on port 80).
*Anyone know if Plex can execute commands via terminal?* The only way I've figured to change the channel remotely (requiring changing the frequency) is to create an ssh session and execute the command manually.
Currently I am running into a problem successfully configuring VLC but I will keep updating this thread in case anyone is interested. When working, it seems like for another user to implement this will require a deal of manual configuration. My goal is to eventually have a finished product that is cross platform, universal to any tuner, and requires very little end user configuration.
It is possible to execute script commands from a plugin by including a "helper app" in the plugin folder. The [PBS plugin](https://github.com/plexinc-plugins/PBS.bundle) uses a helper to decrypt streams and, although the helper is compiled and illegible, it is a decent demonstration of how to implement the necessary aspects of using a helper.
Have you found the solution to this issue or any further progress?
I myself would like to obtain a plugin to play UDP multicast stream e.g. udp://@239.38.128.1:1234 and perhaps even import .m3u playlists like these such as in VLC.
Do you happen to have any code or plugins you are willing to share to assist me in accomplishing this?
I am new to writing PLEX channels as well, but the channel is written in python. Python has a module called “os” and from my understanding you can import modules within your channel. With that being said if you import the os module and create a function in order to run something from the command line you would simply use the os.system() call. Something like below:
I don't think there would need to be any SSHing(sorry for the lack of a better word) involved. Do to the fact that the command would have been ran on the system that PMS is running.
I hope I don't sound crazy there. If there is a better way please let me know.