Jump to content

Emby Freeze & out of sync on video playback!!


electricwildflower

Recommended Posts

electricwildflower

Good morning everyone

I have an issue with my Emby server and playback on most my devices. When ever i open Emby and attempt to play Movies, TV Episodes, Documentaries or just about anything video related, some times i can watch it perfectly fine but for the majority of the time some way through the video watching (happens randomly) the video will freeze for a few seconds whilst the audio is still going and then the audio stops and then the video continues on with the audio repeating what ever it played just after the video froze but the audio/video is now out of sync by about 5/10 seconds enough it's unwatchable. 

The majority of the time i have to stop the Emby server and start it back up to fix the issue, it all depends but sometimes it fixes it and i can continue with the watching and other times give it a while and it freezes again and again out of sync and a restart is needed to sort it.

This happens regardless of device, I have no idea what the issue is, how to fix it. Are there any fixes i can do to solve it?

My information

Server - Truenas Scale Dragonfish-24.04.0
Emby Server - Version 4.8.6.0

Below are some of the logs included, if you need any more info i'll provide it. 

Thanks

ffmpeg-transcode-eb210f1b-6440-46f1-9061-16a327e0323e_1.txt embyserver.txt

Link to comment
Share on other sites

Lessaj

It looks like the transcode is keeping up, but it's barely doing so as it's barely over 1x. It's purely software encoding as no hardware encoder was detected. Is this server within your local network or remote? It says the reasons for transcode is due to bitrate limits but if this is in your local network you shouldn't need to do that. Though I can see the file you played has PGS subs and I have no idea if Roku supports them so it may end up forcing a transcode anyway.

ContainerBitrateExceedsLimit

 

Link to comment
Share on other sites

electricwildflower

It's a local network on my Truenas server all connected to a Netgear D7000 and the Roku TV is connected to the router via ethernet, the TV is literally 3 feet from the server rack lol. Is there some kind of setting i need to change or anything to get it to play ball properly?

Link to comment
Share on other sites

Lessaj

It looks like it's on a different subnet from the server so you may want to specify both subnets on the Network tab under LAN Networks. At least that's what I'm gathering from the server log, if this is running in a container you may want to enable Host network instead which will then have it appear in the same subnet and may not enforce any bitrate limitations when using Auto.

192.168.0.0/24, 172.16.0.0/24

 

Link to comment
Share on other sites

electricwildflower

I may have solved it but i'll soon find out after watching an episode or two

On my Truenas server under networking and default routes i had set default IPV4 route as 192.168.0.2 when the Netgear router is 192.168.0.1, i had forgot to set it back after i was playing with a cisco box installed with PfSense as my default router which got the 168.0.2 IP so i'll see if that solves it and give a shout back with the outcome. Unless that's totally unrelated to my issue? 

Cheers

Link to comment
Share on other sites

Lessaj

I think that is unrelated but certainly check either in the video player or on your server dashboard if what you're playing is being transcoded or not, and what the reason for the transcode is. It doesn't seem like your hardware has a good time at trying to keep up with transcoding so you want to avoid that if possible. I think it's not treating 192.168.0.0/24 as a local network so "auto" is picking a lower bitrate than it should. This feature needs improvement on how it determines what it should be set to. The help text under LAN networks indicates that it should treat this subnet as local but it doesn't hurt to specify it.

Link to comment
Share on other sites

electricwildflower

Here is a screenshot of an episode playing on the dashboard, and one of both transcoding and network. My current hardware specs of the Truenas server are. 

Motherboard - MSI 990FXA GAMING Socket AM3+ motherboard
Processor - AMD FX 8350 8 core processor
Ram - DDR3 32GB
Graphics Card - Radeon RX 580
Power Supply - 1000 Watt
OS - Truenas Scale Bluefin latest version

Ethernet - Onboard

Emby is installed from the Truecharts repository by just opening up apps on Truenas Scale, searching for Emby and installing the Truecharts version adding the relevant info for media shares etc.

Most video's that i have played where working fine till i got this new Roku TV and then had to upgrade some of the Movies & TV series to better qualities. The problem started about a week or 2 ago or more. Hopefully it's just a network issue that i'll resolve. 

Screenshot from 2024-05-09 20-13-16.png

Screenshot from 2024-05-09 20-28-52.png

Screenshot from 2024-05-09 20-29-15.png

Link to comment
Share on other sites

Lessaj

Yes it's transcoding because of a quality setting, I think it pretty much defaults to 4 Mbps on auto. I'd recommend either manually setting a higher quality or see if putting 192.168.0.0/24 in the LAN networks field and probably restart the client app if that works to play at full quality and hopefully also doesn't transcode.

It's not using your RX 580 at all.

  • Agree 1
Link to comment
Share on other sites

Happy2Play

Yes I would adjust the client playback quaility setting as for some reason you are hitting the 4Mbps limit.  And per the first log no HWA is not being used only software and only processing just above framerate.

http://host1:8096/emby/Items/558384/PlaybackInfo?UserId={userid}&isplayback=false&maxstreamingbitrate=4000002

But per the log one can not say whether local or remote anymore.   But will guess since "IsInLocalNetwork: False" is not displayed this local.

2024-05-09 11:15:50.290 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 5520568, max bitrate: 4000002
2024-05-09 11:15:50.290 Info App: Bitrate exceeds DirectStream limit: media bitrate: 5520568, max bitrate: 4000002
2024-05-09 11:15:50.298 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 5520568, max bitrate: 4000002
2024-05-09 11:15:50.298 Info App: Bitrate exceeds DirectStream limit: media bitrate: 5520568, max bitrate: 4000002
2024-05-09 11:15:50.300 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 5520568, max bitrate: 4000002
2024-05-09 11:15:50.300 Info App: Bitrate exceeds DirectStream limit: media bitrate: 5520568, max bitrate: 4000002

But yes applying lan networks may help also as server is detected on 172 network but connection are 192.

 

Link to comment
Share on other sites

Posted (edited)

@electricwildflowerYour problem appears related to the speed your system can perform transcoding.

 

Spoiler

17:11:39.055 elapsed=00:00:01.14 frame=    1 fps=0.9 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A throttle=off speed=   0x    
17:11:39.457 elapsed=00:00:01.64 frame=   19 fps= 12 q=0.0 size=N/A time=00:00:00.72 bitrate=N/A throttle=off speed=0.441x    
17:11:39.963 elapsed=00:00:02.16 frame=   32 fps= 15 q=28.0 size=N/A time=00:00:01.23 bitrate=N/A throttle=off speed=0.571x    
17:11:40.480 elapsed=00:00:02.68 frame=   47 fps= 17 q=28.0 size=N/A time=00:00:01.92 bitrate=N/A throttle=off speed=0.714x    
17:11:40.993 elapsed=00:00:03.19 frame=   64 fps= 20 q=28.0 size=N/A time=00:00:02.51 bitrate=N/A throttle=off speed=0.788x    
17:11:41.530 elapsed=00:00:03.73 frame=   79 fps= 21 q=28.0 size=N/A time=00:00:03.20 bitrate=N/A throttle=off speed=0.856x    
17:11:42.117 elapsed=00:00:04.30 frame=   94 fps= 22 q=28.0 size=N/A time=00:00:04.05 bitrate=N/A throttle=off speed=0.941x    
17:11:42.280 [segment @ 0x107f440] Opening '/config/transcoding-temp/1F0B8B/1F0B8B.m3u8.tmp' for writing
17:11:42.281 SegmentComplete=video:0 Index=606 Start=0.000000 End=1821.027500 Duration=1821.027500 offset_pts=0 start_pts=0 Frames=72 filename=1F0B8B_606.ts
17:11:42.282 [segment @ 0x107f440] Opening '/config/transcoding-temp/1F0B8B/1F0B8B_607.ts.tmp' for writing
17:11:42.682 elapsed=00:00:04.89 frame=  110 fps= 22 q=28.0 size=N/A time=00:00:04.39 bitrate=N/A throttle=off speed=0.898x    
17:11:43.231 elapsed=00:00:05.43 frame=  126 fps= 23 q=28.0 size=N/A time=00:00:05.24 bitrate=N/A throttle=off speed=0.965x    
17:11:43.759 elapsed=00:00:05.96 frame=  142 fps= 24 q=28.0 size=N/A time=00:00:05.76 bitrate=N/A throttle=off speed=0.965x    
17:11:44.302 elapsed=00:00:06.50 frame=  158 fps= 24 q=28.0 size=N/A time=00:00:06.57 bitrate=N/A throttle=off speed=1.01x    
17:11:44.761 [segment @ 0x107f440] Opening '/config/transcoding-temp/1F0B8B/1F0B8B.m3u8.tmp' for writing
17:11:44.762 SegmentComplete=video:0 Index=607 Start=1821.027489 End=1824.030500 Duration=3.003011 offset_pts=0 start_pts=1821027489 Frames=72 filename=1F0B8B_607.ts
17:11:44.762 [segment @ 0x107f440] Opening '/config/transcoding-temp/1F0B8B/1F0B8B_608.ts.tmp' for writing
17:11:44.880 elapsed=00:00:07.09 frame=  173 fps= 24 q=28.0 size=N/A time=00:00:07.10 bitrate=N/A throttle=off speed=   1x    
17:11:45.467 elapsed=00:00:07.68 frame=  189 fps= 25 q=28.0 size=N/A time=00:00:07.78 bitrate=N/A throttle=off speed=1.01x    
17:11:46.029 elapsed=00:00:08.22 frame=  206 fps= 25 q=28.0 size=N/A time=00:00:08.44 bitrate=N/A throttle=off speed=1.03x    
17:11:46.584 elapsed=00:00:08.80 frame=  221 fps= 25 q=28.0 size=N/A time=00:00:09.15 bitrate=N/A throttle=off speed=1.04x   

 

It is the speed of the transcoding. Like mentioned above it is only using the CPU and the throttle is off. It is able to keep up in real time to the frame rate almost. You can see at the start it is not keeping up. You have a delay before playback can begin at a watchable framerate. Then it is so close to being under that is must be causing underruns and then buffering to get the next packet. Because your CPU is almost able to keep up this appear like you said. They are weird breaks in the playback and then because it was an underrun the timestamps are no longer aligned. It will rewind back to the last keyframe and being playback at that point. The audio unfortunately doesn't rewind. This is how you wind up with that audio drift. If you can get hardware transcoding to work for decoding HEVC and encoding H264 that might make you fast enough for transcoding to work in real time. But as it is you are not fast enough to transcode this in real time. You can do as Happy2Play suggests. Choose a video quality bitrate rather than using Auto if you are on the Local network. Using Auto is best for remote users. Choosing the highest bitrate you want for direct play is best when on the local network.

image.png.22562cce56cdc9954c6c1d0320541801.png

You can see the green playback progress is toe to toe with the red transcoding progress. Usually that red line is far ahead of the green line.

Edited by speechles
Link to comment
Share on other sites

electricwildflower

I have added the 192.168.0.0/24 to the lan networks and played an episode and no change. Where do i change the bit rate for the local network? and what would be the ideal number? 

Thanks everyone

Link to comment
Share on other sites

Lessaj

Did you restart the client app as well? I don't know if the server needs a recycle to properly apply it as well, it shouldn't but I've seen the client "remember" the setting even after changing it. Otherwise from App Settings -> Playback set Home ntework quality to the highest option 4K 160 Mbps.

Link to comment
Share on other sites

electricwildflower

Good afternoon

I believe i fixed the issue, jumped onto Emby on Roku TV and checked the playback setting and for some reason it was on 1080P FHD - 4Mbps but once i switched it to 2160P 4K(UHD) - 110 Mbps i played 2 episodes of breaking bad and so far no issues have showed up. 

  • Like 1
  • Thanks 2
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...