Comments (23)
I'm not sure how JF determines the client's network. Someone else might be able to fill in for that. The client's type will be parsed; based on this information. StreamBuilder will determine the type of playback. S.B. will consider certain things such as bitrate limit and so on. I'll see what I can do to make a more complete map
from jellyfin-docs.
The FFmpeg commands are here: https://github.com/jellyfin/jellyfin/blob/8ff07e17e6f58a1102b9d8c36a995dec4dc2f041/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
from jellyfin-docs.
Local network detection is pretty rudimentary. Look at the section starting at line 110:
https://github.com/jellyfin/jellyfin/blob/master/Emby.Server.Implementations/Networking/NetworkManager.cs#L110-L156
from jellyfin-docs.
There’s also an endpoint in the server that’s used to generate random data of a requested size, which is used to calculate connection speed, which factors in to the transcode bitrate calculation. If the speed is high enough to support almost anything, then client considerations come in to play (e.g. Chromecast is set to a max of 10 Mbps as part of a first gen limitation)
from jellyfin-docs.
Web Interface playback support is determined with BrowserDeviceProfile:
jellyfin/jellyfin-web#703
Other clients are expected to know what they support and can use the data endpoint to do a connection speed test. After that, the client is expected to make a request listing its capabilities and desired bitrate. Of course if the media codecs and player support match up, direct play/stream will happen.
from jellyfin-docs.
DLNA clients have profiles in the server code, which is used to list their capabilities. The server gets the “product name” when a DLNA request comes in, and then matches it with a profile to know what to send back. The server already includes a bunch of popular ones, but it can always be customized by the end user.
from jellyfin-docs.
Local network detection is pretty rudimentary. Look at the section starting at line 110:
https://github.com/jellyfin/jellyfin/blob/master/Emby.Server.Implementations/Networking/NetworkManager.cs#L110-L156
Should this go before L110?
https://github.com/jellyfin/jellyfin/blob/a3615dec693ce8f9b0a803d98e9ba0b1f32f62a7/Emby.Server.Implementations/Networking/NetworkManager.cs#L158-L178
Not sure what the difference in between public bool IsInPrivateAddressSpaceAndLocalSubnet(string endpoint)
and if (checkSubnets && IsInPrivateAddressSpaceAndLocalSubnet(endpoint))
for the variable endpoint. But to me, it looks like L150 might return false since the value of L158 hasn't run yet. Or does it not matter?
DLNA clients have profiles in the server code, which is used to list their capabilities. The server gets the “product name” when a DLNA request comes in, and then matches it with a profile to know what to send back. The server already includes a bunch of popular ones, but it can always be customized by the end user.
I believe @PrplHaz4 once showed me a url that has a generic list of DLNA profiles. We could do a review and add additional clients based on the list.
I want to say these are the DLNA profiles currently available. I'm not sure how Jellyfin Clients report their playback compatibility though.
https://github.com/jellyfin/jellyfin/tree/master/Emby.Dlna/Profiles
Extra DLNA Notes:
https://github.com/rivarolle/plex-dlna-profiles
uPnP anyone? Haha
https://openconnectivity.org/certification/upnp-certification/
from jellyfin-docs.
So speed detection happens at this endpoint:
The actual code for it is here:
https://github.com/jellyfin/jellyfin/blob/b3811a9498fe06b68693f4a269de902cdd7eb2a2/MediaBrowser.Api/Playback/MediaInfoService.cs#L106-L132
Recently fixed for a good reason: jellyfin/jellyfin#2167
To see where it is used in clients:
https://github.com/search?q=org%3Ajellyfin+bitratetest&type=Code
from jellyfin-docs.
Totally didn't know github supported code search, I've just been using grep -inr this entire time haha.
I'm gonna try and break down StreamBuilder
Server request client information
https://github.com/jellyfin/jellyfin/blob/b3811a9498fe06b68693f4a269de902cdd7eb2a2/MediaBrowser.Api/Playback/MediaInfoService.cs#L192-L253
Server determining Streaming Logic.
https://github.com/jellyfin/jellyfin/blob/b3811a9498fe06b68693f4a269de902cdd7eb2a2/MediaBrowser.Api/Playback/MediaInfoService.cs#L319-L415
First determine Direct Play
https://github.com/jellyfin/jellyfin/blob/b3811a9498fe06b68693f4a269de902cdd7eb2a2/MediaBrowser.Api/Playback/MediaInfoService.cs#L417-L463
Local or Remote Check
https://github.com/jellyfin/jellyfin/blob/b3811a9498fe06b68693f4a269de902cdd7eb2a2/MediaBrowser.Api/Playback/MediaInfoService.cs#L548-L570
Not really sure how to read the rest of it.
So I want to add a wrapper around the streambuilder to do a logic check where if the current type of mode fails for whatever reason, it'll go to the next level.
Direct Play > Direct Stream > Transcode (If HWA was used, then try Software, if Software fails, either exit or play stream without failed codec). I think it would need to go between L415 and end around L535?
from jellyfin-docs.
If a container has an invalid video codec, we could provide better error handling
from jellyfin-docs.
This looks interesting. Looks like this is where FFmpeg beings and exits. We might be able to catch it here to reattempt.
from jellyfin-docs.
https://github.com/jellyfin/jellyfin/blob/1ae9ed6e2aefb323f9959f9ed7a0c7950dd630c6/MediaBrowser.Api/Playback/BaseStreamingService.cs#L675-L845
Input of State Builder for StreamBuilder.
specifically, this reads the properties of the video codec.
https://github.com/jellyfin/jellyfin/blob/1ae9ed6e2aefb323f9959f9ed7a0c7950dd630c6/MediaBrowser.Api/Playback/BaseStreamingService.cs#L807-L832
Output of State Builder
https://github.com/jellyfin/jellyfin/blob/1ae9ed6e2aefb323f9959f9ed7a0c7950dd630c6/MediaBrowser.Api/Playback/BaseStreamingService.cs#L847-L930
DLNA stuff for State Builder
https://github.com/jellyfin/jellyfin/blob/1ae9ed6e2aefb323f9959f9ed7a0c7950dd630c6/MediaBrowser.Api/Playback/BaseStreamingService.cs#L939-L1017
from jellyfin-docs.
jellyfin/jellyfin#2390 (comment)
This shows how ffmpeg is built in the end with HWA. My bottom link is the holy grail as to how ffmpeg works.
from jellyfin-docs.
https://github.com/jellyfin/jellyfin/blob/master/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
This is where the various flags are decided for ffmpeg.
from jellyfin-docs.
This is the logic to burn in dvdsubs
from jellyfin-docs.
This is where logic checks to see if it's a video or audio request.
This is also where we can disable video for carplay.
from jellyfin-docs.
This is where hardware decoding begins.
from jellyfin-docs.
Hls segment swap
jellyfin/jellyfin#1802
Keyframe sync support for exoplayer
google/ExoPlayer#2882
from jellyfin-docs.
https://github.com/jellyfin/jellyfin/pull/2251/files
PR showing how HWA encoding was updated for AMF
from jellyfin-docs.
HLS casting to chromecast
google/ExoPlayer#6482
from jellyfin-docs.
intel/intel-vaapi-driver#238
VC-1 support in Linux issue ticket
from jellyfin-docs.
Chromecast doesn't support ac3 and currently defaults to ac3. This code says to do aac, what's up?
from jellyfin-docs.
HLS segment muxer
from jellyfin-docs.
Related Issues (20)
- Chromecast - Nginx Content Security Policy HOT 5
- Missing information about Shows specials
- Podman install instructions are incorrect HOT 1
- Nginx HTTP 2.0 issues
- Undocumented Movie folders
- Error Protocol In Nginx Default Http Conf HOT 1
- codec support page needs updating to support new changes?
- Documentation for Installing on Synology
- Audio books file extensions and naming
- Native web server certificate generation instructions HOT 1
- Traefik v2 variables are deprecated
- [Issue]: group_add doesn't support integer in Compose v2 HOT 4
- Addon vs Add-on inconsistency HOT 1
- Add AAAA (IPv6) records for jellyfin.org HOT 1
- group_add not available in compose v3
- Video compatibility for Android needs updating
- Current service file for generic tarball install is not working HOT 1
- Getting help is no help HOT 1
- Asustor, Not finding it in app central HOT 1
- NVENC Encoding on GPU and Decoding on CPU
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jellyfin-docs.