tgorgdotcom / locast2plex

A very simple script to connect locast to Plex's live tv/dvr feature.
MIT License
233 stars 43 forks source link

Live stream buffering a lot #239

Open odonnelladam opened 3 years ago

odonnelladam commented 3 years ago

I'm seeing a pause/buffering type thing every few minutes. I don't seem to get this if I record something and watch it back, but in live time it happens every 3-5 minutes. This isn't the nag screen; I've paid the $5 to Locast. It's a half-second cursor spin.

I'm using this on Windows 10 using the Python method. All TVs using Fire TV 4k Sticks. I have Nighthawk Routers and Extenders near all TVs with a high bandwidth available to each TV. (No issues streaming large 4k movies.) I've also tried with a direct wired connection to the router with similar results.

Could this be a network thing? Any suggestions?

CTJohnK commented 3 years ago

Not sure if this applies to you, but I have Spectrum and they have been having issues for the last few days. My speed dropped to 3mbps for two days. Today it's been spotty.

odonnelladam commented 3 years ago

Not sure if this applies to you, but I have Spectrum and they have been having issues for the last few days. My speed dropped to 3mbps for two days. Today it's been spotty.

No, I'm on a business line from Comcast. They haven't had any service issues in a while.

hdmllr commented 3 years ago

Adam, did you ever figure out this buffering issue? I am having the same problem with buffering. I have found a workaround but not a solution. If I hit pause for 10 seconds or so each time I change channels, then I don’t seem to have the buffering as long as I stay on that channel. I am also using 4K fire sticks as the client.

mbtfeedback commented 3 years ago

I’m having the same issue. Happens on Roku Ultra, Fire TV Cube, and Fire HD10 tablet. I’ve set transcoding to fast in Plex, enabled hardware acceleration etc. but nothing seems to solve it. It seems like there needs to be a greater buffer for playback but I don’t know if that’s Plex’s responsibility or someone else’s.

hdmllr commented 3 years ago

Thanks for mentioning issues on other clients. I just tried it on my PC and had the same buffering issues. I continue to try to isolate where/when the buffering happens. I have no buffering issues with Plex on the Firestick when I am watching my own media or when I am watching Plex’s Live TV or when I am watching locast in the native Locast app or on any other streaming apps on the Firestick. At least in my situation, it seems to be isolated to Locast2Plex live viewing (DVR recordings are fine).

mbtfeedback commented 3 years ago

Thanks for mentioning issues on other clients. I just tried it on my PC and had the same buffering issues. I continue to try to isolate where/when the buffering happens. I have no buffering issues with Plex on the Firestick when I am watching my own media or when I am watching Plex’s Live TV or when I am watching locast in the native Locast app or on any other streaming apps on the Firestick. At least in my situation, it seems to be isolated to Locast2Plex live viewing (DVR recordings are fine).

Same, local media and other streams work without issue, only Locast2Plex buffers like that.

odonnelladam commented 3 years ago

No, my wife watched live news last night and it buffered every few minutes. I'm using a Fire Stick 4k too. I assume it must be some kind of issue where Locast needs a larger buffer or something. I don't get the buffering if I watch on the PC where it's running and I don't get it on recordings.

odonnelladam commented 3 years ago

Screenshot_20210421-091223 Wondering if one of these settings from the config.ini example file might help. I'm not currently using any of the commented out ones.

mbtfeedback commented 3 years ago

Screenshot_20210421-091223 Wondering if one of these settings from the config.ini example file might help. I'm not currently using any of the commented out ones.

I tried adding the bytes_per_read argument and doubled the number, that didn't seem to help. Not sure how to set the cache dir, but that would be my next option.

odonnelladam commented 3 years ago

I tried adding "cache_dir" and just put in the path to the cache folder under locast2plex-main but that didn't seem to make a difference and I didn't see it add a temp file or anything like that.

hdmllr commented 3 years ago

In my continuing research on this issue, I found that there is an evolution of locast2plex called locast2tuner. It uses the locast2plex foundation code to link to locast, but is building out a bit differently than locast2plex. This project just started in the last few weeks, so it is still evolving. At this point, I am planning to continue using my pause workaround (works without fail) and watch how locast2plex and locast2tuner evolve.

odonnelladam commented 3 years ago

Sounds good. I'll keep an eye on them too. In the meantime, I'll give your workaround a try. By the way, when you check the Plex dashboard while watching Locast in Plex, are you direct stream? Not sure what it's direct stream instead of direct play but I'm assuming it's the video format.

hdmllr commented 3 years ago

Yes, my dashboard shows direct stream for both audio and video.

odonnelladam commented 3 years ago

FYI for others, I just watched nearly an hour's worth of live stream on the same channel with no buffering using the workaround from hdmllr. When I choose the channel, I immediately hit pause for like 10-15 seconds. After I "un-paused" it's been running fine since. Annoying, but a pretty decent workaround.

hdmllr commented 3 years ago

Adam, I just wanted to provide a quick update from my comments from a few months ago. Almost by accident, I discovered that I don't have the buffering issues with my Roku devices that I have with my Fire Stick. The difference seems to be that Roku has more flexibility in how I set the video settings. I am able to force Roku to use direct streaming which seems to solve the buffering issue for me.

odonnelladam commented 3 years ago

Huh. That's interesting. Wonder if there's anything we can do on the Fire Stick. Pausing to allow for buffer works but for some reason my wife sees no need to do it; instead chosing to get annoyed when it buffers. 😂

mbtfeedback commented 3 years ago

Adam, I just wanted to provide a quick update from my comments from a few months ago. Almost by accident, I discovered that I don't have the buffering issues with my Roku devices that I have with my Fire Stick. The difference seems to be that Roku has more flexibility in how I set the video settings. I am able to force Roku to use direct streaming which seems to solve the buffering issue for me.

I tested this out myself as I have a Roku Ultra and a Amazon Fire TV Cube. I was hopeful the Cube would have the options as it is one of the beefier playback devices that Amazon offers, but no such luck. I did make the changes on the Roku Ultra (FORCE Direct Stream and enable MPEG-2) and the issue disappeared on that device. Looks like I'll be swapping out my FireTV Cube with the extra Ultra I had laying around. I'm kind of disappointed in the Fire TV Cube performance at this point. I have a feeling it will be showing up on ebay soon.

cyberdog433 commented 3 years ago

I can confirm that Locat2Tuner doesn't appear to buffer the same way as Locast2Plex does. I had buffering issues with Locast2Plex, more so connected to the FireTV devices, than the Roku devices. (Setting the option view in original format, as opposed to allowing the server to transcode helped, but still every minute or so, there would be a slight pause/buffering). This was with Locast2Plex running as a service under Windows 10.

Moving to Locast2Tuner, which is now written in Rust and compiles into a standalone EXE, which can be run as a service by the way, seems to have fixed the buffering on the FireTV devices. Just make the switch last night, using the latest source-code. My only issue was getting the source-code to compile, with the prerequisite installs, and sparse documentation on doing so, in finding the command to do it. (First time takes several minutes of downloading the required components, then any future compiles take around 2 seconds). - Shame they don't include a precompiled EXE as part of the download.

Hey, but it appears to work great, and oddly finds more channels in the Locast stream than Locast2Plex does, which requires q bit more time for Plex to download 7 days worth of guide info, but so far, so good. I have a couple of test recordings occurring today, including two at the same time.

mbtfeedback commented 3 years ago

I can confirm that Locat2Tuner doesn't appear to buffer the same way as Locast2Plex does. I had buffering issues with Locast2Plex, more so connected to the FireTV devices, than the Roku devices. (Setting the option view in original format, as opposed to allowing the server to transcode helped, but still every minute or so, there would be a slight pause/buffering). This was with Locast2Plex running as a service under Windows 10.

Moving to Locast2Tuner, which is now written in Rust and compiles into a standalone EXE, which can be run as a service by the way, seems to have fixed the buffering on the FireTV devices. Just make the switch last night, using the latest source-code. My only issue was getting the source-code to compile, with the prerequisite installs, and sparse documentation on doing so, in finding the command to do it. (First time takes several minutes of downloading the required components, then any future compiles take around 2 seconds). - Shame they don't include a precompiled EXE as part of the download.

Hey, but it appears to work great, and oddly finds more channels in the Locast stream than Locast2Plex does, which requires q bit more time for Plex to download 7 days worth of guide info, but so far, so good. I have a couple of test recordings occurring today, including two at the same time.

Is there a guide anywhere on how to do this? I’d love to give it a shot.

scumola commented 3 years ago

No disrespect to the author of this tool, but I've also moved over to locast2tuner and found it to work much better and more reliably than this one. Also, I'm using the containerized version on my docker swarm cluster and I've got it to pull the new image on failure, so whenever a code update is required - like when locast changes their login process or something, the author pushes a fix (and he's pretty good with timely updates) and my cluster just pulls the new one when the old container dies and I'm none the wiser. It's working pretty well for me and has been for 3-4 months now.