mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41:20 -08:00
feat: batch video upscaling with folder upload, directory save, and result comparison (#1051)
* feat: support batch video upscaling with folder upload and directory save - Add multi-file selection and entire folder upload (webkitdirectory) - Support drag & drop of both files and folders via FileSystemEntry API - Add save directory picker using File System Access API (showDirectoryPicker) - Process videos sequentially with per-file progress and status tracking - Add right-side result list with click-to-compare functionality - Add per-video duration and total batch duration display - Add retry button for failed items with error detail display - Remove auto-play on comparison viewer load - Fix worker error handling: handle "error" command to reject stale promises - Fix event listener accumulation in video comparison (AbortController) - Fix XSS risk by escaping HTML in all innerHTML injections - Fix URL revocation timing in download to prevent large file truncation - Extract writeToSaveDirectory and truncateName helpers to reduce duplication - Add Usage Guide panel explaining single/multiple/folder upload options Files changed: docs/upscaler/index.html (+1110/-181) docs/upscaler/upscaler.js (+110) * fix: prevent auto-play and resource consumption during upscaling - Set preload="metadata" on preview and comparison video elements - Explicitly pause preview video after setting src in showVideoPreview - Remove preview video seek sync from batch processing progress callbacks (was causing continuous decode during upscaling, wasting GPU resources) - Remove preview video seek sync from retry progress callback - All videos now require manual play; no background resource usage * fix: improve upscaled video quality with higher bitrate and codec support - Raise base bitrate from 2.5 Mbps (25e5) to 8 Mbps (8e6) for standard and firefox processors, preventing quality loss when source videos have high bitrates (e.g. 720p @ 16.7 Mbps was producing 1440p @ 10 Mbps, smaller than the original file) - Double the bitrate for mediabunny processor (X.n1 * 2) to account for the 4x pixel increase from 2x upscaling - Add H.264 Level 5.1 (avc1.640033) and Level 5.2 (avc1.640034) codecs to the fallback lists, since Level 4.0 (avc1.640028, ~24.6 Mbps) cannot support the higher bitrates for 1440p+ outputs - Add latencyMode: "quality" to VideoEncoder configs for both standard and firefox processors, prioritizing encoding quality over latency (suitable for offline processing) * feat: add video data comparison panel for original vs upscaled metrics - Add a comparison data table below the file info bar showing 6 metrics: Resolution, File Size, Duration, Est. Bitrate, Pixels, Process Time - Display per-metric change percentage with color-coded indicators: green (↑) for improvements, red (↓) for regressions, gray for neutral - Estimated bitrate calculated from file size × 8 / video duration - Table renders after both original and upscaled video metadata loads - Auto-hide panel on reset * fix: make video data comparison panel full-width and responsive - Move comparison data table from inside the left column to the full-width area below the left/right layout, so it is no longer constrained by the comparison viewer column width - Remove table-fixed colgroup and overflow-x-auto that caused horizontal scrolling on smaller screens - Table now uses w-full auto-layout, displaying all 4 columns (Metric, Original, Upscaled, Change) without requiring horizontal scrolling --------- Co-authored-by: rionzhao <rionzhao@tencent.com>
This commit is contained in:
commit
0896841d23
538 files changed
+379715
No files matched your search
@@ -0,0 +1,7 @@
|
||||
/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* monaco-css version: 0.30.1(5a7ba61be909ae9e4889768a3453ebb0dec392e2)
|
||||
* Released under the MIT license
|
||||
* https://github.com/Microsoft/monaco-css/blob/master/LICENSE.md
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/language/css/workerManager",["require","exports","./fillers/monaco-editor-core"],(function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.WorkerManager=void 0;var i=function(){function e(e){var n=this;this._defaults=e,this._worker=null,this._idleCheckInterval=window.setInterval((function(){return n._checkIfIdle()}),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange((function(){return n._stopWorker()}))}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){this._worker&&(Date.now()-this._lastUsedTime>12e4&&this._stopWorker())},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=t.editor.createWebWorker({moduleId:"vs/language/css/cssWorker",label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var e,n=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return this._getClient().then((function(n){e=n})).then((function(e){return n._worker.withSyncedResources(t)})).then((function(n){return e}))},e}();n.WorkerManager=i})),function(e){if("object"==typeof module&&"object"==typeof module.exports){var n=e(require,exports);void 0!==n&&(module.exports=n)}else"function"==typeof define&&define.amd&&define("vscode-languageserver-types/main",["require","exports"],e)}((function(e,n){"use strict";var t,i,r,o,a,s,u,c,d,g,l,f,h,p,m,v,y;Object.defineProperty(n,"__esModule",{value:!0}),n.TextDocument=n.EOL=n.SelectionRange=n.DocumentLink=n.FormattingOptions=n.CodeLens=n.CodeAction=n.CodeActionContext=n.CodeActionKind=n.DocumentSymbol=n.SymbolInformation=n.SymbolTag=n.SymbolKind=n.DocumentHighlight=n.DocumentHighlightKind=n.SignatureInformation=n.ParameterInformation=n.Hover=n.MarkedString=n.CompletionList=n.CompletionItem=n.InsertTextMode=n.InsertReplaceEdit=n.CompletionItemTag=n.InsertTextFormat=n.CompletionItemKind=n.MarkupContent=n.MarkupKind=n.TextDocumentItem=n.OptionalVersionedTextDocumentIdentifier=n.VersionedTextDocumentIdentifier=n.TextDocumentIdentifier=n.WorkspaceChange=n.WorkspaceEdit=n.DeleteFile=n.RenameFile=n.CreateFile=n.TextDocumentEdit=n.AnnotatedTextEdit=n.ChangeAnnotationIdentifier=n.ChangeAnnotation=n.TextEdit=n.Command=n.Diagnostic=n.CodeDescription=n.DiagnosticTag=n.DiagnosticSeverity=n.DiagnosticRelatedInformation=n.FoldingRange=n.FoldingRangeKind=n.ColorPresentation=n.ColorInformation=n.Color=n.LocationLink=n.Location=n.Range=n.Position=n.uinteger=n.integer=void 0,function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647}(n.integer||(n.integer={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647}(t=n.uinteger||(n.uinteger={})),function(e){e.create=function(e,n){return e===Number.MAX_VALUE&&(e=t.MAX_VALUE),n===Number.MAX_VALUE&&(n=t.MAX_VALUE),{line:e,character:n}},e.is=function(e){var n=e;return A.objectLiteral(n)&&A.uinteger(n.line)&&A.uinteger(n.character)}}(i=n.Position||(n.Position={})),function(e){e.create=function(e,n,t,r){if(A.uinteger(e)&&A.uinteger(n)&&A.uinteger(t)&&A.uinteger(r))return{start:i.create(e,n),end:i.create(t,r)};if(i.is(e)&&i.is(n))return{start:e,end:n};throw new Error("Range#create called with invalid arguments["+e+", "+n+", "+t+", "+r+"]")},e.is=function(e){var n=e;return A.objectLiteral(n)&&i.is(n.start)&&i.is(n.end)}}(r=n.Range||(n.Range={})),function(e){e.create=function(e,n){return{uri:e,range:n}},e.is=function(e){var n=e;return A.defined(n)&&r.is(n.range)&&(A.string(n.uri)||A.undefined(n.uri))}}(o=n.Location||(n.Location={})),function(e){e.create=function(e,n,t,i){return{targetUri:e,targetRange:n,targetSelectionRange:t,originSelectionRange:i}},e.is=function(e){var n=e;return A.defined(n)&&r.is(n.targetRange)&&A.string(n.targetUri)&&(r.is(n.targetSelectionRange)||A.undefined(n.targetSelectionRange))&&(r.is(n.originSelectionRange)||A.undefined(n.originSelectionRange))}}(n.LocationLink||(n.LocationLink={})),function(e){e.create=function(e,n,t,i){return{red:e,green:n,blue:t,alpha:i}},e.is=function(e){var n=e;return A.numberRange(n.red,0,1)&&A.numberRange(n.green,0,1)&&A.numberRange(n.blue,0,1)&&A.numberRange(n.alpha,0,1)}}(a=n.Color||(n.Color={})),function(e){e.create=function(e,n){return{range:e,color:n}},e.is=function(e){var n=e;return r.is(n.range)&&a.is(n.color)}}(n.ColorInformation||(n.ColorInformation={})),function(e){e.create=function(e,n,t){return{label:e,textEdit:n,additionalTextEdits:t}},e.is=function(e){var n=e;return A.string(n.label)&&(A.undefined(n.textEdit)||d.is(n))&&(A.undefined(n.additionalTextEdits)||A.typedArray(n.additionalTextEdits,d.is))}}(n.ColorPresentation||(n.ColorPresentation={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(n.Line truncated
|
||||
@@ -0,0 +1,7 @@
|
||||
/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* monaco-css version: 0.30.1(5a7ba61be909ae9e4889768a3453ebb0dec392e2)
|
||||
* Released under the MIT license
|
||||
* https://github.com/Microsoft/monaco-css/blob/master/LICENSE.md
|
||||
*-----------------------------------------------------------------------------*/
|
||||
!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-css-languageservice/parser/cssScanner",["require","exports"],e)}((function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Scanner=t.MultiLineStream=t.TokenType=void 0,function(e){e[e.Ident=0]="Ident",e[e.AtKeyword=1]="AtKeyword",e[e.String=2]="String",e[e.BadString=3]="BadString",e[e.UnquotedString=4]="UnquotedString",e[e.Hash=5]="Hash",e[e.Num=6]="Num",e[e.Percentage=7]="Percentage",e[e.Dimension=8]="Dimension",e[e.UnicodeRange=9]="UnicodeRange",e[e.CDO=10]="CDO",e[e.CDC=11]="CDC",e[e.Colon=12]="Colon",e[e.SemiColon=13]="SemiColon",e[e.CurlyL=14]="CurlyL",e[e.CurlyR=15]="CurlyR",e[e.ParenthesisL=16]="ParenthesisL",e[e.ParenthesisR=17]="ParenthesisR",e[e.BracketL=18]="BracketL",e[e.BracketR=19]="BracketR",e[e.Whitespace=20]="Whitespace",e[e.Includes=21]="Includes",e[e.Dashmatch=22]="Dashmatch",e[e.SubstringOperator=23]="SubstringOperator",e[e.PrefixOperator=24]="PrefixOperator",e[e.SuffixOperator=25]="SuffixOperator",e[e.Delim=26]="Delim",e[e.EMS=27]="EMS",e[e.EXS=28]="EXS",e[e.Length=29]="Length",e[e.Angle=30]="Angle",e[e.Time=31]="Time",e[e.Freq=32]="Freq",e[e.Exclamation=33]="Exclamation",e[e.Resolution=34]="Resolution",e[e.Comma=35]="Comma",e[e.Charset=36]="Charset",e[e.EscapedJavaScript=37]="EscapedJavaScript",e[e.BadEscapedJavaScript=38]="BadEscapedJavaScript",e[e.Comment=39]="Comment",e[e.SingleLineComment=40]="SingleLineComment",e[e.EOF=41]="EOF",e[e.CustomToken=42]="CustomToken"}(n=t.TokenType||(t.TokenType={}));var r=function(){function e(e){this.source=e,this.len=e.length,this.position=0}return e.prototype.substring=function(e,t){return void 0===t&&(t=this.position),this.source.substring(e,t)},e.prototype.eos=function(){return this.len<=this.position},e.prototype.pos=function(){return this.position},e.prototype.goBackTo=function(e){this.position=e},e.prototype.goBack=function(e){this.position-=e},e.prototype.advance=function(e){this.position+=e},e.prototype.nextChar=function(){return this.source.charCodeAt(this.position++)||0},e.prototype.peekChar=function(e){return void 0===e&&(e=0),this.source.charCodeAt(this.position+e)||0},e.prototype.lookbackChar=function(e){return void 0===e&&(e=0),this.source.charCodeAt(this.position-e)||0},e.prototype.advanceIfChar=function(e){return e===this.source.charCodeAt(this.position)&&(this.position++,!0)},e.prototype.advanceIfChars=function(e){if(this.position+e.length>this.source.length)return!1;for(var t=0;t<e.length;t++)if(this.source.charCodeAt(this.position+t)!==e[t])return!1;return this.advance(t),!0},e.prototype.advanceWhileChar=function(e){for(var t=this.position;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t},e}();t.MultiLineStream=r;var i="a".charCodeAt(0),o="f".charCodeAt(0),s="z".charCodeAt(0),a="A".charCodeAt(0),l="F".charCodeAt(0),c="Z".charCodeAt(0),d="0".charCodeAt(0),p="9".charCodeAt(0),h="~".charCodeAt(0),u="^".charCodeAt(0),m="=".charCodeAt(0),f="|".charCodeAt(0),g="-".charCodeAt(0),b="_".charCodeAt(0),y="%".charCodeAt(0),v="*".charCodeAt(0),w="(".charCodeAt(0),x=")".charCodeAt(0),S="<".charCodeAt(0),k=">".charCodeAt(0),C="@".charCodeAt(0),T="#".charCodeAt(0),E="$".charCodeAt(0),F="\\".charCodeAt(0),D="/".charCodeAt(0),_="\n".charCodeAt(0),R="\r".charCodeAt(0),P="\f".charCodeAt(0),z='"'.charCodeAt(0),I="'".charCodeAt(0),N=" ".charCodeAt(0),M="\t".charCodeAt(0),A=";".charCodeAt(0),O=":".charCodeAt(0),W="{".charCodeAt(0),L="}".charCodeAt(0),j="[".charCodeAt(0),U="]".charCodeAt(0),V=",".charCodeAt(0),K=".".charCodeAt(0),q="!".charCodeAt(0),B={};B[A]=n.SemiColon,B[O]=n.Colon,B[W]=n.CurlyL,B[L]=n.CurlyR,B[U]=n.BracketR,B[j]=n.BracketL,B[w]=n.ParenthesisL,B[x]=n.ParenthesisR,B[V]=n.Comma;var $={};$.em=n.EMS,$.ex=n.EXS,$.px=n.Length,$.cm=n.Length,$.mm=n.Length,$.in=n.Length,$.pt=n.Length,$.pc=n.Length,$.deg=n.Angle,$.rad=n.Angle,$.grad=n.Angle,$.ms=n.Time,$.s=n.Time,$.hz=n.Freq,$.khz=n.Freq,$["%"]=n.Percentage,$.fr=n.Percentage,$.dpi=n.Resolution,$.dpcm=n.Resolution;var G=function(){function e(){this.stream=new r(""),this.ignoreComment=!0,this.ignoreWhitespace=!0,this.inURL=!1}return e.prototype.setSource=function(e){this.stream=new r(e)},e.prototype.finishToken=function(e,t,n){return{offset:e,len:this.stream.pos()-e,type:t,text:n||this.stream.substring(e)}},e.prototype.substring=function(e,t){return this.stream.substring(e,e+t)},e.prototype.pos=function(){return this.stream.pos()},e.prototype.goBackTo=function(e){this.stream.goBackTo(e)},e.prototype.scanUnquotedString=function(){var e=this.stream.pos(),t=[];return this._unquotedString(t)?this.finishToken(e,n.UnquotedString,t.join("")):null},e.prototype.scan=function(){var e=this.trivia();if(null!==e)return e;var t=this.stream.pos();return this.stream.eos()?this.finishToken(t,n.EOF):this.scanNext(t)},e.prototype.scanNext=function(eLine truncated
|
||||
Reference in new issue
Block a user