• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support General Questions Video Bitrate Calculation is inaccurate

     
    • 0 Vote(s) - 0 Average

    Video Bitrate Calculation is inaccurate

    Inaccurate bitrate affects transcoding decision
    nickb937
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Oct
    Reputation: 0
    Country:Ireland
    #1
    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.

    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.
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    Video Bitrate Calculation is inaccurate - by nickb937 - 2024-10-29, 10:34 PM
    RE: Video Bitrate Calculation is inaccurate - by TheDreadPirate - 2024-10-29, 10:42 PM
    RE: Video Bitrate Calculation is inaccurate - by gnattu - 2024-10-29, 10:45 PM
    RE: Video Bitrate Calculation is inaccurate - by nickb937 - 2024-10-30, 10:17 AM
    RE: Video Bitrate Calculation is inaccurate - by nickb937 - 2024-10-29, 10:48 PM
    RE: Video Bitrate Calculation is inaccurate - by nickb937 - 2024-10-30, 10:03 AM
    RE: Video Bitrate Calculation is inaccurate - by TheDreadPirate - 2024-10-30, 01:17 PM
    RE: Video Bitrate Calculation is inaccurate - by nickb937 - 2024-10-30, 01:37 PM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode