• 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 Jellyfin Hardware Transcode Settings Apply

     
    • 0 Vote(s) - 0 Average

    Jellyfin Hardware Transcode Settings Apply

    How to Apply or Mimic the Save button at the transcode settings screen
    Apollo0893
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Dec
    Reputation: 0
    Country:United States
    #1
    2024-12-03, 12:47 PM
    I was wondering if anyone has any insight on this I am attempting to replicate the save button on the transcode settings screen.  The goal would be to be able to change the transcode method via a python or other console script that can be ran or run the equivalent *.js file on the back end in order to apply the changes without having to restart Jellyfin service.  When you hit the save button and confirm it will auto apply settings instantly without forcing a restart of the server application.  This is on the LinuxServer image running on Docker.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-12-03, 02:54 PM
    Let's back up a bit. What is the goal of changing the transcode settings with a script? The transcodes settings are something you set one time, hopefully correctly, and probably never touch again.

    How often are you changing settings and why?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Apollo0893
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Dec
    Reputation: 0
    Country:United States
    #3
    2024-12-03, 04:27 PM (This post was last modified: 2024-12-03, 04:28 PM by Apollo0893. Edited 1 time in total.)
    Ideally they won't be changed much at all but I have am trying to set this up as failback so that I can change the setting if the transcode gets routed back to the local NAS due to some failure (Network or Hardware). Problem is the NAS uses VAAPI for hardware transcoding while my dedicated server has Nvidia capability and is quite a bit faster.


    Edit : I have considered just doing a service/server restart after modifying the encoding.xml file with the correct profile but the inline apply would be seamless and not cause any interruption in playback (hopefully).
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2024-12-03, 04:42 PM
    Are you using rffmpeg or something? I don't see how else you would change the transcoding device on the fly.

    Is Jellyfin running on the dedicated server with the Nvidia GPU? Or the NAS?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Apollo0893
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Dec
    Reputation: 0
    Country:United States
    #5
    2024-12-03, 05:34 PM (This post was last modified: 2024-12-03, 05:34 PM by Apollo0893. Edited 1 time in total.)
    Correct this RFFMPEG on a remote host from the jellyfin server - everything is working transcode wise and I have it setup on a separate NAS share for transcoding off a solid state drive (shared paths) and Jellyfin is on the NAS (Intel - VAAPI).
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #6
    2024-12-03, 05:55 PM (This post was last modified: 2024-12-03, 05:56 PM by TheDreadPirate. Edited 1 time in total.)
    I believe this is the function called when you click save.

    https://github.com/jellyfin/jellyfin-web...gs.js#L330

    Line 351 is the initial entry point when you click save.

    I'm not familiar enough with Jellyfin's code to assist beyond this.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Apollo0893
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Dec
    Reputation: 0
    Country:United States
    #7
    2024-12-03, 08:45 PM
    thanks! For now I have it doing an update and restart if it's forced to switch back to local transcode (vaapi). I'll look a little further into the .js portion of running the script. I did try running it with nodejs from a console and although it ran it didn't appear to do anything.
    qwerty12
    Offline

    Junior Member

    Posts: 30
    Threads: 0
    Joined: 2023 Jun
    Reputation: 3
    #8
    2024-12-03, 10:45 PM (This post was last modified: 2024-12-03, 10:46 PM by qwerty12.)
    Python 3:

    PHP Code:
    import urllib.request
    import json

    URL 
    = f"http://127.0.0.1:8096/System/Configuration/encoding"
    API_KEY = "55869869e2cf4c3aafda6fbd551f88f1"

    req = urllib.request.Request(URL, headers={
        
    "Accept": "application/json",
        
    "Authorization": f"MediaBrowser Token={API_KEY}",
    })
    with urllib.request.urlopen(req, timeout=30) as response:
        
    json_data = json.load(response)

    json_data["HardwareAccelerationType"] = "qsv"

    req = urllib.request.Request(URL, headers={
        
    "Authorization": f"MediaBrowser Token={API_KEY}",
        
    "Content-Type": "application/json",
    }, 
    method="POST")
    with urllib.request.urlopen(req, data=json.dumps(json_data).encode(),timeout=30) as response:
        
    pass 

    Replace 127.0.0.1:8096 with your own Jellyfin host and port, and replace 55869869e2cf4c3aafda6fbd551f88f1 with your own Jellyfin API key (generate one from http://127.0.0.1:8096/web/index.html#/dashboard/keys).

    This goes from whatever hardware acceleration method to QuickSync; to go from whatever to NVENC, change to json_data["HardwareAccelerationType"] = "nvenc"

    I used my browser's developer tools to find the API endpoint. https://curlconverter.com is useful to churn the CURL command-lines your browser can generate into code for your favourite programming language.

    You can access API docs from http://127.0.0.1:8096/api-docs/swagger/index.html
    This is good information on the Authorization header in terms of Jellyfin: https://gist.github.com/nielsvanvelzen/e...1ffaf12a6f
    And https://jmshrv.com/posts/jellyfin-api/ makes for a good read too.

    The Jellyfin project itself maintains SDKs for some languages if you prefer API wrappers: https://github.com/orgs/jellyfin/reposit...+apiclient
    https://github.com/sj14/jellyfin-go is a nice option for Go.
    Apollo0893
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Dec
    Reputation: 0
    Country:United States
    #9
    2024-12-04, 08:36 PM
    Thanks! - That's perfect I might add this into a fork of RFFMPEG as I think it would be useful for anyone using it since often you don't have the transcode hardware. I think this could also be made to allow for various types of acceleration when utilizing multiple different remote hosts. I'll have to play around with it some though.
    1
    « Next Oldest | Next Newest »

    Users browsing this thread: 2 Guest(s)


    • 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