Jump to content

Emby Theater jerky playback 4K video.


marriedman

Recommended Posts

1 minute ago, generiq said:

I'm fairly certain the slow rendering is the issue and not network related. libmpv with copy-back sucks! Everyone should be using gpu-next and leave hardware acceleration on auto. libmpv clashes with electron and forces mpv to use copy-back hardware acceleration. And I suspect that the display refresh rate is 60hz which adds a lot more rendering. For some reason on Linux the stats doesn't show the refresh rate (compare your stats with his). @Luke is this just an oversight that it's omitted on Linux? 

 

It's not an oversight, it just hasn't been done on linux yet. The refresh rate switching is happening in the windows version of the app using our own code. I don't think mpv has an api to handle it for us or obviously that would be a lot easier. But we just haven't added it to the linux version yet.

Link to comment
Share on other sites

rbjtech
46 minutes ago, generiq said:

I'm fairly certain the slow rendering is the issue and not network related. libmpv with copy-back sucks! Everyone should be using gpu-next and leave hardware acceleration on auto. libmpv clashes with electron and forces mpv to use copy-back hardware acceleration. And I suspect that the display refresh rate is 60hz which adds a lot more rendering. For some reason on Linux the stats doesn't show the refresh rate (compare your stats with his). @Luke is this just an oversight that it's omitted on Linux? 

 

I'm just having a play with the settings in ET - agree 100% - copy-back is using ~22% of my CPU .. GPU-next is using ~5-7%, almost idle.

I'm not getting any dropped frames with copy-back, but would obviously not want it to use my GPU if available - again, I assumed it would...

@marriedman- Are you playing with a GPU enabled system (and can enable gpu-next in the playback options) or is copy-back the only option ?

Playing a 25Mbit 4K File in ET (Windows) - gpu-next is clearly using 'more' of the GPU to decode and much less CPU.

gpu-next 

image.png.74da739825af3e34fb295b4028585d07.pngimage.png.af02e7a2f3bff863be949489d21a4d54.png

Auto (copy-back)

image.png.1b722cb850f6f85f6ae856f75e494951.pngimage.png.e756fc28fe9bdcdd77e95473392fbc52.png

Edited by rbjtech
Link to comment
Share on other sites

generiq
18 minutes ago, rbjtech said:

I'm just having a play with the settings in ET - agree 100% - copy-back is using ~22% of my CPU .. GPU-next is using ~5-7%, almost idle.

I'm not getting any dropped frames with copy-back, but would obviously not want it to use my GPU if available - again, I assumed it would...

@marriedman- Are you playing with a GPU enabled system (and can enable gpu-next in the playback options) or is copy-back the only option ?

Playing a 25Mbit 4K File in ET (Windows) - gpu-next is clearly using the GPU to decode.

gpu-next 

image.png.74da739825af3e34fb295b4028585d07.pngimage.png.af02e7a2f3bff863be949489d21a4d54.png

Auto (copy-back)

image.png.1b722cb850f6f85f6ae856f75e494951.pngimage.png.e756fc28fe9bdcdd77e95473392fbc52.png

You have a strong GPU. You won't get any dropped frames, but lesser GPUs can struggle.

copy-back, for those who don't know, is when the rendering is run through the system memory, and copied back to the GPU. So this involves using the CPU. That's why it's slower. The GPU is much faster than the CPU and system memory. So it's best to avoid that, if possible. With lesser media, it can keep up, but these days, most of us are watching 4k stuff. With that much data, a stronger GPU is meaningful. 

  • Thanks 1
Link to comment
Share on other sites

generiq
1 hour ago, Luke said:

It's not an oversight, it just hasn't been done on linux yet. The refresh rate switching is happening in the windows version of the app using our own code. I don't think mpv has an api to handle it for us or obviously that would be a lot easier. But we just haven't added it to the linux version yet.

mpv should have the option for you to pull the display refresh rate, regardless of switching. It's in their own stats, so it should be available to you.

Edited by generiq
Link to comment
Share on other sites

marriedman

I still cannot seem to get Direct Play working. I'm getting pretty confused about what is Windows specific or Linux specific or works for both.

The optional network path which would allow for my Emby Theater clients to play the file directly instead of streamed through the emby server seems to be the point that I am getting lost. I have tried smb://192.168.1.103/Public/Videos/Movies/ & smb:\\192.168.1.103\Public\Videos\Movies\ as well as without the smb: prefix. All of my emby theater clients are Linux, so I thought it would be the forward slash. I each of the linux clients also have the same path mounted so that I can manage the files with my file manager, so the user credential should be valid, right?

Is direct play an option on Linux?  Quite frankly, it's really not that important to me anymore to watch 4K. Now it's just a matter of principle.

Link to comment
Share on other sites

rbjtech
8 hours ago, marriedman said:

I still cannot seem to get Direct Play working. I'm getting pretty confused about what is Windows specific or Linux specific or works for both.

The optional network path which would allow for my Emby Theater clients to play the file directly instead of streamed through the emby server seems to be the point that I am getting lost. I have tried smb://192.168.1.103/Public/Videos/Movies/ & smb:\\192.168.1.103\Public\Videos\Movies\ as well as without the smb: prefix. All of my emby theater clients are Linux, so I thought it would be the forward slash. I each of the linux clients also have the same path mounted so that I can manage the files with my file manager, so the user credential should be valid, right?

Is direct play an option on Linux?  Quite frankly, it's really not that important to me anymore to watch 4K. Now it's just a matter of principle.

ok - so if you have LOCALLY mounted the remote share - and get to via lets say /mount/movies - then it is THIS which you need emby to pass via the 'Optional' setting.

I'm not a big Linux user, so I wasn't aware SMB was not directly available - thus trying to use SMB is not going to work - but effective Direct Play, via a MOUNT should work.   This is exactly how it works on the Shield (but that does, confusingly, work via the SMB path).

Yes user creds should be good - if your local linux os can see the SMB shares, then so should ET - we just need to get emby to pass the correct LOCAL mount point.

Try with and without the trailing slash

image.png.d63a6b1802d4f4f8dfef48a48e2b5021.png

  • Like 1
Link to comment
Share on other sites

generiq

I'm not a Linux guy, but I imagine that finding the network address is similar to Windows. In whatever file manager you use on the machine with Theater, navigate to one of your videos and try playing it directly from there. If it plays, use the address of the root directory. If it doesn't play, then you're going to have to figure out whatever network issues you have.

Edited by generiq
Link to comment
Share on other sites

SMB is available on Linux. Couple things to note:

Upper/Lower case must match perfectly.
Where you create the share matters as the format is \\Server\Share

The actual path of your media could be something like this:
/pool2/volume3/media/Movies
if you create a share named "Movies" then you would use these two formats
/pool2/volume3/media/Movies
\\Server\Movies

You will need to grant read permissions to everyone so that anonymous connections on your LAN can access the files directly.

Hope that helps,
Carlo

  • Like 1
Link to comment
Share on other sites

Q-Droid
6 hours ago, cayars said:

SMB is available on Linux.

Is an SMB client built-in to Emby Theater? 

 

Link to comment
Share on other sites

rbjtech
6 minutes ago, Q-Droid said:

Is an SMB client built-in to Emby Theater? 

 

It can directly use SMB yes (direct file access) in the Windows version certainly, not 100% on the Linux version - yet to be determined.

see - https://emby.media/community/index.php?/topic/117215-emby-theater-jerky-playback-4k-video/&do=findComment&comment=1239824

Edited by rbjtech
Link to comment
Share on other sites

Q-Droid
6 minutes ago, rbjtech said:

It can directly use SMB yes (direct file access) in the Windows version certainly, not 100% on the Linux version - yet to be determined.

see - https://emby.media/community/index.php?/topic/117215-emby-theater-jerky-playback-4k-video/&do=findComment&comment=1239824

Yeah, it's practically native in Windows but not on other platforms so for it to work it would have to be part of the application - hence my question to Carlo.

 

  • Like 1
Link to comment
Share on other sites

rbjtech
5 minutes ago, Q-Droid said:

Yeah, it's practically native in Windows but not on other platforms so for it to work it would have to be part of the application - hence my question to Carlo.

 

Gotcha.

I tried a mount point in Linux using the Linux smb tools - couldn't get that working but I think that was because the 'optional' part of my setup library was passing the SMB path, not the Mount point path.  Didn't really have time to play - but I don't *think* ET will have native SMB capability - it's gonna rely on the mount (the same way the Android/Shield version does in the AndroidTV client).

 

Edited by rbjtech
Link to comment
Share on other sites

generiq
7 hours ago, Q-Droid said:

Is an SMB client built-in to Emby Theater? 

 

mpv can handle that directly. It just needs to be written into the scripting.

Apparently it's in place. I figured it would be

 
https://emby.media/community/index.php?/topic/42868-emby-theater-for-linux/&do=findComment&comment=1241072

Edited by generiq
Link to comment
Share on other sites

marriedman

Thank you everyone who has chimed in and offered advice and tips so far. I apologize for my absence in the discussion these past couple days. But I have had some time this morning to circle back around to this finally. I had to change the mount points of my various computers or clients to be consistent. Since the Optional Path is set at the server level, all clients had to have the mount points. 

So I now have all clients mounting movies share at /mnt/Movies. I now can successfully Direct Play anything. Unfortunately, that has not solved the dropped frames and jerky playback. I must admit I thought this would solve the problem. I opened mpv player and opened the file manually and it plays fine. 

I've attached the embyserver log for today, there is no ffmpeg log. I did not truncate the log this time, so it is rather large. But I didn't want to inadvertently remove something that reveals something.

Thanks for any insights people. 

Screenshot_20230404_135007.png

embyserver 2023-04-04.txt

Link to comment
Share on other sites

rbjtech

ok - that's good news - it's now direct playing.

You should be able to see the file 'open' to the CLIENT IP on the NAS (or whatever is hosting the file)

So all that's left - then it's gotta be the emby linux client or the hardware acceleration method.  Have you tried them all ? (what options do you have ?)

Other than reporting it's playback progress - the emby server is 'out of the equation' now once playback has started - it's no different to mpv - infact it IS mpv with a wrapper ..

It can't possibly be bandwidth (not at 6Mbit/sec... ) 🙄

  • Like 1
Link to comment
Share on other sites

marriedman
9 minutes ago, rbjtech said:

So all that's left - then it's gotta be the emby linux client or the hardware acceleration method.  Have you tried them all ? (what options do you have ?)

Currently, I have Auto selected. The other options are:

  • Auto (copy back)
  • None
  • CUDA copy back
  • D3D (Windows 8+)
  • D3D copy back (Windows 8+)
  • Nvidia NVDEC copy back
  • Usnet (for mpv.conf)

I have not experimented with any of those, I don't have Windows and I don't have Nvidia hardware so I wouldn't think they were applicable.

Link to comment
Share on other sites

rbjtech
24 minutes ago, marriedman said:

Currently, I have Auto selected. The other options are:

  • Auto (copy back)
  • None
  • CUDA copy back
  • D3D (Windows 8+)
  • D3D copy back (Windows 8+)
  • Nvidia NVDEC copy back
  • Usnet (for mpv.conf)

I have not experimented with any of those, I don't have Windows and I don't have Nvidia hardware so I wouldn't think they were applicable.

Hmm - so maybe this is the core issue - hardware acceleration is poor on the Linux distro of ET ... but as mpv works ok - I don't get it.

I need to setup ET for Linux myself as I'm guessing here ... 

@generiqmight be able to advise ?

Link to comment
Share on other sites

marriedman

Success! I just tested to verify on two different 4K files and I now have buttery smooth playback and lightning quick chapter selection. The last thing I did was select CUDA copy back. Now, I do not know if that would have solved the problem initially, but all of the steps up to this point I do believe were worthwhile. 

I shall recap what I have done and mark this post as the solution. @rbjtech@GrimReaper@Happy2Play@generiq@Q-DroidThank you for each of your insights and tips. I am sure this will be helpful for anyone has a similar issue as I had:

  • text based subtitles such as SRT reduce your chances of needing transcoding.
  • Video outpu is set to gpu-next
  • Hardware acceleration mode is set to CUDA copy back
  • Optional Path is set to the SMB share mounted path and not an IP address.

So I while I will be marking this post as the solution, I honestly want to thank the people above for their input and assistance for solving this problem.

  • Like 1
Link to comment
Share on other sites

rbjtech

First of all - good news ! yay !

Hopefully @cayarscan add this into a Linux Specific knowledgebase.

But still very odd as CUDA is Nvidia ... maybe mpv is adding some better default here... 🤔

  • Like 1
Link to comment
Share on other sites

generiq

@marriedman you still haven't tried what I told you to do. Change video output to gpu-next and use hardware acceleration on auto

Edit: I see that you did use gpu-next. What happens with hardware acceleration on auto? Stats screen shot?

Edited by generiq
Link to comment
Share on other sites

generiq
2 hours ago, rbjtech said:

First of all - good news ! yay !

Hopefully @cayarscan add this into a Linux Specific knowledgebase.

But still very odd as CUDA is Nvidia ... maybe mpv is adding some better default here... 🤔

No, it might be using vulkan. On Linux this is fine, but I still recommend switching to gpu-next and using auto for hardware acceleration.

Link to comment
Share on other sites

marriedman
14 hours ago, generiq said:

What happens with hardware acceleration on auto? Stats screen shot?

@generiq I previously had it set to gpu-next & auto for hardware acceleration. Attached is the stats for nerds shot.

I also went ahead and tried Unset (for mpv.conf) and that also works for smooth playback. libmpv video output and Unset hardware acceleration works well too. I did not bother with the Windows related settings. 

 

Screenshot_20230405_085949.png

Link to comment
Share on other sites

generiq
2 hours ago, marriedman said:

@generiq I previously had it set to gpu-next & auto for hardware acceleration. Attached is the stats for nerds shot.

I also went ahead and tried Unset (for mpv.conf) and that also works for smooth playback. libmpv video output and Unset hardware acceleration works well too. I did not bother with the Windows related settings. 

 

Screenshot_20230405_085949.png

That's not using gpu-next. And from what you're describing, you get smooth playback when software decoding.

Link to comment
Share on other sites

generiq

Please only try what I request. You're providing misinformation. mpv is not doing what you think it's doing.

Link to comment
Share on other sites

marriedman

I had no intention of misinforming anyone, so apologies for that. Here is the screenshots showing your request. Immediately upon playing it starts dropping frames. I let it go for about a minute or two to let the frame count climb.

01.png

02.png

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...