Files
owncast/static/admin/_next/static/chunks/pages/config-video-c250bf8f88dd1d1b.js
Gabe Kangas 045a0a2afd Social features / ActivityPub federation (#1629)
* Support webfinger requests for the live account. Closes https://github.com/owncast/owncast/issues/1193

* Support for actor requests. Returns response for live actor. Closes https://github.com/owncast/owncast/issues/1203

* Handle follow and unfollow requests. Closes
https://github.com/owncast/owncast/issues/1191 and https://github.com/owncast/owncast/issues/1205 and https://github.com/owncast/owncast/issues/1206 and https://github.com/owncast/owncast/issues/1194

* Add basic support for sending out text activities. For https://github.com/owncast/owncast/issues/1192

* Some error handling and passing of dynamic local account names.

* Add hardcoded example image attachment to test post

* Centralize the map of accounts and inboxes

* No longer disable the preview generator based on YP toggle

* Send a federated message to followers when stream starts. For https://github.com/owncast/owncast/issues/1192

* Placeholder for attaching tags

* Add image description

* Save and get to outbox persistence. Return using outbox endpoint for actor

* Pass payloads to be handled through the gochan

* Handle undo follow requests explitly, not all undo requests

* Add API for manually sending simple federated messages. Closes #1215

* Verify inbox requests. Closes #1321

* Add route to fetch a single AP object by ID. For #1329

* Add responses to fediverse nodeinfo requests

* Set and get federation config values for admin

* Handle host-meta requests

* Do not send out message if disabled. Use saved go live message.

* Require AP-compatible content types for AP-related requests

* Rename ap models to apmodels for clarity

* Change how content type matching takes place.

* io -> ioutil

* Add stub delete activity callback

* Handle likes and announces to surface engagement in chat. Part of #1229

* Append url to go live posts

* Do not require specific content types for nodeinfo requests

* Add follow engagement chat message via AP

* add owncast user-agent to requests

* Set note visibility to public (for now)

* Fix saving/fetching a single object

* Add support for x-nodeinfo2 responses

* Point to the dev admin branch for ap

* Bundle in dev admin for testing

* Add error logging

* Add AP middleware back

* Point to the new external compatible logo endpoint

* Clean up more AP logging to help testing

* Tweak go live text and link hashtags

* Fix bug in fetching init time

* Send update actor activities when server details/profile is updated

* Add federation config overview to web client config

* Add additional actor properties

* Make the AP middleware checking more flexible when looking at types

* First pass at remote fediverse follow flow. For #1371

* Added a basic AP actor followers endpoint

* WIP client followers API

* Add profile-page reference to webfinger response

* Add aliases to webfinger response

* Fix content-type returned to be expected activitypub+json

* First pass at followers api

* Point at local dev copy of go-fed/activity

* Add custom toot Hashtag objects to posts

* Store additional user details to followers table

* Fix AP followers endpoint. Closes #1204

* Add owncast hashtag as an invisible tag to go live posts

* Reject AP requests when it is disabled

* Add actor util for generating full account user from person object

* Verify inbox requests before performing any other work

* Accept actor update requests

* Fix linter errors in federation branch

* Migrate AP SQL to sqlc for type safe queries

* Use the @unclearParadigm REST parameter helper

* Fix verifying post ID on AP engagement

* WIP privacy/request approval

* Style the remote follow modal

* First pass at a followers list component w/ mock data. #1370

* Revert "Use the @unclearParadigm REST parameter helper"

This reverts commit c8af8a413f6f53e7d1a15a7d823ff28be2db3c23.

* Fix get followers API

* Add support for requiring approval. Closes https://github.com/owncast/owncast/issues/1208

* Handle Applications as Actors partly for PeerTube support

* add temp todo list

* check route on load, this might change later

* style followers

* account for just 1 tab case

* Remove mock data. Allow showing follow button even when there are no external actions defined

* Point to actual followers API

* Support fallback img for follower views

* Remove duplicate verification. Add some additional verbose logging

* Bundle dev admin

* Add type to host-meta webfinger template response

* Tweak remote follow modal content

* WIP federation followers refactor

* Do not send pointer to middleware

* Update admin

* Add setting for toggling displaying fediverse engagement. Closes #1404

* Add in-development admin

* Do not enable cors on admin followers api

* Add db migration for updating messages table

* Enable empty string go live messages to disable

* Remove debug messages

* Rework some ActivityPub handling.

Create new Actor->Person handling.
Create new Actor->Service handling.
Add engagement handlers to send chat events and store event objects.
Store inbound activities to new ap_inbound_activities table.

* Support federated engagement events.

Store them in the messages table and surface them via chat events.

* Support federated event engatement in the chat

* Tweak web UI followers handling

* Point go.mod at remote fork instead of local

* Update admin

* Merged in develop. Couple fixes

* Update dev admin

* Update fedi engagement posts.

- Fix incorrect action text.
- Add action icons.

* Set public as to instead of cc for ap msg

* Updated styling for federated actions in chat

* Add support for blocking federated domains. Closes #1209

* Force checking of https in verify step

* Update dev admin

* Return user scopes in chat history api. Closes #1586

* Update dev admin

* Add AP outbound request worker pool. Closes #1571

* Disable (temporarily?) owncast tag on AP posts

* Consolidate creating activity+notes in outbound AP messages

* Add inbox worker pool. Closes #1570

* Update dev admin bundle

* Clean up some logs

* Re-enable inbound verfication

* Save full IRI to outbox instead of path

* Reject if full IRI is not found in outbox

* Use full ActivityPub user account in chat event

* Fix and expand follower APIs

- Add missing IDs to AP follower endpoints
- Split AP follower endpoints into initial request and pages.
- Support pagination in AP requests.

* Include IRI in error message

* Hide chat toggle when chat is hidden. Closes #1606

* Updates to followers pagination

* Set default go live message

* Remove log

* indirect -> direct import

* Updates for inbound federated event handling.

- Keep track of existing events and reject duplicates.
- Change what is sent to chat for surfing federated engagement.
- Keep track if outbound events are automated "go live" events or not.

* Update chat federated engagement.

* Update dev admin.

* Move from being a person to a bot (service). Closes #1619

* Only set server init date if not already set

* Only save notes to outbox able

* Rework private-mode followers/approvals

* API for returning a list of federated actions for #1573

* Fix too-small follower cells and jumpy tabs. Closes #1616 and closes #1516

* Fix shortcuts getting fired on inputs. Fixes #1489 and #1201

* Add spinner, autoclose + other fixes to follow modal. Fixes #1593

* Fix fetching a single object by IRI

* SendFederationMessage -> SendFederatedMessage

* Autolink and create tag objects from manual posts. Closes #1620

* Update dev admin bundle

* Handle engagement from non-automated/live posts

* Reject federated engagement actions if they do not match a local post

* Update dev admin bundle

* A bunch of cleanup

* Fix unused assignments and logic

* Remove unused function

* Add content warning and sentive content flag if stream is NSFW. Closes #1624

* Disable fetching objects by IRI when in private mode. Closes #1623

* Update the error message of the remote follow dialog. closes #1622

* Update dev admin

* Fix NREs throwing in test content

* Fix query that wasn't properly filtering out hidden messages

* Test against user being disabled instead of message visibility

* Fix automated test NRE

* Update comment

* Adjust federated engagement chat views. Closes #1617

* Add additional index to users table

* Add support for removing followers/requests. Closes #1630

* Reject federated actions from blocked actors. #1631

* Use fallback avatar if it fails to load. Closes #1635

* Fix styling of follower list. Closes #1636

* Add basic blurb stating they should follow the server. Closes #1641

* Update dev admin

* Set default go live message in migration. Closes #1642

* Reset the messages table on 0.0.11 schema migration

* Fix js error with moderation actions. Closes #1621

* Add a bit more clarification on follow modal. Closes #1599

* Remove todos

* Split out actor and domain blocking checks

* Check for errors on default values being set

* Clean up actor rejection due to being blocked

* Update dev admin

* Add colon to error to make it easier to read

* Remove markdown rendering of go live message. Reorganize text. Remove content warning. Closes #1645

* Break out the sort+render messages logic so it can be fired on visibility change. Closes #1643

* Do not send profile updates if federation is disabled

* Save follow references to inbound activities table

* Update dev admin

* Add blocked actor test

* Remove the overloaded term of Follow from social links

* Fix test running in memory only

* Remove "just" in engagement messags

* Replace star with heart for like action.

* Update dev admin

* Explicitly set cc as public

* Remove overly using the stream name in fediverse engagement messages

* Some federated/follow UI tweaks

* Remove explicit cc and bcc as they are not required

* Explicitly set the audience

* Remove extra margin

* Add Join Fediverse button to follow modal. Closes #1651

* Do not allow multiple follows to send multiple events. Closes #1650

* Give events a min height

* Do not allow old posts to be liked/shared. Closes #1652

* Remove value from log message

* Alert followers on private mode toggle

* Ignore clicks to follow button if disabled

* Remove underline from action buttons

* Add moderator icon to join message

* Update admin

* Post-merge remove unused var

* Remove pointing at feature branch

Co-authored-by: Ginger Wong <omqmail@gmail.com>
2022-01-12 13:53:10 -08:00

1 line
21 KiB
JavaScript
Vendored

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64],{79893:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/config-video",function(){return t(37252)}])},15976:function(e,n,t){"use strict";t.d(n,{Z:function(){return m}});var r=t(28520),a=t.n(r),i=t(85893),o=t(67294),s=t(94594),l=t(83200),c=t(78464),d=t(25964),u=t(35159);function h(e,n,t,r,a,i,o){try{var s=e[i](o),l=s.value}catch(c){return void t(c)}s.done?n(l):Promise.resolve(l).then(r,a)}function m(e){var n,t=(0,o.useState)(null),r=t[0],m=t[1],f=null,v=((0,o.useContext)(u.aC)||{}).setFieldInConfigState,p=e.apiPath,g=e.checked,x=e.reversed,y=void 0!==x&&x,b=e.configPath,j=void 0===b?"":b,w=e.disabled,N=void 0!==w&&w,k=e.fieldName,P=e.label,C=e.tip,S=e.useSubmit,Z=e.onChange,I=function(){m(null),clearTimeout(f),f=null},T=(n=a().mark((function e(n){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!S){e.next=6;break}return m((0,l.kg)(l.Jk)),t=y?!n:n,e.next=5,(0,d.Si)({apiPath:p,data:{value:t},onSuccess:function(){v({fieldName:k,value:t,path:j}),m((0,l.kg)(l.zv))},onError:function(e){m((0,l.kg)(l.Un,"There was an error: ".concat(e)))}});case 5:f=setTimeout(I,d.sI);case 6:Z&&Z(n);case 7:case"end":return e.stop()}}),e)})),function(){var e=this,t=arguments;return new Promise((function(r,a){var i=n.apply(e,t);function o(e){h(i,r,a,o,s,"next",e)}function s(e){h(i,r,a,o,s,"throw",e)}o(void 0)}))}),_=null!==r&&r.type===l.Jk;return(0,i.jsxs)("div",{className:"formfield-container toggleswitch-container",children:[P&&(0,i.jsx)("div",{className:"label-side",children:(0,i.jsx)("span",{className:"formfield-label",children:P})}),(0,i.jsxs)("div",{className:"input-side",children:[(0,i.jsxs)("div",{className:"input-group",children:[(0,i.jsx)(s.Z,{className:"switch field-".concat(k),loading:_,onChange:T,defaultChecked:g,checked:g,checkedChildren:"ON",unCheckedChildren:"OFF",disabled:N}),(0,i.jsx)(c.Z,{status:r})]}),(0,i.jsx)("p",{className:"field-tip",children:C})]})]})}m.defaultProps={apiPath:"",checked:!1,reversed:!1,configPath:"",disabled:!1,label:"",tip:"",useSubmit:!1,onChange:null}},37252:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return J}});var r=t(85893),a=t(54907),i=t(44068),o=t(25968),s=t(6226),l=t(67294),c=t(28520),d=t.n(c),u=t(66933),h=t(75443),m=t(57553),f=t(25964),v=t(83200),p=t(35159),g=t(78464);function x(e,n,t,r,a,i,o){try{var s=e[i](o),l=s.value}catch(c){return void t(c)}s.done?n(l):Promise.resolve(l).then(r,a)}function y(e){return function(){var n=this,t=arguments;return new Promise((function(r,a){var i=e.apply(n,t);function o(e){x(i,r,a,o,s,"next",e)}function s(e){x(i,r,a,o,s,"throw",e)}o(void 0)}))}}function b(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(t.push(o.value),!n||t.length!==n);r=!0);}catch(l){a=!0,i=l}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return t}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function j(){var e=(0,l.useContext)(p.aC),n=e||{},t=n.serverConfig,a=n.setFieldInConfigState,o=t||{},s=o.videoCodec,c=o.supportedCodecs,x=i.Z.Title,j=u.Z.Option,w=(0,l.useState)(null),N=w[0],k=w[1],P=(0,l.useContext)(m.k).setMessage,C=(0,l.useState)(s),S=C[0],Z=C[1],I=(0,l.useState)(s),T=I[0],_=I[1],V=b(l.useState(!1),2),O=V[0],E=V[1],A=null;(0,l.useEffect)((function(){Z(s)}),[s]);var U=function(){k(null),A=null,clearTimeout(A)};function L(){return(L=y(d().mark((function n(){return d().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return Z(T),_(""),E(!1),n.next=5,(0,f.Si)({apiPath:f.CQ,data:{value:T},onSuccess:function(){a({fieldName:"videoCodec",value:T,path:"videoSettings"}),k((0,v.kg)(v.zv,"Video codec updated.")),A=setTimeout(U,f.sI),e.online&&P("Your latency buffer setting will take effect the next time you begin a live stream.")},onError:function(e){k((0,v.kg)(v.Un,e)),A=setTimeout(U,f.sI)}});case 5:case"end":return n.stop()}}),n)})))).apply(this,arguments)}var B=c.map((function(e){var n=e;return"libx264"===n?n="Default (libx264)":"h264_nvenc"===n?n="NVIDIA GPU acceleration":"h264_vaapi"===n?n="VA-API hardware encoding":"h264_qsv"===n?n="Intel QuickSync":"h264_v4l2m2m"===n?n="Video4Linux hardware encoding":"h264_omx"===n&&(n="OpenMax (omx) for Raspberry Pi"),(0,r.jsx)(j,{value:e,children:n},e)})),F="";return"libx264"===S?F="libx264 is the default codec and generally the only working choice for shared VPS enviornments. This is likely what you should be using unless you know you have set up other options.":"h264_nvenc"===S?F="You can use your NVIDIA GPU for encoding if you have a modern NVIDIA card with encoding cores.":"h264_vaapi"===S?F="VA-API may be supported by your NVIDIA proprietary drivers, Mesa open-source drivers for AMD or Intel graphics.":"h264_qsv"===S?F="Quick Sync Video is Intel's brand for its dedicated video encoding and decoding hardware. It may be an option if you have a modern Intel CPU with integrated graphics.":"h264_v4l2m2m"===S?F="Video4Linux is an interface to multiple different hardware encoding platforms such as Intel and AMD.":"h264_omx"===S&&(F="OpenMax is a codec most often used with a Raspberry Pi."),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x,{level:3,className:"section-title",children:"Video Codec"}),(0,r.jsxs)("div",{className:"description",children:["If you have access to specific hardware with the drivers and software installed for them, you may be able to improve your video encoding performance.",(0,r.jsx)("p",{children:(0,r.jsx)("a",{href:"https://owncast.online/docs/codecs?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Read the documentation about this setting before changing it or you may make your stream unplayable."})})]}),(0,r.jsxs)("div",{className:"segment-slider-container",children:[(0,r.jsx)(h.Z,{title:"Are you sure you want to change your video codec to ".concat(T," and understand what this means?"),visible:O,placement:"leftBottom",onConfirm:function(){return L.apply(this,arguments)},okText:"Yes",cancelText:"No",children:(0,r.jsx)(u.Z,{defaultValue:S,value:S,style:{width:"100%"},onChange:function(e){_(e),E(!0)},children:B})}),(0,r.jsx)(g.Z,{status:N}),(0,r.jsx)("p",{id:"selected-codec-note",className:"selected-value-note",children:F})]})]})}var w=t(48761);function N(e,n,t,r,a,i,o){try{var s=e[i](o),l=s.value}catch(c){return void t(c)}s.done?n(l):Promise.resolve(l).then(r,a)}var k=i.Z.Title,P={0:"Lowest",1:"",2:"",3:"",4:"Highest"},C={0:"Lowest latency, lowest error tolerance (Not recommended, may not work for all content/configurations.)",1:"Low latency, low error tolerance",2:"Medium latency, medium error tolerance (Default)",3:"High latency, high error tolerance",4:"Highest latency, highest error tolerance"};function S(){var e=(0,l.useState)(null),n=e[0],t=e[1],a=(0,l.useState)(null),i=a[0],o=a[1],s=(0,l.useContext)(p.aC),c=(0,l.useContext)(m.k).setMessage,u=s||{},h=u.serverConfig,x=u.setFieldInConfigState,y=(h||{}).videoSettings,b=null;if(!y)return null;(0,l.useEffect)((function(){o(y.latencyLevel)}),[y]);var j,S=function(){t(null),b=null,clearTimeout(b)},Z=(j=d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t((0,v.kg)(v.Jk)),e.next=3,(0,f.Si)({apiPath:f.sv,data:{value:n},onSuccess:function(){x({fieldName:"latencyLevel",value:n,path:"videoSettings"}),t((0,v.kg)(v.zv,"Latency buffer level updated.")),b=setTimeout(S,f.sI),s.online&&c("Your latency buffer setting will take effect the next time you begin a live stream.")},onError:function(e){t((0,v.kg)(v.Un,e)),b=setTimeout(S,f.sI)}});case 3:case"end":return e.stop()}}),e)})),function(){var e=this,n=arguments;return new Promise((function(t,r){var a=j.apply(e,n);function i(e){N(a,t,r,i,o,"next",e)}function o(e){N(a,t,r,i,o,"throw",e)}i(void 0)}))});return(0,r.jsxs)("div",{className:"config-video-latency-container",children:[(0,r.jsx)(k,{level:3,className:"section-title",children:"Latency Buffer"}),(0,r.jsx)("p",{className:"description",children:"While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended."}),(0,r.jsxs)("p",{className:"description",children:["For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it."," ",(0,r.jsx)("a",{href:"https://owncast.online/docs/encoding#latency-buffer?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Read to learn more."})]}),(0,r.jsxs)("div",{className:"segment-slider-container",children:[(0,r.jsx)(w.Z,{tipFormatter:function(e){return C[e]},onChange:function(e){Z(e)},min:0,max:4,marks:P,defaultValue:i,value:i}),(0,r.jsx)("p",{className:"selected-value-note",children:C[i]}),(0,r.jsx)(g.Z,{status:n})]})]})}var Z=t(71577),I=t(14670),T=t(88829),_=t(56516),V=t(48689),O=t(21640),E=t(94184),A=t.n(E),U=t(48419),L=t(15976);function B(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function F(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){B(e,n,t[n])}))}return e}var D=a.Z.Panel;function R(e){var n=e.dataState,t=void 0===n?f.gX:n,l=e.onUpdateField,c=t.videoPassthrough,d=A()({"config-variant-form":!0,"video-passthrough-enabled":c});return(0,r.jsxs)("div",{className:d,children:[(0,r.jsxs)("p",{className:"description",children:[(0,r.jsx)("a",{href:"https://owncast.online/docs/video?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn more"})," ","about how each of these settings can impact the performance of your server."]}),c&&(0,r.jsxs)("p",{className:"passthrough-warning",children:["NOTE: Video Passthrough for this output stream variant is ",(0,r.jsx)("em",{children:"enabled"}),", disabling the below video encoding settings."]}),(0,r.jsxs)(o.Z,{gutter:16,children:[(0,r.jsx)(U.ZP,F({maxLength:"10"},f.SS,{value:t.name,onChange:function(e){l({fieldName:"name",value:e.value})}})),(0,r.jsx)(s.Z,{sm:24,md:12,children:(0,r.jsxs)("div",{className:"form-module cpu-usage-container",children:[(0,r.jsx)(i.Z.Title,{level:3,children:"CPU or GPU Utilization"}),(0,r.jsx)("p",{className:"description",children:"Reduce to improve server performance, or increase it to improve video quality."}),(0,r.jsxs)("div",{className:"segment-slider-container",children:[(0,r.jsx)(w.Z,{tipFormatter:function(e){return f.I$[e]},onChange:function(e){l({fieldName:"cpuUsageLevel",value:e})},min:1,max:Object.keys(f.t$).length,marks:f.t$,defaultValue:t.cpuUsageLevel,value:t.cpuUsageLevel,disabled:t.videoPassthrough}),(0,r.jsx)("p",{className:"selected-value-note",children:c?"CPU usage selection is disabled when Video Passthrough is enabled.":f.I$[t.cpuUsageLevel]||""})]}),(0,r.jsxs)("p",{className:"read-more-subtext",children:["This could mean GPU or CPU usage depending on your server environment."," ",(0,r.jsx)("a",{href:"https://owncast.online/docs/video/?source=admin#cpu-usage",target:"_blank",rel:"noopener noreferrer",children:"Read more about hardware performance."})]})]})}),(0,r.jsx)(s.Z,{sm:24,md:12,children:(0,r.jsxs)("div",{className:"form-module bitrate-container ".concat(t.videoPassthrough?"disabled":""),children:[(0,r.jsx)(i.Z.Title,{level:3,children:"Video Bitrate"}),(0,r.jsx)("p",{className:"description",children:f.yC.tip}),(0,r.jsxs)("div",{className:"segment-slider-container",children:[(0,r.jsx)(w.Z,{tipFormatter:function(e){return"".concat(e," ").concat(f.yC.unit)},disabled:t.videoPassthrough,defaultValue:t.videoBitrate,value:t.videoBitrate,onChange:function(e){l({fieldName:"videoBitrate",value:e})},step:f.yC.incrementBy,min:f.yC.min,max:f.yC.max,marks:f.HM}),(0,r.jsx)("p",{className:"selected-value-note",children:function(){if(c)return"Bitrate selection is disabled when Video Passthrough is enabled.";var e="".concat(t.videoBitrate).concat(f.yC.unit);return e=t.videoBitrate<2e3?"".concat(e," - Good for low bandwidth environments."):t.videoBitrate<3500?"".concat(e," - Good for most bandwidth environments."):"".concat(e," - Good for high bandwidth environments.")}()})]}),(0,r.jsx)("p",{className:"read-more-subtext",children:(0,r.jsx)("a",{href:"https://owncast.online/docs/video/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Read more about bitrates."})})]})})]}),(0,r.jsx)(a.Z,{className:"advanced-settings",children:(0,r.jsxs)(D,{header:"Advanced Settings",children:[(0,r.jsxs)(o.Z,{gutter:16,children:[(0,r.jsx)(s.Z,{sm:24,md:12,children:(0,r.jsxs)("div",{className:"form-module resolution-module",children:[(0,r.jsx)(i.Z.Title,{level:3,children:"Resolution"}),(0,r.jsxs)("p",{className:"description",children:["Resizing your content will take additional resources on your server. If you wish to optionally resize your content for this stream output then you should either set the width ",(0,r.jsx)("strong",{children:"or"})," the height to keep your aspect ratio."," ",(0,r.jsx)("a",{href:"https://owncast.online/docs/video/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Read more about resolutions."})]}),(0,r.jsx)("br",{}),(0,r.jsx)(U.ZP,F({type:"number"},f.dL.scaledWidth,{value:t.scaledWidth,onChange:function(e){var n=Number(e.value);isNaN(n)||l({fieldName:"scaledWidth",value:n||0})},disabled:t.videoPassthrough})),(0,r.jsx)(U.ZP,F({type:"number"},f.dL.scaledHeight,{value:t.scaledHeight,onChange:function(e){var n=Number(e.value);isNaN(n)||l({fieldName:"scaledHeight",value:n||0})},disabled:t.videoPassthrough}))]})}),(0,r.jsx)(s.Z,{sm:24,md:12,children:(0,r.jsxs)("div",{className:"form-module video-passthrough-module",children:[(0,r.jsx)(i.Z.Title,{level:3,children:"Video Passthrough"}),(0,r.jsxs)("div",{className:"description",children:[(0,r.jsxs)("p",{children:["Enabling video passthrough may allow for less hardware utilization, but may also make your stream ",(0,r.jsx)("strong",{children:"unplayable"}),"."]}),(0,r.jsx)("p",{children:"All other settings for this stream output will be disabled if passthrough is used."}),(0,r.jsx)("p",{children:(0,r.jsx)("a",{href:"https://owncast.online/docs/video/?source=admin#video-passthrough",target:"_blank",rel:"noopener noreferrer",children:"Read the documentation before enabling, as it impacts your stream."})})]}),(0,r.jsx)(h.Z,{disabled:!0===t.videoPassthrough,title:"Did you read the documentation about video passthrough and understand the risks involved with enabling it?",icon:(0,r.jsx)(O.Z,{}),onConfirm:function(){l({fieldName:"videoPassthrough",value:!0})},okText:"Yes",cancelText:"No",children:(0,r.jsx)("a",{href:"#",children:(0,r.jsx)(L.Z,{label:"Use Video Passthrough?",fieldName:"video-passthrough",tip:f.dL.videoPassthrough.tip,checked:t.videoPassthrough,onChange:function(e){c&&l({fieldName:"videoPassthrough",value:e})}})})})]})})]}),(0,r.jsxs)("div",{className:"form-module frame-rate-module",children:[(0,r.jsx)(i.Z.Title,{level:3,children:"Frame rate"}),(0,r.jsx)("p",{className:"description",children:f.nm.tip}),(0,r.jsxs)("div",{className:"segment-slider-container",children:[(0,r.jsx)(w.Z,{tipFormatter:function(e){return"".concat(e," ").concat(f.nm.unit)},defaultValue:t.framerate,value:t.framerate,onChange:function(e){l({fieldName:"framerate",value:e})},step:f.nm.incrementBy,min:f.nm.min,max:f.nm.max,marks:f.Xq,disabled:t.videoPassthrough}),(0,r.jsx)("p",{className:"selected-value-note",children:c?"Framerate selection is disabled when Video Passthrough is enabled.":f.x8[t.framerate]||""})]}),(0,r.jsx)("p",{className:"read-more-subtext",children:(0,r.jsx)("a",{href:"https://owncast.online/docs/video/?source=admin#framerate",target:"_blank",rel:"noopener noreferrer",children:"Read more about framerates."})})]})]},"1")})]})}function z(e,n,t,r,a,i,o){try{var s=e[i](o),l=s.value}catch(c){return void t(c)}s.done?n(l):Promise.resolve(l).then(r,a)}function H(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function M(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){H(e,n,t[n])}))}return e}function G(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(t.push(o.value),!n||t.length!==n);r=!0);}catch(l){a=!0,i=l}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return t}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function X(e){return function(e){if(Array.isArray(e)){for(var n=0,t=new Array(e.length);n<e.length;n++)t[n]=e[n];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var q=i.Z.Title;function Q(){var e=(0,l.useState)(!1),n=e[0],t=e[1],a=(0,l.useState)(!1),i=a[0],o=a[1],s=(0,l.useState)(0),c=s[0],u=s[1],h=(0,l.useContext)(m.k).setMessage,x=(0,l.useState)(f.gX),y=x[0],b=x[1],j=(0,l.useState)(null),w=j[0],N=j[1],k=(0,l.useContext)(p.aC),P=k||{},C=P.serverConfig,S=P.setFieldInConfigState,O=(C||{}).videoSettings,E=(O||{}).videoQualityVariants,A=null;if(!O)return null;var U,L=function(){N(null),A=null,clearTimeout(A)},B=function(){t(!1),u(-1),b(f.gX)},F=(U=d().mark((function e(n){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N((0,v.kg)(v.Jk)),e.next=3,(0,f.Si)({apiPath:f.vv,data:{value:n},onSuccess:function(){S({fieldName:"videoQualityVariants",value:n,path:"videoSettings"}),o(!1),B(),N((0,v.kg)(v.zv,"Variants updated")),A=setTimeout(L,f.sI),k.online&&h("Updating your video configuration will take effect the next time you begin a new stream.")},onError:function(e){N((0,v.kg)(v.Un,e)),o(!1),A=setTimeout(L,f.sI)}});case 3:case"end":return e.stop()}}),e)})),function(){var e=this,n=arguments;return new Promise((function(t,r){var a=U.apply(e,n);function i(e){z(a,t,r,i,o,"next",e)}function o(e){z(a,t,r,i,o,"throw",e)}i(void 0)}))}),D=[{title:"Name",dataIndex:"name",render:function(e){return e||"No name"}},{title:"Video bitrate",dataIndex:"videoBitrate",key:"videoBitrate",render:function(e,n){return!e||n.videoPassthrough?"Same as source":"".concat(e," kbps")}},{title:"CPU Usage",dataIndex:"cpuUsageLevel",key:"cpuUsageLevel",render:function(e,n){return!e||n.videoPassthrough?"n/a":f.I$[e].split(" ")[0]}},{title:"",dataIndex:"",key:"edit",render:function(e){var n=e.key-1;return(0,r.jsxs)("span",{className:"actions",children:[(0,r.jsx)(Z.Z,{size:"small",onClick:function(){u(n),b(E[n]),t(!0)},children:"Edit"}),(0,r.jsx)(Z.Z,{className:"delete-button",icon:(0,r.jsx)(V.Z,{}),size:"small",disabled:1===E.length,onClick:function(){!function(e){var n=X(E);n.splice(e,1),F(n)}(n)}})]})}}],Q=E.map((function(e,n){return M({key:n+1},e)}));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(q,{level:3,className:"section-title",children:"Stream output"}),function(){if(1!==E.length)return!1;var e=G(E,1)[0];return f.i3.VIDEO_HEIGHT<=e.scaledHeight||f.i3.VIDEO_BITRATE<=e.videoBitrate}()&&(0,r.jsx)(I.Z,{message:f.i3.HELP_TEXT,type:"info",closable:!0}),(0,r.jsx)(g.Z,{status:w}),(0,r.jsx)(T.Z,{className:"variants-table",pagination:!1,size:"small",columns:D,dataSource:Q}),(0,r.jsxs)(_.Z,{title:"Edit Video Variant Details",visible:n,onOk:function(){o(!0);var e=X(E);-1===c?e.push(y):e.splice(c,1,y),F(e)},onCancel:B,confirmLoading:i,width:900,children:[(0,r.jsx)(R,{dataState:M({},y),onUpdateField:function(e){var n=e.fieldName,t=e.value;b(M({},y,H({},n,t)))}}),(0,r.jsx)(g.Z,{status:w})]}),(0,r.jsx)("br",{}),(0,r.jsx)(Z.Z,{type:"primary",onClick:function(){u(-1),b(f.gX),t(!0)},children:"Add a new variant"})]})}var Y=a.Z.Panel,$=i.Z.Title;function J(){return(0,r.jsxs)("div",{className:"config-video-variants",children:[(0,r.jsx)($,{children:"Video configuration"}),(0,r.jsxs)("p",{className:"description",children:["Before changing your video configuration"," ",(0,r.jsx)("a",{href:"https://owncast.online/docs/video?source=admin",target:"_blank",rel:"noopener noreferrer",children:"visit the video documentation"})," ","to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities."]}),(0,r.jsxs)(o.Z,{gutter:[16,16],children:[(0,r.jsx)(s.Z,{md:24,lg:12,children:(0,r.jsx)("div",{className:"form-module variants-table-module",children:(0,r.jsx)(Q,{})})}),(0,r.jsxs)(s.Z,{md:24,lg:12,children:[(0,r.jsx)("div",{className:"form-module latency-module",children:(0,r.jsx)(S,{})}),(0,r.jsx)(a.Z,{className:"advanced-settings codec-module",children:(0,r.jsx)(Y,{header:"Advanced Settings",children:(0,r.jsx)("div",{className:"form-module variants-table-module",children:(0,r.jsx)(j,{})})},"1")})]})]})]})}}},function(e){e.O(0,[829,578,556,774,888,179],(function(){return n=79893,e(e.s=n);var n}));var n=e.O();_N_E=n}]);