Jump to content

HDHomeRun/LiveTV Skips & Stutters


saltedhash

Recommended Posts

saltedhash

Hi all,

Did some searching for similar issues, but I can't seem to find anything recent or that was a fix, so wanted to post my issue here.

I recently purchased an HDHomeRun Duo and have it connected with Emby. In the HDHomeRun app, live tv works perfectly with no stuttering. In Emby while connected locally, also no stuttering. The issue is external users. Any channel will skip/stutter every 5 seconds for about 1 second each time. It's very frustrating and you're barely able to deal with watching the stream because the skips are so often.

This also happened before version 4.5.0.50. I have plenty of resources for transcoding and external users can play other shows just fine (whether direct play or transcoded). It's a 16 core server running on an SSD and I also have Gig Fiber, so I can't find any issues with resources/bandwidth.

My example logs are from a user externally, with Auto selected for quality. Whether I have it set to 1080p - 60mbps (which my server/internet can handle/serve to clients) or 720p - 1mbps, it still stutters.

Any thoughts?

ffmpeg-transcode-24f0ba8b-d93f-49aa-a19f-b97f03522896_1.txt embyserver-log.txt

Edited by saltedhash
Link to comment
Share on other sites

saltedhash
25 minutes ago, Luke said:

Hi, have you tried the emby app on Android instead of the web app?

Same issue, just doesn't happen as often (maybe stutters every 8-10 seconds instead of 5 seconds). I also tried it on a Samsung Smart TV with the Emby app, and it also stutters.

Link to comment
Share on other sites

You need to throttle the playback speed on your server such that the number of streams times the speed is less than the upload speed of your connection. 

Link to comment
Share on other sites

saltedhash
1 minute ago, Sammy said:

You need to throttle the playback speed on your server such that the number of streams times the speed is less than the upload speed of your connection. 

I may not be understanding...is there a setting for this? When I did this test with no other streamers, it stuttered. And I have ~900mbps upload on my connection.

Link to comment
Share on other sites

Q-Droid

Does pausing on the client for 5-10 seconds fix playback? 

Are the clients negotiating their bandwidth correctly? You can see this in the logs. If they are not ask them to change speed from Auto to their max. 

16 cores may seem like a lot but the workload dictates the outcome. Multiple concurrent clients that need transcoding can still affect playback. 

 

 

 

Link to comment
Share on other sites

saltedhash

Yes I have gig fiber that's symmetrical. After overhead I get around 900mbps up and down. I don't foresee this being the issue.

Interesting that pausing playback for 10 seconds results in smooth playback once resumed. What does this mean exactly? My hardware and internet are fast enough for smooth playback on everything else besides Live TV. It seems clients negotiate correctly. My logs are above.

When testing I didn't have any other clients streaming, so there was no other workload besides this single Live TV stream. If it means anything, my CPUs passmark at just over 20,000. I'm just having a hard time believing its resources associated with the server or my internet. I don't have any issues with other streaming.

Link to comment
Share on other sites

Happy2Play

Is the device/client set on Auto quality? 

I would not expect a connection or system like that to have a issue with under 1Mbps transcode (&VideoBitrate=701000&AudioBitrate=384000).

2020-09-22 19:22:36.279 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 20384000, max bitrate: 1085000
2020-09-22 19:22:36.279 Info App: Bitrate exceeds DirectStream limit: media bitrate: 20384000, max bitrate: 1085000
2020-09-22 19:22:36.280 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 20384000, max bitrate: 1085000
2020-09-22 19:22:36.280 Info App: Bitrate exceeds DirectStream limit: media bitrate: 20384000, max bitrate: 1085000

Transcode log appears to be processing fast enough, but starts at 1.85x slows to 1.03x.

Link to comment
Share on other sites

Q-Droid
1 hour ago, saltedhash said:

Yes I have gig fiber that's symmetrical. After overhead I get around 900mbps up and down. I don't foresee this being the issue.

Interesting that pausing playback for 10 seconds results in smooth playback once resumed. What does this mean exactly? My hardware and internet are fast enough for smooth playback on everything else besides Live TV. It seems clients negotiate correctly. My logs are above.

When testing I didn't have any other clients streaming, so there was no other workload besides this single Live TV stream. If it means anything, my CPUs passmark at just over 20,000. I'm just having a hard time believing its resources associated with the server or my internet. I don't have any issues with other streaming.

It looks like your clients either have low bandwidth or (most likely) they are not advertising the correct available bandwidth which is forcing a transcode for the stream from the original ~20mbps down to ~1mbps. 

So what you have here are two things, incorrect client bitrate and possibly unnecessary work. This is Live TV so even with a lot of compute power for transcoding you can't go faster than real time and any work slows things down slightly, CPU time, I/O, etc. This is one of the reasons pausing helps, it builds enough of a buffer to keep things smooth.

See if you can stop transcoding by asking your users to set a higher bitrate. This might help some if they can direct stream but if they're using something like a browser then it's going to transcode Live TV because they can't play MPEG2 natively.

The stuttering is basically a buffer underrun. It doesn't happen with ripped and recorded media because the streams can be served faster than the playback speed and build a buffer on the client. With Live TV Emby doesn't give much and from what I've seen it can be affected by the speed at which segments are created and switched on disk. Slow storage can make it worse while fast storage helps but doesn't cure it for everyone. Also some clients can handle it better than others. I notice it on browsers but not Android TV.

 

  • Like 1
Link to comment
Share on other sites

saltedhash
1 hour ago, Happy2Play said:

Is the device/client set on Auto quality? 

I would not expect a connection or system like that to have a issue with under 1Mbps transcode (&VideoBitrate=701000&AudioBitrate=384000).


2020-09-22 19:22:36.279 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 20384000, max bitrate: 1085000
2020-09-22 19:22:36.279 Info App: Bitrate exceeds DirectStream limit: media bitrate: 20384000, max bitrate: 1085000
2020-09-22 19:22:36.280 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 20384000, max bitrate: 1085000
2020-09-22 19:22:36.280 Info App: Bitrate exceeds DirectStream limit: media bitrate: 20384000, max bitrate: 1085000

Transcode log appears to be processing fast enough, but starts at 1.85x slows to 1.03x.

I tried device set to Auto and manually set it to 720p - 1mbps. Both stuttered.

I've tried it via my phone on cellular (yes this will be low bandwidth) and via web browser accessing my external URL.

I wasn't entirely sure how to interpret from the logs if it's transcoding fast enough, so thank you for confirming.

Link to comment
Share on other sites

saltedhash
36 minutes ago, Q-Droid said:

It looks like your clients either have low bandwidth or (most likely) they are not advertising the correct available bandwidth which is forcing a transcode for the stream from the original ~20mbps down to ~1mbps. 

So what you have here are two things, incorrect client bitrate and possibly unnecessary work. This is Live TV so even with a lot of compute power for transcoding you can't go faster than real time and any work slows things down slightly, CPU time, I/O, etc. This is one of the reasons pausing helps, it builds enough of a buffer to keep things smooth.

See if you can stop transcoding by asking your users to set a higher bitrate. This might help some if they can direct stream but if they're using something like a browser then it's going to transcode Live TV because they can't play MPEG2 natively.

The stuttering is basically a buffer underrun. It doesn't happen with ripped and recorded media because the streams can be served faster than the playback speed and build a buffer on the client. With Live TV Emby doesn't give much and from what I've seen it can be affected by the speed at which segments are created and switched on disk. Slow storage can make it worse while fast storage helps but doesn't cure it for everyone. Also some clients can handle it better than others. I notice it on browsers but not Android TV.

 

I've tested via browser, which always requires a transcode as you mentioned. I did play it from the Emby app on my Samsung Smart TV and it stuttered when accessing externally, but works fine internally. Browser, phone and Smart TV are my only testing options on hand unless I have a user handy to help with testing. 

I didn't think of the realtime/buffer like that, so definitely makes sense why locally stored shows play fine and why pausing for a few seconds can help it stay ahead. 

During testing the server had 0 load and is running on an SSD, testing from a desktop also on an SSD, if that means anything. 

One thing I have noticed since having this newer, better server is my CPU utilization goes up to maximum 5% when doing a full transcode when my old one ramped up the fans and churned out the transcode much faster. I don't have throttling enabled and I have the CPU set to Max so it uses everything. Maybe this is a contributing factor? In general locally stored shows always seem to keep a buffer a few minutes ahead of the playtime, but like I said my older server that had a passmark of maybe 2,000 would complete the transcode faster. Is there a setting I'm not aware of that I could tweak to say when transcoding, use more of the CPU resources that are available?

Edited by saltedhash
Link to comment
Share on other sites

Q-Droid

If HW acceleration is involved for transcoding then CPU util will be much lower. I think you've tweaked all of the usual transcoding settings. There are others under conversions that are specific to that function. On Emby apps you can tweak the Live TV start time and it helps sometimes. I don't know if there's an equivalent for browsers.

Link to comment
Share on other sites

12 hours ago, saltedhash said:

Interesting that pausing playback for 10 seconds results in smooth playback once resumed. What does this mean exactly?

One possible explanation would be high latency.

Link to comment
Share on other sites

reneboulard
On 9/22/2020 at 10:36 PM, saltedhash said:

I recently purchased an HDHomeRun Duo and have it connected with Emby. In the HDHomeRun app, live tv works perfectly with no stuttering. In Emby while connected locally, also no stuttering. The issue is external users. Any channel will skip/stutter every 5 seconds for about 1 second each time. It's very frustrating and you're barely able to deal with watching the stream because the skips are so often.

This also happened before version 4.5.0.50. I have plenty of resources for transcoding and external users can play other shows just fine (whether direct play or transcoded). It's a 16 core server running on an SSD and I also have Gig Fiber, so I can't find any issues with resources/bandwidth

I think you have to find the weak link in the chain, you have an incridible setup, very fast computer with excellent internet speed.

I set up emby server at my sister place on a rasperrrypi4 with a hdhomerun duo,  I can watch live TV on the internet without any problem without transcoding and I only have a standard ADSL connection, all my client apps can direct play MPEG2.  There is no wifi involve in the communication pattern.  I have found in the past that poor wifi is often a problem.

 

Hope this help

Link to comment
Share on other sites

saltedhash

I don't have HW acceleration on and none of the devices in question are on wifi.

It does seem strange that when I'm accessing my external URL internally it still transcodes, but for regular tv shows that are local, it doesn't do that. It's possible my WAF is causing some issues...? I don't know if Live TV looks different from this perspective. I'll keep doing some troubleshooting.

Edited by saltedhash
Link to comment
Share on other sites

Depending on your router/network setup when you are on your LAN but using the remote address Emby may be seeing your WAN IP.

If you're seeing the WAN IP for internal use you'll have to add that specific IP to Network->LAN networks: settings in the web admin.
Once done, Emby will treat the WAN IP as internal and won't apply network bitrate restrictions which can cause transcoding.

Link to comment
Share on other sites

saltedhash
9 minutes ago, cayars said:

Depending on your router/network setup when you are on your LAN but using the remote address Emby may be seeing your WAN IP.

If you're seeing the WAN IP for internal use you'll have to add that specific IP to Network->LAN networks: settings in the web admin.
Once done, Emby will treat the WAN IP as internal and won't apply network bitrate restrictions which can cause transcoding.

This was just for testing purposes. I'm mainly concerned about the topic of discussion here. Still haven't figured out how to get playback to be smooth. 

Link to comment
Share on other sites

saltedhash
4 minutes ago, Luke said:

Are you still running into this?

Yep. I can't find a solution besides pausing for about 10 seconds and being 10 seconds behind live. I don't mind it, but most users don't understand the concept and just keep complaining about the stutters.

Link to comment
Share on other sites

On 9/24/2020 at 11:08 PM, saltedhash said:

I tried device set to Auto and manually set it to 720p - 1mbps. Both stuttered.

This is almost certainly going to give the same results.  Try setting that to 1080 and the highest bitrate selection the client allows.
What you want to do is try to avoid transcoding if at all possible and use the stream AS IS.  

Also if you have any bitrate restrictions turned on remove them for the test.  You want to try to avoid transcoding to see if this will help.

Link to comment
Share on other sites

SpencerXZX

Here to say that I am also having this same problem. AMD Ryzen 2600x with HW transcoding using GTX 1050 Ti. TV coming from HDHomeRun Quattro. Mine stutters every 3-5 seconds for the first 3-4 minutes of the stream, but then goes away after. It's a very strange problem, happens when connected locally over gigabit ethernet as well as remotely. Tested with Plex and there is no stuttering there. Let me know how I can help.

Edit1: I am using Emby 4.5.1

Edited by SpencerXZX
Link to comment
Share on other sites

saltedhash
On 10/3/2020 at 10:16 AM, cayars said:

This is almost certainly going to give the same results.  Try setting that to 1080 and the highest bitrate selection the client allows.
What you want to do is try to avoid transcoding if at all possible and use the stream AS IS.  

Also if you have any bitrate restrictions turned on remove them for the test.  You want to try to avoid transcoding to see if this will help.

I've tried it all. Auto, low quality and the highest quality allowable. All stutter.

I have no restrictions set. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...