Python 3:
Replace
This goes from whatever hardware acceleration method to QuickSync; to go from whatever to NVENC, change
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.
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.