-
Notifications
You must be signed in to change notification settings - Fork 220
[Request] Document Playback Flow #202
Comments
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 |
Local network detection is pretty rudimentary. Look at the section starting at line 110: |
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) |
Web Interface playback support is determined with BrowserDeviceProfile: 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. |
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. |
Should this go before L110?
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: uPnP anyone? Haha |
So speed detection happens at this endpoint: The actual code for it is here: Recently fixed for a good reason: jellyfin/jellyfin#2167 To see where it is used in clients: |
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 Server determining Streaming Logic. First determine Direct Play Local or Remote Check 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? |
If a container has an invalid video codec, we could provide better error handling |
This looks interesting. Looks like this is where FFmpeg beings and exits. We might be able to catch it here to reattempt. |
https://github.com/jellyfin/jellyfin/blob/1ae9ed6e2aefb323f9959f9ed7a0c7950dd630c6/MediaBrowser.Api/Playback/BaseStreamingService.cs#L675-L845 specifically, this reads the properties of the video codec. Output of State Builder DLNA stuff for State Builder |
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. |
https://github.com/jellyfin/jellyfin/blob/master/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs |
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. |
This is where hardware decoding begins. |
Hls segment swap Keyframe sync support for exoplayer |
https://github.com/jellyfin/jellyfin/pull/2251/files |
HLS casting to chromecast |
intel/intel-vaapi-driver#238 |
Chromecast doesn't support ac3 and currently defaults to ac3. This code says to do aac, what's up? |
I think it would go a long way towards helping people test, debug and fix things themselves if we had some high-level flows documented.
For each of these bullets - what file contains the entrypoint into these activities?
When a user clicks a movie in the web client:
The text was updated successfully, but these errors were encountered: