How do Kodi clients tune into channel via a MythTV backend server w/ HDHomeRun's
#1
I was hoping someone would be able to answer a question concerning how remote front ends, that are connected to the mysql/mythtv backend on a main server, tune into channels?

I currently have 2 HDHomeRun Primes with Windows Media Center and 3 XBOX 360 extenders. It has failed me for the last time. PlayReady, again, became corrupt after a Windows Update and I'm done with Microsoft.

To be fair, before I headed in the direction of WMC, I checked out XBMC and just didn't have the patience to run through the MythTV backend install. I was also not as experienced with linux as I am now. After the latest issue with WMC, I decided to check into Kodi and found a 25 minute video walking you through how to setup. I tell you, I wish I had found something like that 3 years ago, I cannot believe how easy it was to setup. I had space on my esxi server and had it up and running in less than 30 minutes. To my surprise, I could tune into live T.V. on a remote kodi install which is on a Galaxy Tab 2.

So, now I have the question of, what resources do I need to plan for. With Windows Media Center, the Windows Media Center Server does 100% of everything. The Xbox only connects to the Media Center to obtain, basically, a remote desktop connection to "view" the live T.V. remotely.

For Kodi, I am not sure how it works since you require your own front end kodi install at each T.V./Device.

Does the remote device end up tuning directly into the tuner? Or does the Kodi with MythTV backend, I will call this "server" tune into the tuner?

If it's the latter, and the "server" tunes into the channels directly to the tuner, how does it relay that to the remote front end.

Is it just proxying/relaying uncompressed video to the remote Kodi front end without any transcoding/compression?

Can you transcode at the server level, or is it expected the remote kodi device handle this?

If it's sending 25-50mb/s uncompressed video to the client, I suspect the client will have to have a bit of horsepower to transcode and offer up to the screen (Will something like a Raspberry Pi 3 Model B with 1GB RAM QuadCore 1.2GHz CPU be good enough to offer up 1080p?, or should I go for something a little beefier?)

Somewhat of an unrelated question, but on my mind. How reliable has the scheduled recording been with MythTV, in the context of available tuner assignment and attempting to utilize an available tuner to record a scheduled show. I had run into some issues with WMC in the passed where I would continue to get failed recordings because it would state there were no available tuners, but only 1 of 6 tuners were in use at the time. This went away. I can't remember whether it was a firmware issue with the HDHomerun Primes, or an issue that went away after I had to reinstall WMC one of the three times I have had to because it sucks.

Thanks in advance for any feedback. I am kinda stoked to get working on moving away from Micro$oft.
Reply
#2
In the mythtv back end, you just set up tuners. You then scan for channels. When watching live TV, the myth back end attaches to the hdhomerun and has the stream fed to it. It buffers the stream to disk. I'm not sure of the details with the the Kodi plugin on how it physically accesses the disk buffered stream, but it works. I've been doing it for a couple of years now and it has been "wife approved". I used to use wmc too. Since I only use mythtv as a back end, there are a lot of features I don't use. I tried going to a lighter weight solution with tvheadend, but I could never get it to work correctly.

Right now, I'm using an I3 for the myth box which is overkill. In the future I plan to switch to an XU4 and store the recordings on a NAS box assuming I can figure out how to get the MySQL data moved intact and keep my giant archive of recordings as recordings and not "videos". When I switched from wmc, I was surprised to find that there is no real mechanism to load existing recordings from it into mythtv as recordings. No was going to write something to extract the metadata from the end files and load it into MySQL, but I wasn't sure exactly what needed to be done across all the tables so that I didn't break the database. I got preoccupied with other things and dropped the project.

Sent from my Moto G (4)
Experience: It's what you get when you were expecting something else.
Reply
#3
No transcoding required. TV is broadcast as either mpeg2 or h264[1], and any modernish gpu will handle them. Even raspberry pi hardware accelerates mpeg2 and h264.

You do need a reasonable network throughput, prefer wired, then powerline, wifi as a last resort.

Everything goes through the mythtv server. On myth livetv is treated the same as a recording, ie it is recorded to harddrive and available to rewind, pause and completely rewatch. Livetv recordings are deleted after (by default) 2 days, but you can change the length of time.

Mythtv was designed for recording "record what you want to watch, watch it when you want" rather than livetv, but livetv is at the point where I find it bulletproof.

[1] hevc will emerge but is in it's infancy.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#4
MythTV uses the libhdhomerun library, which is provided by SiliconDust for third parties to use to interact with their hardware. (When you use the 'hdhomerun_config' utility from the command line, it is in fact directly using the libhdhomerun library to handle all of its functionality.)

When you set up MythTV with the Primes, you created an input each for the tuners in the Prime, so since you stated you have 2 Primes, you would have 6 inputs in MythTV. (I believe MythTV calls these Capture Cards.)

When you wish to tune a channel or a recorded program is about to begin, MythTV goes through its priority lists to find an appropriate tuner to use. Then it tells that tuner to tune the channel it is requesting. After it gets a channel lock, it then opens a stream from the device to MythTV's own buffers, either the LiveTV buffer for an interactive channel request or to the recorded file in the case of a scheduled recording.

The Prime does not support transcoding in its hardware, it merely passes on the stream as is provided by your cable company. Usually that would be MPEG-2, but more frequently the cable operators and transitioning some channels to AVC/H.264 to make room for future bandwidth needs. While you need to make sure your devices can decode either format, it does not matter to the Prime.

MythTV does offer some transcoding options for AFTER a recording has completed. If you choose to enable the mythtranscode jobs as part of your recording setup it will transcode a recording to the new format after it has completed. Personally, the savings of disk space using mythtranscode are not worth the hassle of getting it properly set up and outputting at a quality you are satisfied with; just skip this option.

To ensure the best experience, you will want to make certain that whatever device you choose to place as a client at the TV running Kodi can decode MPEG-2 and AVC/H.264 in hardware. (I have Raspberry Pis in the bedrooms running Kodi, and with the purchased MPEG-2 license I find them wholly adequate. Your usage needs may differ, but this was just an example.)
Reply
#5
(2016-12-09, 22:31)afremont Wrote: In the mythtv back end, you just set up tuners. You then scan for channels. When watching live TV, the myth back end attaches to the hdhomerun and has the stream fed to it. It buffers the stream to disk. I'm not sure of the details with the the Kodi plugin on how it physically accesses the disk buffered stream, but it works. I've been doing it for a couple of years now and it has been "wife approved". I used to use wmc too. Since I only use mythtv as a back end, there are a lot of features I don't use. I tried going to a lighter weight solution with tvheadend, but I could never get it to work correctly.

Right now, I'm using an I3 for the myth box which is overkill. In the future I plan to switch to an XU4 and store the recordings on a NAS box assuming I can figure out how to get the MySQL data moved intact and keep my giant archive of recordings as recordings and not "videos". When I switched from wmc, I was surprised to find that there is no real mechanism to load existing recordings from it into mythtv as recordings. No was going to write something to extract the metadata from the end files and load it into MySQL, but I wasn't sure exactly what needed to be done across all the tables so that I didn't break the database. I got preoccupied with other things and dropped the project.

Sent from my Moto G (4) (typie typie)

Nice, thanks for the info. I bought an extra HDHomerun Prime today a Frys and just got back from Cox with a new cable card. I need to provide a proof of concept before the CEO (Chief Entertainment Officer, a.k.a. wife) writes off on a full production deployment and I can't touch the current production deployment. I don't even breath on the thing and cringe anytime I need to shut down the server or restart the VM.

I have a Rasberry Pi 2 I just used and it didn't do well. It was choppy. To be fair it was powerline ethernet connected, but so is the XBOX 360 extender and it does (sometimes a little lag, but the pi was not good).

I will keep the migration of recorded shows in mind before cutting over. I would like to use MCEBuddy to remove the commercials and I know there's some auto-renaming features. I am not sure whether Kodi auto populates info like Plex does, but was hoping it did, assuming the naming of the shows is correct.
Reply
#6
(2016-12-09, 23:28)nickr Wrote: No transcoding required. TV is broadcast as either mpeg2 or h264[1], and any modernish gpu will handle them. Even raspberry pi hardware accelerates mpeg2 and h264.

You do need a reasonable network throughput, prefer wired, then powerline, wifi as a last resort.

Everything goes through the mythtv server. On myth livetv is treated the same as a recording, ie it is recorded to harddrive and available to rewind, pause and completely rewatch. Livetv recordings are deleted after (by default) 2 days, but you can change the length of time.

Mythtv was designed for recording "record what you want to watch, watch it when you want" rather than livetv, but livetv is at the point where I find it bulletproof.

[1] hevc will emerge but is in it's infancy.

Nice. Yeah, I tried a Raspberry pi tonight via the same ethernet the xbox 360 extender is using and it didn't do well. I will check out some other low power options and see if I can find a good balance, without providing an overkill with the client hardware. The tablet I used did great just on AC wifi, so I gather I won't need a full blown desktop CPU to provide the client.

When you say, LiveTV recordings are deleted after 2 days, do you mean the buffering that is provided when watching live T.V., or do you mean, recorded shows? I assume you mean LiveTV "buffered" shows, but just want to make certain.
Reply
#7
(2016-12-10, 00:44)rpcameron Wrote: MythTV uses the libhdhomerun library, which is provided by SiliconDust for third parties to use to interact with their hardware. (When you use the 'hdhomerun_config' utility from the command line, it is in fact directly using the libhdhomerun library to handle all of its functionality.)

When you set up MythTV with the Primes, you created an input each for the tuners in the Prime, so since you stated you have 2 Primes, you would have 6 inputs in MythTV. (I believe MythTV calls these Capture Cards.)

When you wish to tune a channel or a recorded program is about to begin, MythTV goes through its priority lists to find an appropriate tuner to use. Then it tells that tuner to tune the channel it is requesting. After it gets a channel lock, it then opens a stream from the device to MythTV's own buffers, either the LiveTV buffer for an interactive channel request or to the recorded file in the case of a scheduled recording.

The Prime does not support transcoding in its hardware, it merely passes on the stream as is provided by your cable company. Usually that would be MPEG-2, but more frequently the cable operators and transitioning some channels to AVC/H.264 to make room for future bandwidth needs. While you need to make sure your devices can decode either format, it does not matter to the Prime.

MythTV does offer some transcoding options for AFTER a recording has completed. If you choose to enable the mythtranscode jobs as part of your recording setup it will transcode a recording to the new format after it has completed. Personally, the savings of disk space using mythtranscode are not worth the hassle of getting it properly set up and outputting at a quality you are satisfied with; just skip this option.

To ensure the best experience, you will want to make certain that whatever device you choose to place as a client at the TV running Kodi can decode MPEG-2 and AVC/H.264 in hardware. (I have Raspberry Pis in the bedrooms running Kodi, and with the purchased MPEG-2 license I find them wholly adequate. Your usage needs may differ, but this was just an example.)

Thank you.

So, let me know if this is a correct way to understand it. The MythTv backend handles the requests to the HDHomerun Prime, locks into the tuner, writes that uncompressed LiveTV in MPEG-2 or AVC/H.264 to its own disk, then PVR client reads that uncompressed data from the servers disk? The client itself doesn't handle the buffering or writing any of that uncompressed data to it's own drive, it's all handled by the backend server?
Reply
#8
You need to make sure you have a hardware mpeg2 license for the pi, otherwise it will use software decoding which won't work for you.

Yes, he's talking about the live TV buffers being deleted in two days. Mythtv gives you the ability to decide that you want a live TV program to become an actual recording. Recordings can be set to auto expire when disk space gets low, or they can be deemed permanent.

I have literally thousands of recordings occupying a 5TB hard drive.

I don't know about the prime, but I believe the extend model does have the ability to transcode an mpeg2 stream to h.264 on the fly. I have the connect model, actually two of them. They allow up to four simultaneous streams. I have them prioritized in mythtv so that they are allocated in one order for live TV streams and the opposite order for scheduled recordings.

Once you get it figured out, I think you'll be very happy with mythtv over wmc. I also use raspberry pi boxes for my front-end devices. They are running openelec, now known as libreelec. The odroid c2 might be a better choice these days as it has much better performance, gigabit Ethernet and hardware mpeg2 decode without buying a license.

Sent from my Moto G (4)
Experience: It's what you get when you were expecting something else.
Reply
#9
(2016-12-10, 04:35)afremont Wrote: You need to make sure you have a hardware mpeg2 license for the pi, otherwise it will use software decoding which won't work for you.

Yes, he's talking about the live TV buffers being deleted in two days. Mythtv gives you the ability to decide that you want a live TV program to become an actual recording. Recordings can be set to auto expire when disk space gets low, or they can be deemed permanent.

I have literally thousands of recordings occupying a 5TB hard drive.

I don't know about the prime, but I believe the extend model does have the ability to transcode an mpeg2 stream to h.264 on the fly. I have the connect model, actually two of them. They allow up to four simultaneous streams. I have them prioritized in mythtv so that they are allocated in one order for live TV streams and the opposite order for scheduled recordings.

Once you get it figured out, I think you'll be very happy with mythtv over wmc. I also use raspberry pi boxes for my front-end devices. They are running openelec, now known as libreelec. The odroid c2 might be a better choice these days as it has much better performance, gigabit Ethernet and hardware mpeg2 decode without buying a license.

Sent from my Moto G (4) (typie typie)

Aww, ok. I just went back to the video and noticed the front end he was using WAS a pi 2 and 1080p over ethernet looked great. Thank you, I believe that's a nugget missing from the video, or I just wasn't paying attention.I have heard the prime can transcode, I vaguely remember reading about it but there was some mention of it's abilities, almost as if it was in beta. (speaking about a 2-3 year old memory). I am ok with straight uncompressed. I almost rather prefer it. I just like the flexibility Plex provides. I was auto-renaming my shows last year and pointing Plex to them so I could watch them anywhere.

I will checkout the license and see if the pi will work.

I just checked out the odroid c2, I hadn't heard of it. That looks future proof in terms of 4k. Thank you.
Reply
#10
(2016-12-10, 04:09)Daren Wrote:
(2016-12-09, 23:28)nickr Wrote: No transcoding required. TV is broadcast as either mpeg2 or h264[1], and any modernish gpu will handle them. Even raspberry pi hardware accelerates mpeg2 and h264.

You do need a reasonable network throughput, prefer wired, then powerline, wifi as a last resort.

Everything goes through the mythtv server. On myth livetv is treated the same as a recording, ie it is recorded to harddrive and available to rewind, pause and completely rewatch. Livetv recordings are deleted after (by default) 2 days, but you can change the length of time.

Mythtv was designed for recording "record what you want to watch, watch it when you want" rather than livetv, but livetv is at the point where I find it bulletproof.

[1] hevc will emerge but is in it's infancy.

Nice. Yeah, I tried a Raspberry pi tonight via the same ethernet the xbox 360 extender is using and it didn't do well. I will check out some other low power options and see if I can find a good balance, without providing an overkill with the client hardware. The tablet I used did great just on AC wifi, so I gather I won't need a full blown desktop CPU to provide the client.

When you say, LiveTV recordings are deleted after 2 days, do you mean the buffering that is provided when watching live T.V., or do you mean, recorded shows? I assume you mean LiveTV "buffered" shows, but just want to make certain.

LiveTv is the SAME as a recording. It produces a file exactly like if you had preset a recording, but of course it only records for the time you are actually watching it. So the LiveTV "buffer" is a normal recording file. It is placed in a different recording group, and that group is marked deletable after two days. When the hard drive starts to fill up it deletes all deletable stuff first. In other words, even if you delete a recording (live or preset) it usually sticks around until your recording drive fills up.

Anyway the important point is that live tv produces exactly the same file as a preset recording.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#11
Odroid C2 works well, although I don't have any mpeg2 recordings, all mine are h.264 (because thats what they broadcast here, a bonus of being somewhat tardy to take up HD means we skipped the older tech and went straight to h264.)
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#12
(2016-12-10, 06:54)nickr Wrote: Odroid C2 works well, although I don't have any mpeg2 recordings, all mine are h.264 (because thats what they broadcast here, a bonus of being somewhat tardy to take up HD means we skipped the older tech and went straight to h264.)

I ended up doing finding the NEXBOX A1 S912 which has 2GB and a Octa-Core ARM Cortex-A53 cores and a tri-core ARM Mali T-820 GPU. It's come with a remote and was $70 shipped (also has AC wifi, bluetooth 4.0 and HDMI 2.0). I am gonna check that out and see if I can get Kodi on it and see if it really performs as it should with the hardware it's marketed with. It might be a winner.
Reply
#13
S912 is not a great choice unless something changes recently.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#14
(2016-12-11, 02:40)nickr Wrote: S912 is not a great choice unless something changes recently.

Hmm, odd. I went by the benchmarks after doing some research. Amazon was out of the Odriod C2 and I wanted to stick with a Amazon Prime purchase. Any idea's on what's not great about that chip?
Reply

Logout Mark Read Team Forum Stats Members Help
How do Kodi clients tune into channel via a MythTV backend server w/ HDHomeRun's0