tschaumburg / MythRecordings.bundle

Plex bundle allowing Plex to play back MythTV recordings
46 stars 30 forks source link

Add support for LiveTV #3

Open hcw70 opened 10 years ago

hcw70 commented 10 years ago

Hi. Just found your great plugin for Plex which made my Samsung TV with Plex client a very good client for MythTV !!!

Since i want to watch sometimes LiveTv but dont have always a sattelite cable directly at my TV, i would love to have liveTV working.

Maybe i can help also with this, if only I had a clue about how to get to a live channel in the MythTv XML / WSDL api.

tschaumburg commented 10 years ago

Hi Hauke,

Good to hear that the plugin works with the Samsung Plex client too!

Unfortunately, the MythTV services API does not offer live TV playback - and others who have requested it have been met with the (arguably quite fair) response "if you want it, write it yourself".

So: if you're up for immersing yourself in the MythTV codebase, a lot of us would applaud your efforts!

In truth, I don't think it'll be too difficult, once you got the development environment set up - after all, all the other services API methods are available to copy code from, and the live TV functionality IS fully available in the underlying MythTV C-API (which the services API builds on).

:-) Thomas

On Wed, Jan 8, 2014 at 9:54 PM, Hauke Wintjen notifications@github.comwrote:

Hi. Just found your great plugin for Plex which made my Samsung TV with Plex client a very good client for MythTV !!!

Since i want to watch sometimes LiveTv but dont have always a sattelite cable directly at my TV, i would love to have liveTV working.

Maybe i can help also with this, if only I had a clue about how to get to a live channel in the MythTv XML / WSDL api.

— Reply to this email directly or view it on GitHubhttps://github.com/tschaumburg/MythRecordings.bundle/issues/3 .

hcw70 commented 10 years ago

So to correctly understand you, it is not accessible via XML requests at port 63xx? So the other live-tv clients (XBMC and MythFrontend) use a different api for live tv?.

This does not sound very good.

I thought this would be not that hard... 8-<

tschaumburg commented 10 years ago

That is my understanding, yes: at least the MythTV frontend uses a lower-level protocol (which the Services API builds on top of) - and no one has yet exposed the live TV features through the Services API.

But I may well be wrong, so please seek second opinions - I am no MythTV expert.

And I agree with you - adding the live TV feature to the services API shouldn't be very hard, once you have the MythTV development environment up and running. Personally, I'll stick to Plex development, but if you or anyone else feel like picking up the torch on the MythTV side, I'll be happy to cooperate.

/thomas

PS: if you like many are using an HDHomerun box to decode your TV signal, there's a Plex plugin that allows you to watch live TV directly through the HDHomerun (i.e. bypassing MythTV). Not ideal, but it might help...?

On Mon, Jan 13, 2014 at 8:21 AM, Hauke Wintjen notifications@github.comwrote:

So to correctly understand you, it is not accessible via XML requests at port 63xx? So the other live-tv clients (XBMC and MythFrontend) use a different api for live tv?.

This does not sound very good.

I thought this would be not that hard... 8-<

— Reply to this email directly or view it on GitHubhttps://github.com/tschaumburg/MythRecordings.bundle/issues/3#issuecomment-32149267 .

hcw70 commented 10 years ago

Hmm. Just googled and found http://www.mythtv.org/wiki/Content_Service#AddRecordingLiveStream

Isnt it that it sounds like?

tschaumburg commented 10 years ago

I thought so too - but I think it refers to "a recording being 'live streamed'", not live TV.

At least theres no way to indicate a TV channel to stream - or actually get the binary stream (you just get metadata).

But try calling the method on your myth backend (just type the url in your browser), and maybe something interesting will show up. You never know... Den 13/01/2014 16.31 skrev "Hauke Wintjen" notifications@github.com:

Hmm. Just googled and found http://www.mythtv.org/wiki/Content_Service#AddRecordingLiveStream

Isnt it that it sounds like?

— Reply to this email directly or view it on GitHubhttps://github.com/tschaumburg/MythRecordings.bundle/issues/3#issuecomment-32179233 .

Whytey commented 10 years ago

Fairly sure that that call simply starts a recording being transcoded. You then subsequently make another call to get the transcoded stream. I think you have to manage the files too, unless newer versions of mythTV do that now.

And yeah, it can only be used for recordings either complete our in progress. Not live TV. On 14 Jan 2014 01:39, "tschaumburg" notifications@github.com wrote:

I thought so too - but I think it refers to "a recording being 'live streamed'", not live TV.

At least theres no way to indicate a TV channel to stream - or actually get the binary stream (you just get metadata).

But try calling the method on your myth backend (just type the url in your browser), and maybe something interesting will show up. You never know... Den 13/01/2014 16.31 skrev "Hauke Wintjen" notifications@github.com:

Hmm. Just googled and found http://www.mythtv.org/wiki/Content_Service#AddRecordingLiveStream

Isnt it that it sounds like?

— Reply to this email directly or view it on GitHub< https://github.com/tschaumburg/MythRecordings.bundle/issues/3#issuecomment-32179233>

.

— Reply to this email directly or view it on GitHubhttps://github.com/tschaumburg/MythRecordings.bundle/issues/3#issuecomment-32180000 .

tschaumburg commented 9 years ago

I'll leave this open, in the hope that someone will find a way to add LileTV playback to the MythTV Services API.

dvranizan commented 9 years ago

Hi All,

Thomas, thank you SO MUCH for this amazing Plex plugin. It is incredibly useful, my family and I use it daily!

I've been familiarizing myself with the MythTV codebase, and extending the services API to support Live TV is one of my top priorities. Would this be the best place to ping you and keep you informed?

tschaumburg commented 9 years ago

@dvranizan

Thank you for the kind words!

We'd be delighted to have someone from the Mythtv side on-board - this thread would, I think, be a good place to keep us on the Plex side in the loop.

And please ask if there's anything we can help with!

😀 thomas

kidmock commented 8 years ago

First of I think your plugin is awesome. Great work.

I've been looking at the APIs and while there isn't an explicit "LiveTV"

I think it can be achieved.

Perhaps the approach is to generate a cached list of visible channels. "Channel/GetChannelInfoList"

Get the show listings that are available at this hour for each channel: "/Guide/GetProgramDetails?ChanId=NNNN&StartTime=TTTT-TT-TTTTT:TT:TT"

When you select the option to "Play" Start Recording Dvr/AddRecordSchedule and open Content/AddRecordingLiveStream as an IPTV stream.

When you change channels "Dvr/RemoveRecorded" and "Content/RemoveLiveStream"

I've got things sort of working with Shell Scripts and System Events and the IPTV.bundle channel in plex. I can watch LiveTV but I have to go to a computer to start a stream or change a channel. It would be nice if we could everything in a single UI. Unfortunately, I don't know python well enough but I'm trying to learn.

I found this as well. https://github.com/dvrhax/pyMyth/blob/master/pyMyth.py

He's got the "record now" part down.

kidmock commented 8 years ago

Here's a shell script prototype livetv.txt

rcarballo commented 7 years ago

Here is the solution.-

START: Send the mythTV server command QUERY_RECORDER with SPAWN_LIVETV. This is a simple TCP/IP communication that Python can easily handle. Then use the DVR Service's GET_RECORDED with the channel ID and start time to the program for which you started LIVE TV. You can inspect the XML/json record coming back to verify that it is live by looking at "recordid=0" or "recgroup=LiveTV". By my observation of the database the "recordid" field is always zero for live TV streams.

You WILL need to get the list of cards using the DVR Service's CAPTURE/GetCaptureCardList because you have to pass the card's ID when doing SPAWN_LIVETV. The Kodi plugin just loops thru the list of cards until the SPAWN_LIVETV returns with success.

STOP: Send the mythTV server command QUERY_RECORDER with STOP_LIVETV. Simple TCP/IP string just like SPAWN_LIVETV's.

Here is the documentation for QUERY_RECORDER: https://goo.gl/RAJ7Op

I gathered this info by studying the KODI's mythTV plug-in. You can get it from, https://goo.gl/zpJ9js See "mythlivetvplayback.cpp" and "mythprotorecorder.cpp" files.