2024-10-29, 10:34 PM
My setup is two houses with local gigabit wired networks, connected over the internet via IPSec VPN by fiber at 1000mbit/sec download, 100mbit/sec upload. I have configured such that house A holds Jellyfin server and house B where a client runs is configured as a remote network.
Despite the reasonable upload speed, I often find that videos are marked as direct-play and experience a degree of playback stalling between the two houses. Monitoring the network traffic on the router I can see that I should restrict streaming to 60mbit/sec and have configured the Jellyfin client as such. Still all videos are streamed as direct-play and the videos will continue to stall. In order to force transcoding of the video, I must set the maximum bandwidth in the client to a value less than recorded in the metadata for the video.
An example is Bill & Ted Face the Music, where I had to force the film to transcode by setting max bandwidth to 20mbit/sec. Here bit-rate is reported as 32MBit/sec in Jellyfin (presumably the average bitrate) but the film actually peaks around 150Mbit/sec and even in the first few chunks the bitrate is higher than 32710kbit. The problem is that if the reported bitrate of 32710kbit is used for the transcoding decision, then it's going to be the wrong choice for streaming this particular film.
Here we have a TV episode with a reported bitrate of around 15MBit, but a more detailed probe finds that the max-bitrate is nearly 30Mbit.
This is what I'm using to calculate the bitrate: https://github.com/slhck/ffmpeg-bitrate-stats
It seems to me that with a slower, but more accurate probe of video bitrates, a better decision to transcode will be made and it should clear up a number of the reported issues we see on the forums around stalling/stuttering.
Despite the reasonable upload speed, I often find that videos are marked as direct-play and experience a degree of playback stalling between the two houses. Monitoring the network traffic on the router I can see that I should restrict streaming to 60mbit/sec and have configured the Jellyfin client as such. Still all videos are streamed as direct-play and the videos will continue to stall. In order to force transcoding of the video, I must set the maximum bandwidth in the client to a value less than recorded in the metadata for the video.
An example is Bill & Ted Face the Music, where I had to force the film to transcode by setting max bandwidth to 20mbit/sec. Here bit-rate is reported as 32MBit/sec in Jellyfin (presumably the average bitrate) but the film actually peaks around 150Mbit/sec and even in the first few chunks the bitrate is higher than 32710kbit. The problem is that if the reported bitrate of 32710kbit is used for the transcoding decision, then it's going to be the wrong choice for streaming this particular film.
Code:
Video
Title: 4K HEVC SDR
Codec: HEVC
AVC: No
Profile: Main 10
Level: 153
Resolution: 3840x1608
Aspect ratio: 2.40:1
Anamorphic: No
Interlaced: No
Framerate: 23.976025
Bitrate: 32710 kbps
Bit depth: 10 bit
Video range: SDR
Video range type: SDR
Colour space: bt709
Colour transfer: bt709
Colour primaries: bt709
Pixel format: yuv420p10le
Ref frames: 1
Code:
python -m ffmpeg_bitrate_stats "/tv/Films/Bill & Ted Face the Music (2020)/Bill & Ted Face the Music (2020) Bluray-2160p.mkv"
{
"input_file": "/tv/Films/Bill & Ted Face the Music (2020)/Bill & Ted Face the Music (2020) Bluray-2160p.mkv",
"stream_type": "video",
"avg_fps": 24.39,
"num_frames": 132121,
[b] "avg_bitrate": 29690.019,[/b]
[b] "avg_bitrate_over_chunks": 27318.108,[/b]
[b] "max_bitrate": 150388.377,[/b]
"min_bitrate": 64.551,
"max_bitrate_factor": 5.065,
"bitrate_per_chunk": [
68.771,
21202.516,
44067.783,
58371.812,
53273.463,
20805.554,
17189.768,
16395.582,
9278.021,
Here we have a TV episode with a reported bitrate of around 15MBit, but a more detailed probe finds that the max-bitrate is nearly 30Mbit.
Code:
Video
Title: 4K HEVC SDR
Codec: HEVC
AVC: No
Profile: Main 10
Level: 153
Resolution: 3840x2160
Aspect ratio: 16:9
Anamorphic: No
Interlaced: No
Framerate: 23.976025
[b]Bitrate: 15565 kbps[/b]
Bit depth: 10 bit
Video range: SDR
Video range type: SDR
Pixel format: yuv420p10le
Ref frames: 1
Code:
$ python -m ffmpeg_bitrate_stats /tv/TV/What\ We\ Do\ in\ the\ Shadows/Season\ 5/What.We.Do.in.the.Shadows.S05E04.2160p.WEB.h265-EDITH.mkv -p
{
"input_file": "/tv/TV/What We Do in the Shadows/Season 5/What.We.Do.in.the.Shadows.S05E04.2160p.WEB.h265-EDITH.mkv",
"stream_type": "video",
"avg_fps": 24.39,
"num_frames": 36377,
[b] "avg_bitrate": 15572.731,[/b]
[b] "avg_bitrate_over_chunks": 13650.258,[/b]
[b] "max_bitrate": 29904.874,[/b]
"min_bitrate": 48.298,
"max_bitrate_factor": 1.92,
"bitrate_per_chunk": [
16903.486,
14722.625,
17009.637,
16204.504,
This is what I'm using to calculate the bitrate: https://github.com/slhck/ffmpeg-bitrate-stats
It seems to me that with a slower, but more accurate probe of video bitrates, a better decision to transcode will be made and it should clear up a number of the reported issues we see on the forums around stalling/stuttering.