sanity-io / sanity-plugin-mux-input

An input component that integrates Sanity Studio with MUX.com video encoding/hosting service.
https://mux.com
MIT License
51 stars 55 forks source link

4k support #324

Closed kritzware closed 5 months ago

kritzware commented 12 months ago

Are there any plans to support 4k video uploads?

https://docs.mux.com/guides/video/stream-videos-in-4k

I've made the necessary modifications locally but it seems that all Mux API requests are going through the Sanity API, rather than directly to api.mux.com, meaning I can't modify the request and add the required "max_resolution_tier": "2160p" field to new_asset_settings.

kritzware commented 12 months ago

This is a raw request being sent to Sanity through the Mux plugin when uploading a 4k video, and my local modifications to add "max_resolution_tier": "2160p". It's correctly being set on the request body, but when checking in the Mux API logs, this field is non-existent and the video is only 1080p (the default).

curl 'https://[PROJECT-ID].api.sanity.io/v2022-09-14/addons/mux/uploads/production?tag=sanity.studio' \
  -H 'authority: [PROJECT-ID].api.sanity.io' \
  -H 'accept: application/json' \
  -H 'accept-language: en-GB,en;q=0.9,fr-FR;q=0.8,fr;q=0.7,nb-NO;q=0.6,nb;q=0.5,en-US;q=0.4,nl;q=0.3,ja;q=0.2' \
  -H 'content-type: application/json' \
  -H 'cookie: sanitySession=[SESSION-ID]' \
  -H 'dnt: 1' \
  -H 'mux-proxy-uuid: 9b1eeeec-0f1a-4893-9174-8c3bf6de2491' \
  -H 'origin: http://localhost:3333' \
  -H 'sec-ch-ua: "Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36' \
  --data-raw '{"mp4_support":"standard","playback_policy":["public"],"max_resolution_tier":"2160p"}' \
  --compressed
hdoro commented 5 months ago

This is now possible with plugin version 2.3.0 (see #350 ) ✅