I’ve recently finally been able to set up Plex LiveTV to work with my TVHeadend installation (via plexheadend. After twiddling with the general settings to allow Original-quality playback and MPEG2 playback, I’ve managed to eliminate the need for transcoding which was a HUGE concern.
So now I’m closer to having things run the way I want them to!
I now have two remaining problems on my list:
I can’t sort the channels by number, the UI only allows sort by name (I’ve found this, which means it may eventually make it in)…
playback takes TOO long to start: I’ve clocked it upwards of 20 seconds, even as high as 30 sometimes. Then it starts smoothly and perfectly. But the delay is annoying … I’m guessing it’s because it has to look at the stream to try to identify what it is and if there’s need for encoding. Maybe there’s additional metadata that can be supplied to Plex’s LiveTV engine to provide that information up front in order to expedite things? Perhaps there’s a configuration somewhere that tells Plex to supply the stream in its original format regardless, and “client be damned” if it doesn’t support it?
Yes, but sometimes one doesn’t have the option to sort the XMLTV listings one receives, and as a programmer I can tell you that it’s (relatively) trivial to add a custom sort option so the user can have the list displayed in a particular sort order…
It might not be trivial, depending on how they are storing it. Maybe they are storing the XML data as it comes in, but resorting it could mean they have to rebuild and store a new file every time it’s updated if a user wants it sorted different from the default.
I don’t know how they are working with the data, but the Plex programmers seem to opt for simple instead of flexible whenever the opportunity arises.
As far as I can tell, they stash everything in a sqlite DB (or somesuch), so being able to efficiently retrieve things in one order vs. another is trivial since it’s just a matter of changing some SQL “order by” clause accordingly.
I’m not asking for 37 different possible sort orders: by channel name, number, (maybe) ID, and “unsorted” (i.e. as-received) should be enough to cover the vast majority of use cases.
Sometimes one simply doesn’t have control of the XMLTV order and it’s less than ideal for “simple use”…
And, you’re using a “man-in-the-middle” TV tuner software app, then (yet another software server) that provides streams imitating a hardware tuner… You’re not connecting to a hardware tuner like what Plex supports.
Are you sure either of your issues are due to plex?
If you disconnect/shutdown the proxy and TVheadend, then have Plex directly attach to the hardware tuner, do you experience these issues?
I just tried replicating your issues on my old Roku 2 XS, using latest Plex Preview application, on a HDHomerun Extend (with high quality setting x264 included prior to Plex)).
Video streams on average take 8-15 seconds before playing, depending on channel broadcast (1080i, 720p, 480p)
Channel lineups are numerically ordered.
I can’t bypass TVH because (and pity me a little here ) I still have to deal with analog tuners. There are other complicating factors which just make it simpler for me to pipe everything through TVH.
Now, as for the play back delay: Kodi has no such huge delay in starting playback from TVH, so that rules out the “man-in-the-middle” as the cause (and yes, Kodi also buffers the video).
I’ve managed to jury-rig a solution for the channel ordering for now, so that tidbit is taken care of - at least temporarily.
But the other issue remains: why does it take so long for the video to start playback?
Over here, it’s an average of 18 seconds, rarely less than 15, sometimes up to 30. And this is for direct play (either h264 or MPEG2) from HDHomeRun to a Roku or Fire TV. via Plex, all connected by ethernet. It’s the same LAN where Media Center can tune a channel from the same HDHR in approximately one second.
I’ve never quite understood why Plex is so slow to start a live TV channel.
Glad to see I’m not the only one seeing massive, apparently unjustified playback delays.
I think this has to do with the fact that Plex starts to stream to a temporary file in case transcoding is needed, then streams outward from that file (as I recall). This is all fine and dandy except for the inevitable delay.
The only way to get rid of this in the case of live streams is to somehow add information to the streams that describes the incoming codecs/containers in use so Plex can pro-actively decide if any transcoding is needed since it already knows what client is requesting playback and which codecs/containers it supports.
Alas, I think for simplicity and robustness they just coded everything to be processed in that flow (source → temp file → transcoder (if needed) → client) vs. the optimal one (source → [if needs transcode then { temp file → transcoder } else { passthrough}] → client). As a programmer I can understand the huge temptation of doing things like the above simple, single-pipe approach. However, that does have a usability price in unnecessary playback delays, and a coding price (savings, really) in how one allows stream sources to pro-actively indicate the codecs the streams are coming in from.
Anyhow, just my $0.02… we’ll see what the official Plex folks come back with - if they even bother to read this
Not to fully disagree, but, do you run both TVH and Plex from the same server?
That would be a lot of disk IO before it ever has a chance to reach client (even if not on the same server), which could be adding delay.
Presumably the TVH proxy reads from the TVH disk stream just as Plex client reads from the Plex server temp disk file stream.
Tuner - [TVH server > TVH PVR disk file] > TVH proxy - [Plex > Plex PVR disk file] - Plex Client
TVH is on a different box, with SSD’s. Plex is on a QNAP with mechanical disks. Granted - the lack of SSDs in the QNAP could well be a factor, but it shouldn’t be THIS bad (I think)…
Can’t wait for large-size SATA SSD prices (4TB) drops to become affordable
Just wanted to note, since I commented above, that I don’t use TVH at all. I’m using an HDHR Prime (and an antenna model as well). It’s just HDHR → Plex Server → Client, all over ethernet. Still 18-20 seconds delay.
To be honest, while it’s not a great experience to watch (for example, it’s impossible to use social media while watching live sports, because every moment is spoiled), I could get over it. It’s just driving me a bit crazy to not know why. I can appreciate hard drive buffering for ff/rw, but 20 seconds of delay? And shouldn’t I be able catch up to within a few seconds of “live” once the buffer has completed?
What model Roku? Some older (3 and less I think) require mpeg2 transcoding by Plex (more time)
If you have a newer model, have you enabled/tried the new ‘mpeg2 decoding’ setting in the Plex Preview? I think it allows direct if your Roku supports it.
I’ve got the HDHR “extend”, which encodes the stream inside the .ts container to x264 so Plex doesn’t have to. (and I use 3 and older, tested above on a 2XS). I don’t think Prime encodes.
My guess is Plex buffers 5-10 seconds of stream to disk (after feeding to transcoder if needed? or vice versa), then to client.
That’s just a guess though.
Good questions! I have five different models in the house:
Current-gen Roku Ultra (wired), current-gen Roku Stick+ (wifi), Previous-gen TCL Roku TV (wireless), current-gen Amazon Fire TV (wired), Nvidia Shield (wired). The server is a quad-core Haswell, which is of course mostly idle for direct-play live TV. The hard drives don’t spin down so there’s no delay there.
All devices are set to direct-play MPEG2 for network channels (successfully!), and cable channels are h.264. For all devices and codecs, Plex keeps at least 15 seconds of lag for live TV, with 20+ seconds not uncommon. I can compare the time by using the HDHomeRun app on my computer. With a sporting event, I can literally just subtract the difference in seconds on the clock. SiliconDust’s Windows app is actually delayed a few seconds as well, but I’m ignoring that for these purposes.
For watching live sports, I often swap from Plex to the HDHR app on FireTV and Shield. They still don’t have a Roku app though, so that’s not an option.
I have one (soon to be two) Roku Ultras, with MPEG2 decoding enabled.
As for how long Plex should buffer before playback starts - 15 seconds seems a bit much, with 2 seeming like a more appropriate number. In my case, TVH is already buffering so maybe a setting should be added to indicate how long a buffer one wishes to employ before playback starts for live TV?
As for the “ordering channels” bit: on the Web UI it’ll display the channels in the same order they’re contained within XMLTV stream. However, the Roku app seems to just want to do its own thing and still shows them ordered by Channel ID/Name …
This is also driving me nuts. I actually have been testing Emby because of it. Loads a lot faster. I’m also having issues with the live tv where it’ll be fine and then say loading and then throw some message about a problem with the channel. I know that is not the case because it doesn’t happen in Emby or the HDHR app. I really wish this could get fixed so I can just go back to using plex.
I did a fresh test tonight: The delay is noticeably worse on Roku devices than Android TV devices. This involves Comcast and h264 channels, which direct play fine.
Android TV (Fire TV stick) has a far smaller lag time. But it chokes on commercials that change resolution so I have to restart it during commercial breaks. That’s probably a separate topic when I track it down.