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

Support for auto-generated captions #327

Closed slegay closed 5 months ago

slegay commented 11 months ago

Mux recently released the ability to auto-generate subtitles. The feature can only be enabled during the initial MUX API request that creates the video asset.

https://www.mux.com/blog/auto-generated-captions-for-on-demand-video-have-arrived-crowd-roars-with-applause

Describe the solution you'd like We'd like the Mux Sanity plugin to offer an option to auto-generate captions.

Describe alternatives you've considered We've tried adding this ourselves, but the plugin seems to make use of a server-side proxy to circumvent Mux's CORS rules that are preventing requests from browsers.

thealice commented 11 months ago

+1, this would be awesome.

evankirkiles commented 7 months ago

I agree, I think this is in the hands of the Sanity team themselves to enable implementation. I also made an attempt, and it seems as if the only fields that are proxied through to Mux in new_asset_settings when creating the direct upload link are the ones the plugin explicitly provides:

As that backend Sanity->Mux API proxy is not open-source, or at least I can't find its implementation anywhere, it would be a huge help to allow us to pass through additional arbitrary configuration options from the browser. At the very least, some documentation on what that endpoint /addons/mux is doing would be helpful in this plugin's README.

I have a PR enabling more fine-tune configuration of a mux.video field, e.g. by allowing specification of encoding_tier, max_resolution_tier, master_access, and more on both a plugin-wide level and on a field-specific level, but until Sanity lets these additional options through the proxy any attempts on the open-source side of things to update the plugin won't work.

While the non-nested new_asset_settings options will be simple enough to provide support for (exposing them much like mp4_support, it might take a little bit more work to enable providing or generating captions & subtitles, as these are set in the new_asset_settings input array.

@stipsan thoughts?

hdoro commented 5 months ago

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