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

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    Jellyfin Hardware Transcode Settings Apply - by Apollo0893 - 2024-12-03, 12:47 PM
    RE: Jellyfin Hardware Transcode Settings Apply - by TheDreadPirate - 2024-12-03, 02:54 PM
    RE: Jellyfin Hardware Transcode Settings Apply - by Apollo0893 - 2024-12-03, 04:27 PM
    RE: Jellyfin Hardware Transcode Settings Apply - by TheDreadPirate - 2024-12-03, 04:42 PM
    RE: Jellyfin Hardware Transcode Settings Apply - by Apollo0893 - 2024-12-03, 05:34 PM
    RE: Jellyfin Hardware Transcode Settings Apply - by TheDreadPirate - 2024-12-03, 05:55 PM
    RE: Jellyfin Hardware Transcode Settings Apply - by Apollo0893 - 2024-12-03, 08:45 PM
    RE: Jellyfin Hardware Transcode Settings Apply - by qwerty12 - 2024-12-03, 10:45 PM
    RE: Jellyfin Hardware Transcode Settings Apply - by Apollo0893 - 2024-12-04, 08:36 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