cochize1 42 Posted September 14, 2023 Share Posted September 14, 2023 (edited) I didn't pay much of an attention to that but lately I started playing with Grafana for some stats and it caught my eye that my Emby configuration never direct plays and almost always direct streams. I don't have any 4K content, most are 1080p or 720p x264 (just lately I started adding x265 since more browsers now support this). I have around 15 friends connecting remotely and some members of family on local network over wi-fi using mostly Android TV app. My internet is 750/40 Mb and most of my remote access users has fairly good as well (def over 60 Mbps). My server configuration is: Emby on Synology NAS (standalone app, not in docker), port changed from 8096 to 8099 and build-in Synology NGINX reverse proxy for https remote access. I attached logs trying to play 2 simple 720p files on Chrome browser, Android TV app and Emby for Android app, they all Direct Stream where they should Direct Play. My friend was playing a HEVC file on Chromcast while the logs were taken and that was transcoding but that is for another topic) I also checked if that might be some proxy issue but checked on local address in Chrome Browser http://192.168.0.10:8099 also Direct Streams. Would love to convert all that streaming to direct playing, any ideas on how to pinpoint what is the issue here? ffmpeg-transcode-3d9a7ee4-5e27-46b0-bfbf-cf6d5e7c023c_1.txt embyserver.txt Edited September 14, 2023 by cochize1 Link to comment Share on other sites More sharing options...
sross44 248 Posted September 14, 2023 Share Posted September 14, 2023 1 hour ago, cochize1 said: I didn't pay much of an attention to that but lately I started playing with Grafana for some stats and it caught my eye that my Emby configuration never direct plays and almost always direct streams. I don't have any 4K content, most are 1080p or 720p x264 (just lately I started adding x265 since more browsers now support this). I have around 15 friends connecting remotely and some members of family on local network over wi-fi using mostly Android TV app. My internet is 750/40 Mb and most of my remote access users has fairly good as well (def over 60 Mbps). My server configuration is: Emby on Synology NAS (standalone app, not in docker), port changed from 8096 to 8099 and build-in Synology NGINX reverse proxy for https remote access. I attached logs trying to play 2 simple 720p files on Chrome browser, Android TV app and Emby for Android app, they all Direct Stream where they should Direct Play. My friend was playing a HEVC file on Chromcast while the logs were taken and that was transcoding but that is for another topic) I also checked if that might be some proxy issue but checked on local address in Chrome Browser http://192.168.0.10:8099 also Direct Streams. Would love to convert all that streaming to direct playing, any ideas on how to pinpoint what is the issue here? ffmpeg-transcode-3d9a7ee4-5e27-46b0-bfbf-cf6d5e7c023c_1.txt 764 kB · 1 download embyserver.txt 1.43 MB · 1 download There’s not much of a difference between direct play and direct stream. Somebody smarter than me can correct if I’m wrong but it is probably just putting it in to a container that it can play on your client instead of transcoding the whole video. Just my quick observation but direct stream is pretty good to go! Link to comment Share on other sites More sharing options...
cochize1 42 Posted September 14, 2023 Author Share Posted September 14, 2023 Yeah, I know that is why I didn't bother with that for a long time. Yet again, I hate noy knowing things and leaving them undone. From what I am reading now it might be also an issue of Synology access and permissions. But first I will try to play sth from Windows Emby Theater that supposedly does not need direct access to files to Direct Play. Then, I will try to mount the share paths and "make sure the network share is accessible anonymously" as @Luke mentioned in other post over 5 years ago. But if anyone has any suggestions please chip in. Link to comment Share on other sites More sharing options...
rodainas 188 Posted September 14, 2023 Share Posted September 14, 2023 2 hours ago, cochize1 said: I didn't pay much of an attention to that but lately I started playing with Grafana for some stats and it caught my eye that my Emby configuration never direct plays and almost always direct streams. I don't have any 4K content, most are 1080p or 720p x264 (just lately I started adding x265 since more browsers now support this). I have around 15 friends connecting remotely and some members of family on local network over wi-fi using mostly Android TV app. My internet is 750/40 Mb and most of my remote access users has fairly good as well (def over 60 Mbps). My server configuration is: Emby on Synology NAS (standalone app, not in docker), port changed from 8096 to 8099 and build-in Synology NGINX reverse proxy for https remote access. I attached logs trying to play 2 simple 720p files on Chrome browser, Android TV app and Emby for Android app, they all Direct Stream where they should Direct Play. My friend was playing a HEVC file on Chromcast while the logs were taken and that was transcoding but that is for another topic) I also checked if that might be some proxy issue but checked on local address in Chrome Browser http://192.168.0.10:8099 also Direct Streams. Would love to convert all that streaming to direct playing, any ideas on how to pinpoint what is the issue here? ffmpeg-transcode-3d9a7ee4-5e27-46b0-bfbf-cf6d5e7c023c_1.txt 764 kB · 3 downloads embyserver.txt 1.43 MB · 2 downloads You attached the transcode log, you need to attach the directstream log. Link to comment Share on other sites More sharing options...
cochize1 42 Posted September 14, 2023 Author Share Posted September 14, 2023 My bad, file attached. Although the latest is from this morning when I believe my buddy tried to watch Gam of Thrones episode on Firefox. None other log file with ffmpeg directstream was created since then. NOTE: Meanwhile I managed to mount the optional share points to my libraries and voila, they all Direct Play but only in Emby Theater. I also tested in Emby for Android and Android TV app but they still Direct Stream. I am sure that it has an effect because as soon as I remove the path it reverts to Direct Stream on Theater as well. My question now: is it possible to Direct Play only on Theater and if so will it Direct Play remotely as well? If other apps can Direct Play, how to make that easier for them? ffmpeg-directstream-db11ef5a-bcf0-4705-8b74-9836ba0ce3c2_1.txt Link to comment Share on other sites More sharing options...
rbjtech 4333 Posted September 14, 2023 Share Posted September 14, 2023 All files should Direct Play unless there is a need to alter either the container or audio (in most cases), if it has to change the video, then it's called a transcode. The reason Theatre Direct Plays, is likely because it's sourcing the file over SMB - only Theatre does this, AndroidTV used to do this but no longer does. All my streams, incl remote all Direct Play - so maybe something is wrong with your reverse proxy config ? Is the config based on the NGINX thread from this forum ? Link to comment Share on other sites More sharing options...
cochize1 42 Posted September 14, 2023 Author Share Posted September 14, 2023 No, seemed to difficult for me at the time. I was affriad it might come to this that I will have to do this someday but I was too affraid I will cut off all my remote users since I have only bacis network skills. I guess your suggestions will be to set this up with external NGNIX Proxy Manager i.e. in docker and not use the native Synology built-in one because it has limited options? Mine set up is the simplest of them all (file attached) but it works and gives me Let's Encrypt certificate for https access: Link to comment Share on other sites More sharing options...
cochize1 42 Posted September 14, 2023 Author Share Posted September 14, 2023 In the meantime I found this in other thread by @Carlo: Quote There is no reverse proxy built into Emby. There is just a setting that tells Emby if you are using a reverse proxy or not. This changes the way Emby works for certain things such as IP addresses. With the reverse proxy setting Emby know to look into the header for a special header the proxy writes telling us the real IP as this becomes the Proxy's job. It allows Emby to answer on non-secured ports as well because the reverse proxy is going to be responsible for this. Things like that. The reverse proxy needs to be configured to do these things Emby is going to expect. That's the problem as Synology doesn't give you the needed control for this kind of basic configuration. You also can't configure port usage or use of web services, etc... So knowing these limitations and issues it's best to avoid use Synology's proxy by using ports it won't touch. You could also setup a 2nd proxy to run on Synology that you have manual control over and use that with Emby but you still won't be able to use any ports the built in proxy listens to. It's really difficult to impossible to use the 2nd proxy for automatic cert renewal as the built in proxy hijacks this process. Because of all these issues if you aren't experienced with Linux and know how to work around the issues it's best to KISS and keep it simple excluding the proxy completely using different ports and setting up the cert as normal directly in Emby. Hope that makes sense. Link to comment Share on other sites More sharing options...
rbjtech 4333 Posted September 14, 2023 Share Posted September 14, 2023 You may be able to just add them in the Custom Header or possibly advanced options ? Try adding Range $http_range If-Range $http_if_range 1 Link to comment Share on other sites More sharing options...
rbjtech 4333 Posted September 14, 2023 Share Posted September 14, 2023 3 minutes ago, cochize1 said: In the meantime I found this in other thread by @Carlo: I don't use synology, I use a dedicated nginx host on linux - so I'm not sure if the synology proxy is actually nginx, but it 'looks' to be similiar if those headers are anything to go by ... Link to comment Share on other sites More sharing options...
rbjtech 4333 Posted September 14, 2023 Share Posted September 14, 2023 ..and as has been said above - direct streaming is no big deal - it's fractionally more taxing than Direct Play, but no video quality is being lost. It's possible audio may be converted to another format. It's transcoding (video) that hits any system hard.. Link to comment Share on other sites More sharing options...
cochize1 42 Posted September 14, 2023 Author Share Posted September 14, 2023 Was really hoping that would be that easy, but still Direct Stream on both Android apps with the headers added like attached. Maybe there are some more to add that would help? PS. I know that about Transcoding is the main concer, it just bugs me and my OCD kicks in when I can't make sth work that is technically possible... somehow Link to comment Share on other sites More sharing options...
GrimReaper 3330 Posted September 14, 2023 Share Posted September 14, 2023 (edited) Are you actually checking within Emby Dashboard that items are DirectStreaming or relying only on your Grafana stats? If theye were, there would be ffmpeg-remux logs created for each session. And I've often seen same happening when using external tool - Playback Reporting plugin - reporting DirectStream when the item is DirectPlayed and surmised it must've been doing interpreting even DirectPlay over http as DirectStream in some circumstances. Speaking of, have just one like that currently: Edited September 14, 2023 by GrimReaper 2 Link to comment Share on other sites More sharing options...
jaycedk 399 Posted September 14, 2023 Share Posted September 14, 2023 I think that the Emby exporter is reporting it wrong. 1 Link to comment Share on other sites More sharing options...
cochize1 42 Posted September 14, 2023 Author Share Posted September 14, 2023 Wow, you guys are right. I just didn't translate that in my head as I had my Dashboard translated to Polish so I was just relying on Grafna. So all that hassle for nothing:) Now I need to check if mounting that optional paths did something. Thank you all for all the answers. @jaycedkwill you be reporting that issue to Emby Exporter creator by any chance like you did last time? Link to comment Share on other sites More sharing options...
jaycedk 399 Posted September 14, 2023 Share Posted September 14, 2023 @cochize1I have just edited the properties in grafana to reflect the error. I have changed current Streams and Playback Method with some overrides. Current Streams Playback Methode Link to comment Share on other sites More sharing options...
cochize1 42 Posted September 14, 2023 Author Share Posted September 14, 2023 But are you sure it's that exporter just swaps Direct Play and Direct Stream and not maybe add up both? Link to comment Share on other sites More sharing options...
jaycedk 399 Posted September 14, 2023 Share Posted September 14, 2023 Nope Here is the github TOomaAh/emby_exporter_go (github.com) 1 Link to comment Share on other sites More sharing options...
cochize1 42 Posted September 14, 2023 Author Share Posted September 14, 2023 @jaycedk@GrimReaper One thing makes me wonder, when in Emby Theater it was showing correctly in Grafana that it is Direct Play so in fact there is some way exporter diferenciate the play method. Link to comment Share on other sites More sharing options...
jaycedk 399 Posted September 14, 2023 Share Posted September 14, 2023 (edited) Well we can't answer that. Only dev of "emby exporter" can answer that, open a issue at https://github.com/TOomaAh/emby_exporter_go Edited September 14, 2023 by jaycedk Spelling Link to comment Share on other sites More sharing options...
Carlo 4331 Posted September 14, 2023 Share Posted September 14, 2023 5 minutes ago, cochize1 said: @jaycedk@GrimReaper One thing makes me wonder, when in Emby Theater it was showing correctly in Grafana that it is Direct Play so in fact there is some way exporter diferenciate the play method. I'm assuming No, but just thought I'd ask. When this file was played in Theater was there any log file created for it's playback on the server? Link to comment Share on other sites More sharing options...
cochize1 42 Posted September 14, 2023 Author Share Posted September 14, 2023 I believe not, just the regular embyserver log around that time I think Link to comment Share on other sites More sharing options...
Carlo 4331 Posted September 14, 2023 Share Posted September 14, 2023 Perfect, that would indicate it was a direct play and not a Direct Stream as the Direct Stream would have created a "remux" log file. 1 Link to comment Share on other sites More sharing options...
rbjtech 4333 Posted September 14, 2023 Share Posted September 14, 2023 (edited) So to answer the question about Theatre - if you have the optional path set - AND you have a SMB connection/permissions etc - then Emby will Direct Play the file for REAL via SMB. It bypasses the emby server full stop for the media transfer. An older version of AndroidTV also allowed this, but sadly this has been removed with the newer Android OS version and the Emby Client has broken it even with the older Android OS as of a few beta's ago ... The only client left that uses real Direct Play (the same as what VLC, Kodi etc use) is Emby Theatre for Windows (not the store version) and possibly Emby Theatre for Unix (but unlikely to be SMB, maybe NFS ?) When working correctly - it will say 'FILE' in the stats for nerds - or you can see it in the file server OS as a direct connection from the CLIENT, not the emby SERVER. Edited September 14, 2023 by rbjtech 1 1 Link to comment Share on other sites More sharing options...
Carlo 4331 Posted September 14, 2023 Share Posted September 14, 2023 This was always a favorite method of playback for me onlan, as it saves the server from doing any streaming and the client can access the file directly eliminating any latency or lag. It also allowed the admin to restart the server without a direct file play client knowing the server was bounced. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now