@libmedia/avplayer 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/118.avplayer.js +1 -1
- package/dist/esm/453.avplayer.js +1 -1
- package/dist/esm/531.avplayer.js +1 -1
- package/dist/esm/791.avplayer.js +1 -1
- package/dist/esm/855.avplayer.js +1 -1
- package/dist/esm/904.avplayer.js +1 -1
- package/dist/esm/941.avplayer.js +1 -1
- package/dist/esm/avplayer.js +1 -1
- package/dist/types/AVPlayer.d.ts +51 -38
- package/dist/types/Controller.d.ts +1 -0
- package/dist/types/eventType.d.ts +1 -0
- package/dist/types/mse/MSEPipeline.d.ts +2 -2
- package/dist/types/type.d.ts +4 -0
- package/dist/umd/118.avplayer.js +1 -1
- package/dist/umd/453.avplayer.js +1 -1
- package/dist/umd/531.avplayer.js +1 -1
- package/dist/umd/791.avplayer.js +1 -1
- package/dist/umd/855.avplayer.js +1 -1
- package/dist/umd/904.avplayer.js +1 -1
- package/dist/umd/941.avplayer.js +1 -1
- package/dist/umd/avplayer.js +1 -1
- package/package.json +12 -12
package/dist/umd/941.avplayer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunklibmedia=self.webpackChunklibmedia||[]).push([[941],{85947:(e,t,a)=>{a.d(t,{A:()=>r});var i=a(134);class r{constructor(){(0,i.A)(this,"type",-1),(0,i.A)(this,"onStreamAdd",void 0)}async destroy(e){}}},34577:(e,t,a)=>{a.r(t),a.d(t,{default:()=>H});var i=a(134),r=a(80662),n=a.n(r),c=a(97860),o=a.n(c),d=a(14686),s=a(61499),l=a(63939),p=a(50932),f=(a(9599),a(4624)),h=a(9705),m=a(85947),u=a(37837),A=a(71517),g=a(77231),y=a(31866),I=a(33919),N=a(72739),x=a(62815),b=a(67659),S=a(59166),P=a(97077),R=a(82014),v=a(21477),k=a(64093),B=a(22576),V=a(95832),w=a(14769),M=a(44328),C=a(31865),U=a(93082),L=a(5783),_=a(82774),D=a(67672),T=a(95335),E=a(53260),z=a(13663),X=a(92647),G=a(50011),O=a(34677),W=a(60264);const F="src/avformat/formats/IMatroskaFormat.ts";class H extends m.A{constructor(){super(),(0,i.A)(this,"type",8),(0,i.A)(this,"context",void 0),(0,i.A)(this,"blockReader",void 0)}init(e){e.ioReader&&e.ioReader.setEndian(!0);const t={isLive:!0,firstCluster:-BigInt(1),segmentStart:-BigInt(1),header:{version:0,readVersion:0,maxIdLength:4,maxSizeLength:8,docType:"",docTypeVersion:0,docTypeReadVersion:0},seekHead:null,info:null,tracks:null,attachments:null,chapters:null,cues:null,tags:null,maxPts:g.Dh,currentCluster:{timeCode:BigInt(0),pos:-BigInt(1),block:{pos:-BigInt(1),size:-BigInt(1)},blockGroup:{block:null}},clusterIndexes:[],clusterIndexesPosMap:new(n())};e.privateData=this.context=t}analyzeStreams(e){const t="webm"===this.context.header.docType?y.N:y.e;this.context.tracks&&N.__(this.context.tracks.entry,(a=>{var i,r,n;const c=e.createStream();switch(c.privData=a,c.codecpar.codecId=t[a.codecId]||0,a.type){case 2:c.codecpar.codecType=1;break;case 1:c.codecpar.codecType=0;break;case 17:c.codecpar.codecType=3;break;default:c.codecpar.codecType=-1}a.language&&(c.metadata.language=a.language),a.name&&(c.metadata.title=a.name),a.audio?("A_PCM/FLOAT/IEEE"===a.codecName?64===a.audio.bitDepth?c.codecpar.codecId=65559:32===a.audio.bitDepth&&(c.codecpar.codecId=65557):"A_PCM/INT/BIG"===a.codecName?16===a.audio.bitDepth?c.codecpar.codecId=65537:24===a.audio.bitDepth?c.codecpar.codecId=65549:32===a.audio.bitDepth&&(c.codecpar.codecId=65545):"A_PCM/INT/LIT"===a.codecName&&(8===a.audio.bitDepth?c.codecpar.codecId=65541:16===a.audio.bitDepth?c.codecpar.codecId=65536:24===a.audio.bitDepth?c.codecpar.codecId=65548:32===a.audio.bitDepth&&(c.codecpar.codecId=65544)),c.codecpar.chLayout.nbChannels=a.audio.channels,c.codecpar.sampleRate=0|a.audio.sampleRate,c.codecpar.bitsPerCodedSample=a.audio.bitDepth):a.video&&(c.codecpar.width=a.video.pixelWidth,c.codecpar.height=a.video.pixelHeight,a.video.color&&(D.ai(a.video.color.primaries)&&(c.codecpar.colorPrimaries=a.video.color.primaries),D.ai(a.video.color.transferCharacteristics)&&(c.codecpar.colorTrc=a.video.color.transferCharacteristics),D.ai(a.video.color.range)&&(c.codecpar.colorRange=a.video.color.range),D.ai(a.video.color.matrixCoefficients)&&(c.codecpar.colorSpace=a.video.color.matrixCoefficients)));let o=0;if("V_MS/VFW/FOURCC"===a.codecId&&(null===(i=a.codecPrivate)||void 0===i?void 0:i.size)>=40)c.codecpar.bitsPerCodedSample=a.codecPrivate.data[15]<<8|a.codecPrivate.data[14],c.codecpar.codecTag=a.codecPrivate.data[19]<<24|a.codecPrivate.data[18]<<16|a.codecPrivate.data[17]<<8|a.codecPrivate.data[16],c.codecpar.codecId=E.nz[c.codecpar.codecTag]||0,0===c.codecpar.codecId&&(c.codecpar.codecId,z.h[c.codecpar.codecTag]),o=40;else if("V_QUICKTIME"===a.codecId&&(null===(r=a.codecPrivate)||void 0===r?void 0:r.size)>=21){const e=1===c.codecpar.codecType?z.u:z.h;c.codecpar.codecTag=a.codecPrivate.data[3]<<24|a.codecPrivate.data[2]<<16|a.codecPrivate.data[1]<<8|a.codecPrivate.data[0];const t=e[c.codecpar.codecTag];if(t){const e=new Uint8Array(4),t=Number(BigInt.asIntN(32,a.codecPrivate.size));e[0]=t>>>24&255,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=255&t,a.codecPrivate.size+=BigInt(4),a.codecPrivate.data=(0,X.A)(Uint8Array,[e,a.codecPrivate.data])}c.codecpar.codecId=t||0}if(null!==(n=a.codecPrivate)&&void 0!==n&&n.data&&a.codecPrivate.size-BigInt(Math.floor(o))>0){let e=a.codecPrivate.data.subarray(o);if(94212===c.codecpar.codecId||94230===c.codecpar.codecId){let t=G.decode(e).split(/\r?\n/);for(let e=0;e<t.length;e++)if("[Events]"===t[e].trim()){t=t.slice(0,e);break}t.push("[Events]"),t.push("Format: ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text"),e=G.encode(t.join("\n"))}if(c.codecpar.extradataSize=e.length,c.codecpar.extradata=(0,u.sY)(e.length),(0,d.lW)(c.codecpar.extradata,e.length,e),c.codecpar.extradata)switch(c.codecpar.codecId){case 27:{const e=(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize);x.XC(c,e),W.Bs(e)?c.codecpar.bitFormat=2:c.codecpar.bitFormat=1;break}case 173:{const e=(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize);b.XC(c,e),W.Bs(e)?c.codecpar.bitFormat=2:c.codecpar.bitFormat=1;break}case 196:{const e=(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize);S.XC(c,e),W.Bs(e)?c.codecpar.bitFormat=2:c.codecpar.bitFormat=1;break}case 225:v.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 139:P.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 167:R.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86018:V.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86017:k.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86076:B.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86028:if(c.codecpar.extradataSize>w.ob){const e=new C.A((0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));if("fLaC"===e.readString(4))for(;e.remainingSize();){const t=e.readUint8(),a=e.readUint24(),i=-129&t;if(0===i){const t=e.readBuffer(a);(0,u.Eb)(c.codecpar.extradata),c.codecpar.extradata=(0,u.sY)(t.length),c.codecpar.extradataSize=t.length,(0,d.lW)(c.codecpar.extradata,t.length,t);break}e.skip(i)}}c.codecpar.extradataSize===w.ob&&w.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize))}else{let e;86018===c.codecpar.codecId&&(e=V.Ij(c.codecpar)),e&&(c.codecpar.extradataSize=e.length,c.codecpar.extradata=(0,u.sY)(c.codecpar.extradataSize),(0,d.lW)(c.codecpar.extradata,c.codecpar.extradataSize,e))}}this.context.info&&(c.timeBase.num=1,this.context.info.timestampScale?c.timeBase.den=1e3*g.SF/this.context.info.timestampScale|0:(c.timeBase.den=1e3,this.context.info.timestampScale=g.SF),this.context.info.duration&&(c.duration=BigInt(Math.floor(this.context.info.duration)))),(null==a.default||a.default)&&(c.disposition|=1),a.encodings&&N.__(a.encodings.entry,(e=>{e.compression&&(0,O.A)(e.compression.algo)&&(a.needDecompression=!0),e.encryption&&(0,O.A)(e.encryption.algo)&&(a.needDecryption=!0)}))})),this.context.attachments&&N.__(this.context.attachments.entry,(t=>{const a=e.createStream();a.codecpar.codecType=4,a.privData=t,t.data&&(a.codecpar.extradataSize=Number(BigInt.asIntN(32,t.data.size)),a.codecpar.extradata=(0,u.sY)(a.codecpar.extradataSize),(0,d.lW)(a.codecpar.extradata,a.codecpar.extradataSize,t.data.data))})),this.context.tags&&N.__(this.context.tags.entry,(t=>{var a;if("DURATION"===(null===(a=t.tag)||void 0===a?void 0:a.name)){let a=t.tag.string.replaceAll("\0","").split("."),i=a[0].split(":"),r=BigInt(+i[0])*BigInt(36e8)+BigInt(+i[1])*BigInt(6e7)+BigInt(+i[2])*BigInt(1e6)+BigInt(+a[1])/BigInt(1e3);const n=(0,U.A)(e.streams,t.target.trackUid);n&&(n.duration=(0,M.k)(r,g.KR,n.timeBase))}})),this.context.chapters&&N.__(this.context.chapters.entry,(t=>{const a=t.atom;a&&N.__(a,(t=>{var a,i;e.chapters.push({id:t.uid,start:t.start,end:t.end,timeBase:{num:1,den:1e9},metadata:{title:(null===(a=t.display)||void 0===a?void 0:a.title)||"",language:(null===(i=t.display)||void 0===i?void 0:i.language)||""}})}))}))}async readHeader(e){if(440786851!==await(0,I.aL)(e,this.context.header.maxIdLength))return f.z3("not matroska format",F,460),h.LR;const t=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(this.context.header=T.X$(this.context.header,await(0,I.Pb)(e,t,I.jt)),408125543!==await(0,I.aL)(e,this.context.header.maxIdLength))return f.z3("not matroska format",F,469),h.LR;const a=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);this.context.segmentStart=e.ioReader.getPos();const i=e.ioReader.getPos()+a,r=new(o());let n=!1,c=!1;for(;e.ioReader.getPos()<i||!n||!c;){const t=e.ioReader.getPos(),a=await(0,I.aL)(e,this.context.header.maxIdLength);if(a===h.LR){await this.syncTopLevelElement(e,2);continue}const i=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(i!==BigInt(h.LR)){if(290298740===a)this.context.isLive=!1,this.context.seekHead=await(0,I.Pb)(e,i,I.Cr);else if(475249515===a)this.context.isLive=!1,this.context.cues=await(0,I.Pb)(e,i,I.eG);else if(272869232===a)this.context.isLive=!1,this.context.chapters=await(0,I.Pb)(e,i,I.Y0);else if(357149030===a)this.context.info=await(0,I.Pb)(e,i,I.qi);else if(307544935===a)this.context.tags=await(0,I.Pb)(e,i,I.hK);else if(423732329===a)this.context.attachments=await(0,I.Pb)(e,i,I.qp);else if(374648427===a)n=!0,this.context.tracks=await(0,I.Pb)(e,i,I.Wy);else if(524531317===a){if(c=!0,this.context.firstCluster=t,this.context.isLive||!this.context.seekHead||!(1&e.ioReader.flags))break;const a=this.context.seekHead.entry;let i=0;for(;i<a.length;i++)if(!r.has(a[i].id)){await e.ioReader.seek(a[i].pos+this.context.segmentStart);break}if(i===a.length)break}else await e.ioReader.skip(Number(BigInt.asIntN(32,i)));r.add(a)}else await this.syncTopLevelElement(e,2)}return this.context.firstCluster>0&&await e.ioReader.seek(this.context.firstCluster),this.analyzeStreams(e),0}parseAdditions(e,t){for(let i=0;i<t.entry.length;i++){var a;const r=t.entry[i];if(null!==(a=r.additional)&&void 0!==a&&a.size){4===r.additionalId&&f.R8("ITU_T_T35 not support now",F,563);const t=(0,u.sY)(r.additional.data.length+8);_.Cv(t,BigInt(r.additionalId>>>0)),(0,d.lW)(t+8,r.additional.data.length,r.additional.data),(0,A.Ow)(e,15,t,r.additional.data.length+8)}}}async parseBlock(e,t){var a,i,r;const n=(null===(a=this.context.currentCluster.block)||void 0===a?void 0:a.data)||this.context.currentCluster.blockGroup.block.data;let c=null===(i=this.context.currentCluster.block)||void 0===i?void 0:i.pos;c<0&&(c=this.context.currentCluster.blockGroup.block.pos);let o,m=-1,y=BigInt(0);null!==(r=this.context.currentCluster.blockGroup)&&void 0!==r&&r.block&&(o=this.context.currentCluster.blockGroup.additions,m=this.context.currentCluster.blockGroup.reference?0===this.context.currentCluster.blockGroup.reference.length?1:0:1,this.context.currentCluster.blockGroup.duration&&(y=this.context.currentCluster.blockGroup.duration)),this.blockReader?this.blockReader.resetBuffer(n):this.blockReader=new C.A(n);const N=this.blockReader.getPos(),x=Number(BigInt.asUintN(32,await(0,I.Qb)(this.blockReader,8))),b=(0,L.A)(e.streams,x);if(!b)return f.z3(`invalid track number ${x}`,F,613),h.OY;const S=this.blockReader.readInt16(),P=this.blockReader.readUint8();-1===m&&(m=128&P?1:0);let R=0,v=[];switch(P>>>1&3){case 1:{R=this.blockReader.readUint8()+1;let e=0;for(let t=0;t<R-1;t++){let t=0;for(;;){const e=this.blockReader.readUint8();if(0===e)break;if(255!==e){t+=e;break}t+=255}e+=t,v.push(t)}v.push(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-N))-e);break}case 3:{R=this.blockReader.readUint8()+1,v.push(await(0,I.Ag)(this.blockReader,4));let e=v[0];for(let t=1;t<R-1;t++){let a=await(0,I.pf)(this.blockReader,4)+v[t-1];e+=a,v.push(a)}v.push(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-N))-e);break}case 2:R=this.blockReader.readUint8()+1;const e=(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-N)))/R;for(let t=0;t<R;t++)v.push(e);break;case 0:R=1,v.push(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-N)))}const k=b.privData,B=k.timeScale||1;if(k.needDecryption)throw new Error("not support encryption stream");let V=(this.context.currentCluster.timeCode+BigInt(Math.floor(S*B)))*BigInt(0|this.context.info.timestampScale);k.codecDelay&&(V-=k.codecDelay),V/=BigInt(1e3),V=(0,M.k)(V,g.KR,b.timeBase),y=BigInt(Math.floor(Number(BigInt.asIntN(32,y))*B))*BigInt(0|this.context.info.timestampScale),y/=BigInt(1e3),y=(0,M.k)(y,g.KR,b.timeBase);for(let a=0;a<R;a++){const i=0!==a?(0,A._5)():t;let r,n=v[a],h=0;if(k.needDecompression){const e=k.encodings.entry.find((e=>!!e.compression));3===e.compression.algo?(r=e.compression.settings.data,n+=r.length,h=r.length):f.h2(`not support compression stream, algo: ${e.compression.algo}`,F,723)}p.M[17](i+56,c+this.blockReader.getPos()),p.M[15](i+32,b.index),(0,d.Mr)(i+72,b.timeBase[s.o9],8),p.M[17](i+8,V),p.M[15](i+28,n),p.M[17](i+48,y);const g=(0,u.sY)(n);r&&(0,d.lW)(g,h,r),(0,d.lW)(g+h,v[a],this.blockReader.readBuffer(v[a])),(0,A.NX)(i,g,n),0!==b.codecpar.codecType?(p.M[15](i+36,1|l.f[15](i+36)),p.M[17](i+16,V)):(m&&p.M[15](i+36,1|l.f[15](i+36)),27!==b.codecpar.codecId&&173!==b.codecpar.codecId&&196!==b.codecpar.codecId||p.M[15](i+80,b.codecpar.bitFormat)),o&&this.parseAdditions(i,o),0!==a&&e.interval.packetBuffer.push(i),this.context.maxPts<V&&(this.context.maxPts=V)}return this.context.currentCluster.block={pos:-BigInt(1),size:-BigInt(1)},this.context.currentCluster.blockGroup={block:null},0}addClusterIndex(e){if(this.context.clusterIndexesPosMap.has(e.pos))return;const t=N.El(this.context.clusterIndexes,(t=>t.time<e.time?1:-1));t>-1?(this.context.clusterIndexesPosMap.set(e.pos,t),this.context.clusterIndexes.splice(t,0,e)):(this.context.clusterIndexesPosMap.set(e.pos,this.context.clusterIndexes.length),this.context.clusterIndexes.push(e))}async readAVPacket_(e,t){const a=e.ioReader.getPos(),i=await(0,I.aL)(e,this.context.header.maxIdLength);if(i===h.LR)return await this.syncTopLevelElement(e),this.readAVPacket_(e,t);const r=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(r===BigInt(h.LR))return await this.syncTopLevelElement(e),this.readAVPacket_(e,t);if(524531317===i){this.context.currentCluster.pos=a,this.context.currentCluster.timeCode=BigInt(0),await(0,I.Pb)(e,r,I.GZ,this.context.currentCluster,[163,160]),this.addClusterIndex({time:this.context.currentCluster.timeCode,pos:a});let i=await this.parseBlock(e,t);if(i===h.OY)return this.readAVPacket_(e,t);if(i<0)return i}else if(163===i){this.context.currentCluster.block={pos:e.ioReader.getPos(),size:r,data:await e.ioReader.readBuffer(Number(BigInt.asIntN(32,r)))};let a=await this.parseBlock(e,t);if(a===h.OY)return this.readAVPacket_(e,t);if(a<0)return a}else{if(160!==i)return 475249515===i||307544935===i||423732329===i||272869232===i||357149030===i||374648427===i||290298740===i?(await e.ioReader.skip(Number(BigInt.asIntN(32,r))),this.readAVPacket_(e,t)):(await this.syncTopLevelElement(e),this.readAVPacket_(e,t));{await(0,I.Pb)(e,r,I.Wg,this.context.currentCluster.blockGroup);let a=await this.parseBlock(e,t);if(a===h.OY)return this.readAVPacket_(e,t);if(a<0)return a}}return 0}async readAVPacket(e,t){try{return await this.readAVPacket_(e,t)}catch(t){return-1048576!==e.ioReader.error?(f.z3(`read packet error, ${t}`,F,898),h.LR):e.ioReader.error}}async syncTopLevelElement(e,t=3){let a=g.Dh;for(;;)try{if(8&e.ioReader.flags)break;const i=e.ioReader.getPos(),r=await e.ioReader.peekUint32();if(524531317===r||475249515===r||307544935===r||423732329===r||272869232===r||357149030===r||374648427===r||290298740===r){a=i;let r=0;await e.ioReader.skip(4);const n=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(n===BigInt(h.LR)){await e.ioReader.seek(i+BigInt(1));continue}for(await e.ioReader.skip(Number(BigInt.asIntN(32,n)));r<=t;){const t=await(0,I.aL)(e,this.context.header.maxIdLength),a=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(524531317!==t&&475249515!==t&&307544935!==t&&423732329!==t&&272869232!==t&&357149030!==t&&374648427!==t&&290298740!==t)break;r++,await e.ioReader.skip(Number(BigInt.asIntN(32,a)))}if(!(r<t))break;await e.ioReader.seek(a+BigInt(1)),a=g.Dh}else await e.ioReader.skip(1),a=g.Dh}catch(e){break}a!==g.Dh&&await e.ioReader.seek(a)}async seek(e,t,a,i){var r;const n=e.ioReader.getPos(),c=(0,M.k)(a,t.timeBase,g.KR);let o=g.Dh;if(null!==(r=this.context.cues)&&void 0!==r&&r.entry.length){const e=t.privData;for(let t=0;t<this.context.cues.entry.length;t++)if((this.context.cues.entry[t].time||BigInt(0))*BigInt(0|this.context.info.timestampScale)/BigInt(1e3)>c){const a=this.context.cues.entry[Math.max(t-1,0)].pos;if(a.length){const t=a.find((t=>t.track===e.number));if(t){o=t.pos+this.context.segmentStart;break}}}}if(o===g.Dh&&this.context.clusterIndexes.length){for(let e=0;e<this.context.clusterIndexes.length;e++)if(this.context.clusterIndexes[e].time*BigInt(0|this.context.info.timestampScale)/BigInt(1e3)>c){o=this.context.clusterIndexes[Math.max(e-1,0)].pos;break}o===g.Dh&&(o=this.context.clusterIndexes[this.context.clusterIndexes.length-1].pos)}return o!==g.Dh?(await e.ioReader.seek(o),n):BigInt(h.E$)}getAnalyzeStreamsCount(){return 0}}},13663:(e,t,a)=>{a.d(t,{h:()=>r,u:()=>n});var i=a(79682);const r={[(0,i.A)("mp4v")]:12,[(0,i.A)("DIVX")]:12,[(0,i.A)("XVID")]:12,[(0,i.A)("3IV2")]:12,[(0,i.A)("vvc1")]:196,[(0,i.A)("vvi1")]:196,[(0,i.A)("hev1")]:173,[(0,i.A)("hvc1")]:173,[(0,i.A)("dvhe")]:173,[(0,i.A)("hev1")]:173,[(0,i.A)("avc1")]:27,[(0,i.A)("avc2")]:27,[(0,i.A)("avc3")]:27,[(0,i.A)("avc4")]:27,[(0,i.A)("ai5p")]:27,[(0,i.A)("ai5q")]:27,[(0,i.A)("ai52")]:27,[(0,i.A)("ai53")]:27,[(0,i.A)("ai55")]:27,[(0,i.A)("ai56")]:27,[(0,i.A)("ai1p")]:27,[(0,i.A)("ai1q")]:27,[(0,i.A)("ai12")]:27,[(0,i.A)("ai13")]:27,[(0,i.A)("ai15")]:27,[(0,i.A)("ai16")]:27,[(0,i.A)("AVin")]:27,[(0,i.A)("aivx")]:27,[(0,i.A)("rv64")]:27,[(0,i.A)("xalg")]:27,[(0,i.A)("avlg")]:27,[(0,i.A)("dva1")]:27,[(0,i.A)("dvav")]:27,[(0,i.A)("vp08")]:139,[(0,i.A)("vp09")]:167,[(0,i.A)("av01")]:225},n={[(0,i.A)("mp4a")]:86018,[(0,i.A)("ac-3")]:86019,[(0,i.A)("sac3")]:86019,[(0,i.A)("ac-4")]:86119,[(0,i.A)("dtsc")]:86020,[(0,i.A)("dtsh")]:86020,[(0,i.A)("dtsl")]:86020,[(0,i.A)("dtse")]:86020,[(0,i.A)("DTS ")]:86020,[(0,i.A)("ec-3")]:86056,[(0,i.A)(".mp3")]:86017,[(0,i.A)("mp3 ")]:86017,1836253269:86017,[(0,i.A)("spex")]:86051,[(0,i.A)("SPXN")]:86051,[(0,i.A)("fLaC")]:86028,[(0,i.A)("Opus")]:86076,[(0,i.A)("alaw")]:65543,[(0,i.A)("ulaw")]:65542,[(0,i.A)("fl32")]:65557,[(0,i.A)("fl64")]:65559,[(0,i.A)("twos")]:65537,[(0,i.A)("lpcm")]:65536,[(0,i.A)("sowt")]:65536,[(0,i.A)("in24")]:65548,[(0,i.A)("in32")]:65544,[(0,i.A)("sowt")]:65540,[(0,i.A)("raw ")]:65541,[(0,i.A)("NONE")]:65541}},5783:(e,t,a)=>{function i(e,t){for(let a=0;a<e.length;a++)if(e[a].privData.number===t)return e[a]}a.d(t,{A:()=>i})},93082:(e,t,a)=>{function i(e,t){for(let a=0;a<e.length;a++)if(e[a].privData.uid===t)return e[a]}a.d(t,{A:()=>i})},33919:(e,t,a)=>{a.d(t,{Ag:()=>N,Cr:()=>s,GZ:()=>y,Pb:()=>v,Qb:()=>b,Wg:()=>g,Wy:()=>p,Y0:()=>h,aL:()=>R,eG:()=>m,hK:()=>A,jt:()=>I,pf:()=>x,qi:()=>l,qp:()=>f});var i=a(4624),r=a(9705),n=a(67672),c=a(72739);const o="src/avformat/formats/matroska/imatroska.ts",d=BigInt(20971520),s={19899:{type:9,isArray:!0,filedName:"entry",child:{21419:{type:1,filedName:"id"},21420:{type:2,filedName:"pos"}}}},l={29604:{type:2,filedName:"segmentUUID"},2807729:{type:1,filedName:"timestampScale"},17545:{type:5,filedName:"duration"},31657:{type:7,filedName:"title"},19840:{type:7,filedName:"muxingApp"},22337:{type:7,filedName:"writingApp"},17505:{type:8,filedName:"dateUTC"}},p={174:{type:9,isArray:!0,filedName:"entry",child:{215:{type:1,filedName:"number"},29637:{type:1,filedName:"uid"},131:{type:1,filedName:"type"},21358:{type:7,filedName:"name"},136:{type:10,filedName:"default"},185:{type:10,filedName:"enabled"},2274716:{type:7,filedName:"language"},2306383:{type:6,filedName:"timeScale"},134:{type:7,filedName:"codecId"},2459272:{type:7,filedName:"codecName"},25506:{type:8,filedName:"codecPrivate"},225:{type:9,filedName:"audio",child:{181:{type:5,filedName:"sampleRate"},30901:{type:5,filedName:"outSampleRate"},25188:{type:1,filedName:"bitDepth"},159:{type:1,filedName:"channels"}}},224:{type:9,filedName:"video",child:{2327523:{type:1,filedName:"framerate"},21680:{type:1,filedName:"displayWidth"},21690:{type:1,filedName:"displayHeight"},176:{type:1,filedName:"pixelWidth"},186:{type:1,filedName:"pixelHeight"},3061028:{type:8,filedName:"colorSpace"},21440:{type:1,filedName:"alphaMode"},21936:{type:9,filedName:"color",child:{21937:{type:1,filedName:"matrixCoefficients"},21938:{type:1,filedName:"bitsPerChannel"},21941:{type:1,filedName:"cbSubHorz"},21942:{type:1,filedName:"cbSubVert"},21939:{type:1,filedName:"chromaSubHorz"},21940:{type:1,filedName:"chromaSubVert"},21943:{type:1,filedName:"chromaSitingHorz"},21944:{type:1,filedName:"chromaSitingVert"},21945:{type:1,filedName:"range"},21946:{type:1,filedName:"transferCharacteristics"},21947:{type:1,filedName:"primaries"},21948:{type:1,filedName:"maxCll"},21949:{type:1,filedName:"maxFall"},21968:{type:9,filedName:"masteringMeta",child:{21969:{type:5,filedName:"rx"},21970:{type:5,filedName:"ry"},21971:{type:5,filedName:"gx"},21972:{type:5,filedName:"gy"},21973:{type:5,filedName:"bx"},21974:{type:5,filedName:"by"},21975:{type:5,filedName:"whiteX"},21976:{type:5,filedName:"whiteY"},21978:{type:5,isArray:!0,filedName:"minLuminance"},21977:{type:5,filedName:"maxLuminance"}}}}},30320:{type:9,filedName:"projection",child:{30321:{type:1,filedName:"type"},30322:{type:8,filedName:"private"},30323:{type:5,filedName:"yaw"},30324:{type:5,filedName:"pitch"},30325:{type:5,filedName:"roll"}}},21682:{type:1,filedName:"displayUnit"},154:{type:1,filedName:"interlaced"},157:{type:1,filedName:"fieldOrder"},21432:{type:1,filedName:"stereoMode"},21683:{type:1,filedName:"aspectRatio"}}},226:{type:9,filedName:"operations",child:{227:{type:9,isArray:!0,filedName:"entry",child:{228:{type:9,isArray:!0,filedName:"planes",child:{230:{type:1,filedName:"type"},229:{type:1,filedName:"uid"}}}}}}},28032:{type:9,filedName:"encodings",child:{25152:{type:9,isArray:!0,filedName:"entry",child:{20530:{type:1,filedName:"scope"},20531:{type:1,filedName:"type"},20532:{type:9,filedName:"compression",child:{16980:{type:1,filedName:"algo"},16981:{type:8,filedName:"settings"}}},20533:{type:9,filedName:"encryption",child:{18401:{type:1,filedName:"algo"},18402:{type:8,filedName:"keyId"}}}}}}}}}},f={24999:{type:9,isArray:!0,filedName:"entry",child:{18094:{type:1,filedName:"uid"},18030:{type:7,filedName:"name"},18016:{type:7,filedName:"mime"},18046:{type:7,filedName:"description"},18012:{type:8,filedName:"data"}}}},h={17849:{type:9,isArray:!0,filedName:"entry",child:{182:{type:9,isArray:!0,filedName:"atom",child:{145:{type:2,filedName:"start"},146:{type:2,filedName:"end"},29636:{type:1,filedName:"uid"},128:{type:9,filedName:"display",child:{133:{type:7,filedName:"title"},17276:{type:7,filedName:"language"}}}}}}}},m={187:{type:9,isArray:!0,filedName:"entry",child:{179:{type:2,filedName:"time"},183:{type:9,isArray:!0,filedName:"pos",child:{247:{type:1,filedName:"track"},241:{type:2,filedName:"pos"}}}}}},u={17827:{type:7,filedName:"name"},17543:{type:7,filedName:"string"},17530:{type:7,filedName:"language"},17540:{type:1,filedName:"default"},17588:{type:1,filedName:"default"},26568:{type:9,filedName:"sub"}};u[26568].child=u;const A={29555:{type:9,isArray:!0,filedName:"entry",child:{26568:{type:9,filedName:"tag",child:u},25536:{type:9,filedName:"target",child:{25546:{type:7,filedName:"type"},26826:{type:1,filedName:"typeValue"},25541:{type:1,filedName:"trackUid"},25540:{type:1,filedName:"chapterUid"},25542:{type:1,filedName:"attachUid"}}}}}},g={161:{type:8,filedName:"block"},30113:{type:9,filedName:"additions",child:{166:{type:9,isArray:!0,filedName:"entry",child:{238:{type:1,filedName:"additionalId"},165:{type:8,filedName:"additional"}}}}},155:{type:2,filedName:"duration"},30114:{type:4,filedName:"discardPadding"},251:{type:4,isArray:!0,filedName:"reference"},164:{type:10,filedName:"nonSimple"}},y={163:{type:8,filedName:"block"},160:{type:9,filedName:"blockGroup",child:g},231:{type:2,filedName:"timeCode"},167:{type:2,filedName:"pos"},171:{type:2,filedName:"prevSize"}},I={17030:{type:1,filedName:"version"},17143:{type:1,filedName:"readVersion"},17138:{type:1,filedName:"maxIdLength"},17139:{type:1,filedName:"maxSizeLength"},17026:{type:7,filedName:"docType"},17031:{type:1,filedName:"docTypeVersion"},17029:{type:1,filedName:"docTypeReadVersion"}};async function N(e,t){const a=e.getPos();let n=await e.readUint8();if(!n)return i.z3(`0x00 as pos ${a} invalid as first byte of an EBML number`,o,766),r.LR;let c=1;for(;!(128&n);)c++,n<<=1;if(n&=127,c>t)return i.z3(`Length ${c} indicated by an EBML number's first byte ${n.toString(16)} at pos ${a} exceeds max length ${t}.`,o,779),r.LR;let d=n>>>c-1;for(;--c;)d<<=8,d|=await e.readUint8();return d}async function x(e,t){const a=e.getPos();return await N(e,t)-((1<<7*Number(BigInt.asIntN(32,e.getPos()-a))-1)-1)}async function b(e,t){const a=e.getPos();let n=await e.readUint8(),c=1;if(!n)return i.z3(`0x00 as pos ${a} invalid as first byte of an EBML number`,o,813),BigInt(r.LR);for(;!(128&n);)c++,n<<=1;if(n&=127,c>t)return i.z3(`Length ${c} indicated by an EBML number's first byte ${n.toString(16)} at pos ${a} exceeds max length ${t}.`,o,824),BigInt(r.LR);let d=BigInt(Math.floor(n>>>c-1));for(;--c;){d<<=BigInt(8);const t=await e.readUint8();d|=BigInt(Math.floor(t))}return d}async function S(e,t){switch(t){case BigInt(0):return 0;case BigInt(1):return e.ioReader.readUint8();case BigInt(2):return e.ioReader.readUint16();case BigInt(3):return e.ioReader.readUint24();case BigInt(4):return e.ioReader.readUint32();case BigInt(8):return e.ioReader.readUint64()}let a=BigInt(0),i=0;for(;i++<t;){const t=await e.ioReader.readUint8();a=a<<BigInt(8)|BigInt.asUintN(64,BigInt(Math.floor(t)))}return a}async function P(e,t){switch(t){case BigInt(0):return 0;case BigInt(1):return e.ioReader.readInt8();case BigInt(2):return e.ioReader.readInt16();case BigInt(4):return e.ioReader.readInt32();case BigInt(8):return e.ioReader.readInt64()}let a=BigInt(0),i=0;for(;i++<t;){const t=await e.ioReader.readUint8();a=a<<BigInt(8)|BigInt.asUintN(64,BigInt(Math.floor(t)))}return t===BigInt(3)?Number(BigInt.asIntN(32,BigInt.asIntN(24,a))):BigInt.asIntN(64,a)}async function R(e,t){const a=e.ioReader.getPos();let n=await e.ioReader.peekUint8();if(!n)return i.z3(`0x00 as pos ${a} invalid as first byte of an EBML number`,o,909),r.LR;let c=1;for(;!(128&n);)c++,n<<=1;if(c>t)return i.z3(`Length ${c} indicated by an EBML number's first byte ${n.toString(16)} at pos ${a} exceeds max length ${t}.`,o,921),r.LR;let d=0;for(;c--;)d<<=8,d|=await e.ioReader.readUint8();return d}async function v(e,t,a,i={},r=[]){return await async function(e,t,a){const i=e.privateData,r=e.ioReader.getPos();for(;e.ioReader.getPos()<r+t;){const t=await R(e,i.header.maxIdLength),r=await b(e.ioReader,i.header.maxSizeLength);if(e.ioReader.getPos(),!1===await a(t,r))return}}(e,t,(async(t,o)=>{if(a[t]){const r=a[t];let c;switch(r.type){case 1:c=await S(e,o);break;case 2:c=await S(e,o),n.ai(c)&&(c=BigInt(c));break;case 3:c=await P(e,o);break;case 4:c=await P(e,o),n.ai(c)&&(c=BigInt(c));break;case 6:case 5:c=await async function(e,t){return t===BigInt(4)?e.ioReader.readFloat():t===BigInt(8)?e.ioReader.readDouble():(await e.ioReader.skip(Number(BigInt.asIntN(32,t))),0)}(e,o);break;case 7:c=await e.ioReader.readString(Number(BigInt.asIntN(32,o)));break;case 10:c=!!await S(e,o);break;case 8:c={pos:e.ioReader.getPos(),size:o,data:o<d?await e.ioReader.readBuffer(Number(BigInt.asIntN(32,o))):null};break;case 9:c=r.child?await v(e,o,r.child):{};break;default:await e.ioReader.skip(Number(BigInt.asIntN(32,o)))}if(null!=c)if(r.isArray){const e=i[r.filedName]||[];e.push(c),i[r.filedName]=e}else i[r.filedName]=c}else await e.ioReader.skip(Number(BigInt.asIntN(32,o)));if(r.length&&c.zy(r,t))return!1})),i}},31866:(e,t,a)=>{a.d(t,{N:()=>r,e:()=>i});const i={A_AAC:86018,A_AC3:86019,A_ALAC:86032,A_DTS:86020,A_EAC3:86056,A_FLAC:86028,A_MLP:86045,"A_MPEG/L2":86016,"A_MPEG/L1":86058,"A_MPEG/L3":86017,A_OPUS:86076,"A_OPUS/EXPERIMENTAL":86076,"A_PCM/FLOAT/IEEE":65557,"A_PCM/INT/BIG":65537,"A_PCM/INT/LIT":65536,"A_QUICKTIME/QDMC":86066,"A_QUICKTIME/QDM2":86035,"A_REAL/14_4":77824,"A_REAL/28_8":77825,"A_REAL/ATRC":86047,"A_REAL/COOK":86036,"A_REAL/SIPR":86057,A_TRUEHD:86060,A_TTA1:86038,A_VORBIS:86021,A_WAVPACK4:86041,"D_WEBVTT/SUBTITLES":94226,"D_WEBVTT/CAPTIONS":94226,"D_WEBVTT/DESCRIPTIONS":94226,"D_WEBVTT/METADATA":94226,"S_TEXT/UTF8":94225,"S_TEXT/ASCII":94210,"S_TEXT/ASS":94230,"S_TEXT/SSA":94230,S_ASS:94230,S_SSA:94230,S_VOBSUB:94208,S_DVBSUB:94209,"S_HDMV/PGS":94214,"S_HDMV/TEXTST":94231,V_AV1:225,V_DIRAC:116,V_FFV1:33,V_MJPEG:7,V_MPEG1:1,V_MPEG2:2,"V_MPEG4/ISO/ASP":12,"V_MPEG4/ISO/AP":12,"V_MPEG4/ISO/SP":12,"V_MPEG4/ISO/AVC":27,"V_MPEGH/ISO/HEVC":173,"V_MPEGH/ISO/VVC":196,"V_MPEG4/MS/V3":16,V_PRORES:147,"V_REAL/RV10":5,"V_REAL/RV20":6,"V_REAL/RV30":68,"V_REAL/RV40":69,V_SNOW:208,V_THEORA:30,V_UNCOMPRESSED:13,V_VP8:139,V_VP9:167},r={V_VP8:139,V_VP9:167,V_AV1:225,A_VORBIS:86021,A_OPUS:86076,"D_WEBVTT/SUBTITLES":94226,"D_WEBVTT/CAPTIONS":94226,"D_WEBVTT/DESCRIPTIONS":94226,"D_WEBVTT/METADATA":94226}},53260:(e,t,a)=>{a.d(t,{gi:()=>r,nz:()=>n});var i=a(79682);const r={1:65541,2:69638,3:65557,6:65543,7:65542,10:86052,16:69664,17:69633,23:69664,32:69646,34:86037,49:86046,50:86046,56:73728,66:86068,69:69643,20:69643,64:69643,80:86016,85:86017,87:73728,88:73729,97:69635,98:69634,100:69643,105:69633,117:86079,131:86069,255:86018,273:86068,304:86057,309:86106,352:86023,353:86024,354:86053,355:86054,357:86095,358:86096,384:86116,512:69644,533:86022,534:86022,624:86047,654:86111,655:69660,848:86114,1025:86043,1026:86074,1280:86081,1281:86081,5376:86046,5377:86037,5632:86018,5634:86065,8192:86019,8193:86020,8264:86085,8738:86069,27765:65542,28781:86018,16707:86018,16768:86116,22858:81922,29338:86069,33152:86116,41216:86068,41222:86018,41225:86051,61868:86028,65534:86112,21318:69645,22127:86021},n={[(0,i.A)("H261")]:3,[(0,i.A)("H263")]:4,[(0,i.A)("X263")]:4,[(0,i.A)("T263")]:4,[(0,i.A)("L263")]:4,[(0,i.A)("VX1K")]:4,[(0,i.A)("ZyGo")]:4,[(0,i.A)("M263")]:4,[(0,i.A)("lsvm")]:4,[(0,i.A)("I263")]:20,[(0,i.A)("U263")]:4,[(0,i.A)("VSM4")]:4,[(0,i.A)("H264")]:27,[(0,i.A)("h264")]:27,[(0,i.A)("X264")]:27,[(0,i.A)("x264")]:27,[(0,i.A)("avc1")]:27,[(0,i.A)("DAVC")]:27,[(0,i.A)("SMV2")]:27,[(0,i.A)("VSSH")]:27,[(0,i.A)("Q264")]:27,[(0,i.A)("V264")]:27,[(0,i.A)("GAVC")]:27,[(0,i.A)("UMSV")]:27,[(0,i.A)("tshd")]:27,[(0,i.A)("INMC")]:27,[(0,i.A)("FMP4")]:12,[(0,i.A)("DIVX")]:12,[(0,i.A)("DX50")]:12,[(0,i.A)("XVID")]:12,[(0,i.A)("MP4S")]:12,[(0,i.A)("M4S2")]:12,[(0,i.A)("DIVX")]:12,4:12,[(0,i.A)("ZMP4")]:12,[(0,i.A)("DIV1")]:12,[(0,i.A)("BLZ0")]:12,[(0,i.A)("mp4v")]:12,[(0,i.A)("UMP4")]:12,[(0,i.A)("WV1F")]:12,[(0,i.A)("SEDG")]:12,[(0,i.A)("RMP4")]:12,[(0,i.A)("3IV2")]:12,[(0,i.A)("WAWV")]:12,[(0,i.A)("FFDS")]:12,[(0,i.A)("FVFW")]:12,[(0,i.A)("DCOD")]:12,[(0,i.A)("MVXM")]:12,[(0,i.A)("PM4V")]:12,[(0,i.A)("SMP4")]:12,[(0,i.A)("DXGM")]:12,[(0,i.A)("VIDM")]:12,[(0,i.A)("M4T3")]:12,[(0,i.A)("GEOX")]:12,[(0,i.A)("G264")]:12,[(0,i.A)("HDX4")]:12,[(0,i.A)("DM4V")]:12,[(0,i.A)("DMK2")]:12,[(0,i.A)("DYM4")]:12,[(0,i.A)("DIGI")]:12,[(0,i.A)("EPHV")]:12,[(0,i.A)("EM4A")]:12,[(0,i.A)("M4CC")]:12,[(0,i.A)("SN40")]:12,[(0,i.A)("VSPX")]:12,[(0,i.A)("ULDX")]:12,[(0,i.A)("GEOV")]:12,[(0,i.A)("SIPP")]:12,[(0,i.A)("SM4V")]:12,[(0,i.A)("XVIX")]:12,[(0,i.A)("DreX")]:12,[(0,i.A)("QMP4")]:12,[(0,i.A)("PLV1")]:12,[(0,i.A)("GLV4")]:12,[(0,i.A)("GMP4")]:12,[(0,i.A)("MNM4")]:12,[(0,i.A)("GTM4")]:12,[(0,i.A)("MPG4")]:14,[(0,i.A)("MP41")]:14,[(0,i.A)("MP42")]:15,[(0,i.A)("DIV2")]:15,[(0,i.A)("MP43")]:16,[(0,i.A)("DIV3")]:16,[(0,i.A)("MPG3")]:16,[(0,i.A)("DIV5")]:16,[(0,i.A)("DIV6")]:16,[(0,i.A)("DIV4")]:16,[(0,i.A)("DVX3")]:16,[(0,i.A)("AP41")]:16,[(0,i.A)("COL1")]:16,[(0,i.A)("COL0")]:16,[(0,i.A)("WMV1")]:17,[(0,i.A)("WMV2")]:18,[(0,i.A)("GXVE")]:18,[(0,i.A)("dvsd")]:24,[(0,i.A)("dvhd")]:24,[(0,i.A)("dvh1")]:24,[(0,i.A)("dvsl")]:24,[(0,i.A)("dv25")]:24,[(0,i.A)("dv50")]:24,[(0,i.A)("cdvc")]:24,[(0,i.A)("CDVH")]:24,[(0,i.A)("CDV5")]:24,[(0,i.A)("dvc ")]:24,[(0,i.A)("dvcs")]:24,[(0,i.A)("dvh1")]:24,[(0,i.A)("dvis")]:24,[(0,i.A)("pdvc")]:24,[(0,i.A)("SL25")]:24,[(0,i.A)("SLDV")]:24,[(0,i.A)("AVd1")]:24,[(0,i.A)("mpg1")]:2,[(0,i.A)("mpg2")]:2,[(0,i.A)("MPEG")]:2,[(0,i.A)("PIM1")]:2,[(0,i.A)("PIM2")]:2,[(0,i.A)("VCR2")]:2,268435457:2,268435458:2,268435460:2,[(0,i.A)("DVR ")]:2,[(0,i.A)("MMES")]:2,[(0,i.A)("LMP2")]:2,[(0,i.A)("slif")]:2,[(0,i.A)("EM2V")]:2,[(0,i.A)("M701")]:2,[(0,i.A)("M702")]:2,[(0,i.A)("M703")]:2,[(0,i.A)("M704")]:2,[(0,i.A)("M705")]:2,[(0,i.A)("mpgv")]:2,[(0,i.A)("BW10")]:2,[(0,i.A)("XMPG")]:2,[(0,i.A)("RV40")]:69,[(0,i.A)("AV01")]:225,[(0,i.A)("VP80")]:139,[(0,i.A)("VP90")]:167,[(0,i.A)("HEVC")]:173,[(0,i.A)("H265")]:173}},79682:(e,t,a)=>{a.d(t,{A:()=>n});var i=a(4624);const r="src/avformat/function/mktagle.ts";function n(e){4!==e.length&&i.R8(`tag length is not 4, tag: ${e}`,r,30);let t=0;for(let a=3;a>=0;a--)t=t<<8|e.charCodeAt(a);return t}},95832:(e,t,a)=>{a.d(t,{Bq:()=>p,Ij:()=>l,XC:()=>s,f7:()=>f,uF:()=>n});var i=a(77231),r=a(37246);const n={1:"Main",2:"LC",3:"LC",4:"LC",5:"HE",6:"HE"},c={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12},o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,i.N_,i.N_,i.N_],d=[i.N_,1,2,3,4,5,6,7];function s(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t){const{profile:a,sampleRate:r,channels:n}=function(e){let t=i.N_,a=i.N_,r=i.N_;return e.length>=2&&(t=e[0]>>3&31,a=o[(7&e[0])<<1|e[1]>>7],r=d[e[1]>>3&15]),{profile:t,sampleRate:a,channels:r}}(t);e.codecpar.profile=a,e.codecpar.sampleRate=r,e.codecpar.chLayout.nbChannels=n,e.codecpar.frameSize=5===a?2048:1024,e.codecpar.format=8}}function l(e){const t=c[e.sampleRate],a=e.chLayout.nbChannels,r=e.profile===i.N_?2:e.profile,n=new Uint8Array(2);return n[0]=(31&r)<<3|(14&t)>>1,n[1]=(1&t)<<7|(15&a)<<3,n}function p(e){if(e.length<7)return-1;const t=e[0]<<4|e[1]>>4;if(4095!==t)return-1;const a=1&e[1],i=(192&e[2])>>>6,r=(60&e[2])>>>2,n=(1&e[2])<<2|(192&e[3])>>>6,c=(3&e[3])<<11|e[4]<<3|(224&e[5])>>>5,s=3&e[6];let l=1===a?7:9,p=c-l;return{syncWord:t,profile:i+1,sampleRate:o[r],channels:d[n],aacFrameLength:c,numberOfRawDataBlocksInFrame:s,headerLength:l,framePayloadLength:p}}function f(e,t){function a(){const e=t.readU(2);let a=0;for(let i=0;i<=e;i++)a<<=8,a|=t.readU(8);return a}t||(t=new r.A).appendBuffer(e);const i=t.getPointer(),n={syncWord:0,profile:0,sampleRate:0,channels:0,useSameStreamMux:!1,headerLength:0,framePayloadLength:0,muxLengthBytes:0},c=t.readU(11);if(695!==c)return-1;n.syncWord=c,n.muxLengthBytes=t.readU(13);const s=1===t.readU1();if(n.useSameStreamMux=s,!s){const e=1===t.readU1();if(e&&1===t.readU1())return-1;if(e&&a(),1!==t.readU1())return-1;if(0!==t.readU(6))return-1;if(0!==t.readU(4))return-1;if(0!==t.readU(3))return-1;let i=e?a():0;const r=t.readU(5);i-=5;const c=t.readU(4);i-=4;const s=t.readU(4);if(i-=4,t.readU(3),i-=3,i>0&&t.readU(i),0!==t.readU(3))return-1;if(t.readU(8),1===t.readU1())if(e)a();else{let e=0;for(;;){e<<=8;const a=1===t.readU1();if(e+=t.readU(8),!a)break}}1===t.readU1()&&t.readU(8),n.profile=r+1,n.sampleRate=o[c],n.channels=d[s]}let l=0;for(;;){const e=t.readU(8);if(l+=e,255!==e)break}return n.framePayloadLength=l,n.headerLength=t.getPointer()-i+(8===t.getBitLeft()?0:1),n}},21477:(e,t,a)=>{a.d(t,{Ui:()=>c,XC:()=>n,zk:()=>r});var i=a(37246);a(83314),a(97317);const r={0:"Main",1:"High",2:"Professional"};function n(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=4){const a=c(t);e.codecpar.profile=a.profile,e.codecpar.level=a.level}}function c(e){const t=new i.A(e.length);t.appendBuffer(e),t.readU1(),t.readU(7);const a=t.readU(3),r=t.readU(5),n=t.readU1();let c=t.readU1()?10:8;return t.readU1()&&(c=12),{profile:a,level:r,tier:n,bitDepth:c,monochrome:t.readU1(),chromaSubsamplingX:t.readU1(),chromaSubsamplingY:t.readU1(),chromaSamplePosition:t.readU(2)}}},14769:(e,t,a)=>{a.d(t,{DK:()=>o,XC:()=>s,Xr:()=>d,jA:()=>n,ob:()=>r,oe:()=>c});var i=a(31865);const r=34,n=8,c=[0,8,12,0,16,20,24,32],o=[0,88200,176400,192e3,8e3,16e3,22050,24e3,32e3,44100,48e3,96e3,0,0,0,0],d=[0,192,576,1152,2304,4608,0,0,256,512,1024,2048,4096,8192,16384,32768];function s(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length===r){const{bitsPerRawSample:a,sampleRate:r,channels:n}=function(e){const t=new i.A(e);t.skip(10);const a=t.readUint24();return{sampleRate:a>>4,channels:1+((15&a)>>>1),bitsPerRawSample:1+((1&a)<<4|(240&t.readUint8())>>>4)}}(t);e.codecpar.bitsPerRawSample=a,e.codecpar.sampleRate=r,e.codecpar.chLayout.nbChannels=n}}},64093:(e,t,a)=>{a.d(t,{Au:()=>y,He:()=>I,XC:()=>N,Y2:()=>u,hG:()=>A,oz:()=>g});var i=a(77231);const r=[44100,48e3,32e3,0],n=[22050,24e3,16e3,0],c=[11025,12e3,8e3,0],o=[0,1152,1152,384],d=[0,576,1152,384],s=[0,576,1152,384],l=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],p=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],f=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],h=[0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,-1],m=[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1];function u(e,t){switch(e){case 0:return c[t];case 2:return n[t];case 3:return r[t]}return i.N_}function A(e,t){switch(e){case 0:return s[t];case 2:return d[t];case 3:return o[t]}return i.N_}function g(e,t,a){switch(t){case 1:switch(e){case 0:case 2:return m[a];case 3:return f[a]}break;case 2:switch(e){case 0:case 2:return m[a];case 3:return p[a]}case 3:switch(e){case 0:case 2:return h[a];case 3:return l[a]}}return i.N_}function y(e){switch(e){case 1:return 34;case 2:return 33;case 3:return 32}return i.N_}const I={32:"Layer1",33:"Layer2",34:"Layer3"};function N(e,t){if(t&&t.length>=4){const a=t[1]>>>3&3,i=(6&t[1])>>1,r=(12&t[2])>>>2,n=3&~(t[3]>>>6)?2:1,c=y(i),o=u(a,r);e.codecpar.profile=c,e.codecpar.sampleRate=o,e.codecpar.chLayout.nbChannels=n}}},22576:(e,t,a)=>{a.d(t,{Ij:()=>s,XC:()=>d,kt:()=>o});var i=a(31865),r=a(729),n=a(44328);const c=[480,960,1920,2880,480,960,1920,2880,480,960,1920,2880,480,960,480,960,120,240,480,960,120,240,480,960,120,240,480,960,120,240,480,960];function o(e){let t=0,a=0,i=0;if(e.length<1)return 0;switch(t=e[0],a=c[t>>3],3&t){case 0:i=1;break;case 1:case 2:i=2;break;case 3:if(e.length<2)return 0;i=63&e[1]}return i*a}function d(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=19){const a=new i.A(t,!1);a.skip(9),e.codecpar.chLayout.nbChannels=a.readUint8(),e.codecpar.initialPadding=a.readUint16(),e.codecpar.sampleRate=a.readUint32(),e.codecpar.seekPreroll=Number((0,n.k)(BigInt(80),{den:1e3,num:1},{den:48e3,num:1}))}}function s(e){const t=new Uint8Array(19),a=new r.A(t,!1);return a.writeString("OpusHead"),a.writeUint8(1),a.writeUint8(e.chLayout.nbChannels),a.writeUint16(e.initialPadding),a.writeUint32(e.sampleRate),t}},97077:(e,t,a)=>{a.d(t,{Ui:()=>n,XC:()=>r});var i=a(37246);function r(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=6){const a=n(t);e.codecpar.profile=a.profile,e.codecpar.level=a.level}}function n(e){const t=new i.A(e.length);return t.appendBuffer(e.subarray(4)),{profile:t.readU(8),level:t.readU(8),bitDepth:t.readU(4),chromaSubsampling:t.readU(3),fullRangeFlag:t.readU1(),colorPrimaries:t.readU(8),colorTrc:t.readU(8),colorSpace:t.readU(8)}}},82014:(e,t,a)=>{a.d(t,{Ui:()=>c,XC:()=>n,wN:()=>r}),a(9599);var i=a(37246);a(77231),a(97317),a(729);const r={0:"Profile0",1:"Profile1",2:"Profile2",3:"Profile3"};function n(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=6){const a=c(t);e.codecpar.profile=a.profile,e.codecpar.level=a.level}}function c(e){const t=new i.A(e.length);return t.appendBuffer(e),{profile:t.readU(8),level:t.readU(8),bitDepth:t.readU(4),chromaSubsampling:t.readU(3),fullRangeFlag:t.readU1(),colorPrimaries:t.readU(8),colorTrc:t.readU(8),colorSpace:t.readU(8)}}},null:()=>{},28795:(e,t,a)=>{a(78978),a(97863),a(7914),a(21640),a(871),a(52584),a(98345),e.exports=a(46438).Set},21640:(e,t,a)=>{var i=a(95933),r=a(6096);e.exports=a(99373)("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return i.def(r(this,"Set"),e=0===e?0:e,e)}},i)},98345:(e,t,a)=>{a(643)("Set")},52584:(e,t,a)=>{a(44398)("Set")},871:(e,t,a)=>{var i=a(88535);i(i.P+i.R,"Set",{toJSON:a(5874)("Set")})},97860:(e,t,a)=>{e.exports=a(28795)}}]);
|
|
1
|
+
(self.webpackChunklibmedia=self.webpackChunklibmedia||[]).push([[941],{85947:(e,t,a)=>{a.d(t,{A:()=>r});var i=a(134);class r{constructor(){(0,i.A)(this,"type",-1),(0,i.A)(this,"onStreamAdd",void 0)}async destroy(e){}}},34577:(e,t,a)=>{a.r(t),a.d(t,{default:()=>H});var i=a(134),r=a(80662),n=a.n(r),c=a(97860),o=a.n(c),d=a(14686),s=a(61499),l=a(63939),p=a(50932),f=(a(9599),a(4624)),h=a(9705),m=a(85947),u=a(37837),g=a(71517),A=a(77231),y=a(31866),I=a(33919),N=a(72739),x=a(62815),b=a(67659),S=a(59166),P=a(97077),R=a(82014),k=a(21477),B=a(64093),v=a(22576),w=a(95832),U=a(14769),V=a(44328),C=a(31865),L=a(93082),_=a(5783),M=a(82774),D=a(67672),T=a(95335),E=a(53260),z=a(13663),X=a(92647),G=a(50011),O=a(34677),F=a(60264);const W="src/avformat/formats/IMatroskaFormat.ts";class H extends m.A{constructor(){super(),(0,i.A)(this,"type",8),(0,i.A)(this,"context",void 0),(0,i.A)(this,"blockReader",void 0)}init(e){e.ioReader&&e.ioReader.setEndian(!0);const t={isLive:!0,firstCluster:-BigInt(1),segmentStart:-BigInt(1),header:{version:0,readVersion:0,maxIdLength:4,maxSizeLength:8,docType:"",docTypeVersion:0,docTypeReadVersion:0},seekHead:null,info:null,tracks:null,attachments:null,chapters:null,cues:null,tags:null,maxPts:A.Dh,currentCluster:{timeCode:BigInt(0),pos:-BigInt(1),block:{pos:-BigInt(1),size:-BigInt(1)},blockGroup:{block:null}},clusterIndexes:[],clusterIndexesPosMap:new(n())};e.privateData=this.context=t}analyzeStreams(e){const t="webm"===this.context.header.docType?y.N:y.e;this.context.tracks&&N.__(this.context.tracks.entry,(a=>{var i,r,n;const c=e.createStream();switch(c.privData=a,c.codecpar.codecId=t[a.codecId]||0,a.type){case 2:c.codecpar.codecType=1;break;case 1:c.codecpar.codecType=0;break;case 17:c.codecpar.codecType=3;break;default:c.codecpar.codecType=-1}a.language&&(c.metadata.language=a.language),a.name&&(c.metadata.title=a.name),a.audio?("A_PCM/FLOAT/IEEE"===a.codecName?64===a.audio.bitDepth?c.codecpar.codecId=65559:32===a.audio.bitDepth&&(c.codecpar.codecId=65557):"A_PCM/INT/BIG"===a.codecName?16===a.audio.bitDepth?c.codecpar.codecId=65537:24===a.audio.bitDepth?c.codecpar.codecId=65549:32===a.audio.bitDepth&&(c.codecpar.codecId=65545):"A_PCM/INT/LIT"===a.codecName&&(8===a.audio.bitDepth?c.codecpar.codecId=65541:16===a.audio.bitDepth?c.codecpar.codecId=65536:24===a.audio.bitDepth?c.codecpar.codecId=65548:32===a.audio.bitDepth&&(c.codecpar.codecId=65544)),c.codecpar.chLayout.nbChannels=a.audio.channels,c.codecpar.sampleRate=0|a.audio.sampleRate,c.codecpar.bitsPerCodedSample=a.audio.bitDepth):a.video&&(c.codecpar.width=a.video.pixelWidth,c.codecpar.height=a.video.pixelHeight,a.video.color&&(D.ai(a.video.color.primaries)&&(c.codecpar.colorPrimaries=a.video.color.primaries),D.ai(a.video.color.transferCharacteristics)&&(c.codecpar.colorTrc=a.video.color.transferCharacteristics),D.ai(a.video.color.range)&&(c.codecpar.colorRange=a.video.color.range),D.ai(a.video.color.matrixCoefficients)&&(c.codecpar.colorSpace=a.video.color.matrixCoefficients)));let o=0;if("V_MS/VFW/FOURCC"===a.codecId&&(null===(i=a.codecPrivate)||void 0===i?void 0:i.size)>=40)c.codecpar.bitsPerCodedSample=a.codecPrivate.data[15]<<8|a.codecPrivate.data[14],c.codecpar.codecTag=a.codecPrivate.data[19]<<24|a.codecPrivate.data[18]<<16|a.codecPrivate.data[17]<<8|a.codecPrivate.data[16],c.codecpar.codecId=E.n[c.codecpar.codecTag]||0,0===c.codecpar.codecId&&(c.codecpar.codecId,z.h[c.codecpar.codecTag]),o=40;else if("V_QUICKTIME"===a.codecId&&(null===(r=a.codecPrivate)||void 0===r?void 0:r.size)>=21){const e=1===c.codecpar.codecType?z.u:z.h;c.codecpar.codecTag=a.codecPrivate.data[3]<<24|a.codecPrivate.data[2]<<16|a.codecPrivate.data[1]<<8|a.codecPrivate.data[0];const t=e[c.codecpar.codecTag];if(t){const e=new Uint8Array(4),t=Number(BigInt.asIntN(32,a.codecPrivate.size));e[0]=t>>>24&255,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=255&t,a.codecPrivate.size+=BigInt(4),a.codecPrivate.data=(0,X.A)(Uint8Array,[e,a.codecPrivate.data])}c.codecpar.codecId=t||0}if(null!==(n=a.codecPrivate)&&void 0!==n&&n.data&&a.codecPrivate.size-BigInt(Math.floor(o))>0){let e=a.codecPrivate.data.subarray(o);if(94212===c.codecpar.codecId||94230===c.codecpar.codecId){let t=G.decode(e).split(/\r?\n/);for(let e=0;e<t.length;e++)if("[Events]"===t[e].trim()){t=t.slice(0,e);break}t.push("[Events]"),t.push("Format: ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text"),e=G.encode(t.join("\n"))}if(c.codecpar.extradataSize=e.length,c.codecpar.extradata=(0,u.sY)(e.length),(0,d.lW)(c.codecpar.extradata,e.length,e),c.codecpar.extradata)switch(c.codecpar.codecId){case 27:{const e=(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize);x.XC(c,e),F.Bs(e)?c.codecpar.bitFormat=2:c.codecpar.bitFormat=1;break}case 173:{const e=(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize);b.XC(c,e),F.Bs(e)?c.codecpar.bitFormat=2:c.codecpar.bitFormat=1;break}case 196:{const e=(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize);S.XC(c,e),F.Bs(e)?c.codecpar.bitFormat=2:c.codecpar.bitFormat=1;break}case 225:k.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 139:P.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 167:R.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86018:w.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86017:B.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86076:v.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));break;case 86028:if(c.codecpar.extradataSize>U.ob){const e=new C.A((0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize));if("fLaC"===e.readString(4))for(;e.remainingSize();){const t=e.readUint8(),a=e.readUint24(),i=-129&t;if(0===i){const t=e.readBuffer(a);(0,u.Eb)(c.codecpar.extradata),c.codecpar.extradata=(0,u.sY)(t.length),c.codecpar.extradataSize=t.length,(0,d.lW)(c.codecpar.extradata,t.length,t);break}e.skip(i)}}c.codecpar.extradataSize===U.ob&&U.XC(c,(0,d.s3)(c.codecpar.extradata,c.codecpar.extradataSize))}else{let e;86018===c.codecpar.codecId&&(e=w.Ij(c.codecpar)),e&&(c.codecpar.extradataSize=e.length,c.codecpar.extradata=(0,u.sY)(c.codecpar.extradataSize),(0,d.lW)(c.codecpar.extradata,c.codecpar.extradataSize,e))}}this.context.info&&(c.timeBase.num=1,this.context.info.timestampScale?c.timeBase.den=1e3*A.SF/this.context.info.timestampScale|0:(c.timeBase.den=1e3,this.context.info.timestampScale=A.SF),this.context.info.duration&&(c.duration=BigInt(Math.floor(this.context.info.duration)))),(null==a.default||a.default)&&(c.disposition|=1),a.encodings&&N.__(a.encodings.entry,(e=>{e.compression&&(0,O.A)(e.compression.algo)&&(a.needDecompression=!0),e.encryption&&(0,O.A)(e.encryption.algo)&&(a.needDecryption=!0)}))})),this.context.attachments&&N.__(this.context.attachments.entry,(t=>{const a=e.createStream();a.codecpar.codecType=4,a.privData=t,t.data&&(a.codecpar.extradataSize=Number(BigInt.asIntN(32,t.data.size)),a.codecpar.extradata=(0,u.sY)(a.codecpar.extradataSize),(0,d.lW)(a.codecpar.extradata,a.codecpar.extradataSize,t.data.data))})),this.context.tags&&N.__(this.context.tags.entry,(t=>{var a;if("DURATION"===(null===(a=t.tag)||void 0===a?void 0:a.name)){let a=t.tag.string.replaceAll("\0","").split("."),i=a[0].split(":"),r=BigInt(+i[0])*BigInt(36e8)+BigInt(+i[1])*BigInt(6e7)+BigInt(+i[2])*BigInt(1e6)+BigInt(+a[1])/BigInt(1e3);const n=(0,L.A)(e.streams,t.target.trackUid);n&&(n.duration=(0,V.k)(r,A.KR,n.timeBase))}})),this.context.chapters&&N.__(this.context.chapters.entry,(t=>{const a=t.atom;a&&N.__(a,(t=>{var a,i;e.chapters.push({id:t.uid,start:t.start,end:t.end,timeBase:{num:1,den:1e9},metadata:{title:(null===(a=t.display)||void 0===a?void 0:a.title)||"",language:(null===(i=t.display)||void 0===i?void 0:i.language)||""}})}))}))}async readHeader(e){if(440786851!==await(0,I.aL)(e,this.context.header.maxIdLength))return f.z3("not matroska format",W,460),h.LR;const t=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(this.context.header=T.X$(this.context.header,await(0,I.Pb)(e,t,I.jt)),408125543!==await(0,I.aL)(e,this.context.header.maxIdLength))return f.z3("not matroska format",W,469),h.LR;const a=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);this.context.segmentStart=e.ioReader.getPos();const i=e.ioReader.getPos()+a,r=new(o());let n=!1,c=!1;for(;e.ioReader.getPos()<i||!n||!c;){const t=e.ioReader.getPos(),a=await(0,I.aL)(e,this.context.header.maxIdLength);if(a===h.LR){await this.syncTopLevelElement(e,2);continue}const i=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(i!==BigInt(0|h.LR)){if(290298740===a)this.context.isLive=!1,this.context.seekHead=await(0,I.Pb)(e,i,I.Cr);else if(475249515===a)this.context.isLive=!1,this.context.cues=await(0,I.Pb)(e,i,I.eG);else if(272869232===a)this.context.isLive=!1,this.context.chapters=await(0,I.Pb)(e,i,I.Y0);else if(357149030===a)this.context.info=await(0,I.Pb)(e,i,I.qi);else if(307544935===a)this.context.tags=await(0,I.Pb)(e,i,I.hK);else if(423732329===a)this.context.attachments=await(0,I.Pb)(e,i,I.qp);else if(374648427===a)n=!0,this.context.tracks=await(0,I.Pb)(e,i,I.Wy);else if(524531317===a){if(c=!0,this.context.firstCluster=t,this.context.isLive||!this.context.seekHead||!(1&e.ioReader.flags))break;const a=this.context.seekHead.entry;let i=0;for(;i<a.length;i++)if(!r.has(a[i].id)){await e.ioReader.seek(a[i].pos+this.context.segmentStart);break}if(i===a.length)break}else await e.ioReader.skip(Number(BigInt.asIntN(32,i)));r.add(a)}else await this.syncTopLevelElement(e,2)}return this.context.firstCluster>0&&await e.ioReader.seek(this.context.firstCluster),this.analyzeStreams(e),0}parseAdditions(e,t){for(let i=0;i<t.entry.length;i++){var a;const r=t.entry[i];if(null!==(a=r.additional)&&void 0!==a&&a.size){4===r.additionalId&&f.R8("ITU_T_T35 not support now",W,563);const t=(0,u.sY)(r.additional.data.length+8);M.Cv(t,BigInt(r.additionalId>>>0)),(0,d.lW)(t+8,r.additional.data.length,r.additional.data),(0,g.Ow)(e,15,t,r.additional.data.length+8)}}}async parseBlock(e,t){var a,i,r;const n=(null===(a=this.context.currentCluster.block)||void 0===a?void 0:a.data)||this.context.currentCluster.blockGroup.block.data;let c=null===(i=this.context.currentCluster.block)||void 0===i?void 0:i.pos;c<0&&(c=this.context.currentCluster.blockGroup.block.pos);let o,m=-1,y=BigInt(0);null!==(r=this.context.currentCluster.blockGroup)&&void 0!==r&&r.block&&(o=this.context.currentCluster.blockGroup.additions,m=this.context.currentCluster.blockGroup.reference?0===this.context.currentCluster.blockGroup.reference.length?1:0:1,this.context.currentCluster.blockGroup.duration&&(y=this.context.currentCluster.blockGroup.duration)),this.blockReader?this.blockReader.resetBuffer(n):this.blockReader=new C.A(n);const N=this.blockReader.getPos(),x=Number(BigInt.asUintN(32,await(0,I.Qb)(this.blockReader,8))),b=(0,_.A)(e.streams,x);if(!b)return f.z3(`invalid track number ${x}`,W,613),h.OY;const S=this.blockReader.readInt16(),P=this.blockReader.readUint8();-1===m&&(m=128&P?1:0);let R=0,k=[];switch(P>>>1&3){case 1:{R=this.blockReader.readUint8()+1;let e=0;for(let t=0;t<R-1;t++){let t=0;for(;;){const e=this.blockReader.readUint8();if(0===e)break;if(255!==e){t+=e;break}t+=255}e+=t,k.push(t)}k.push(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-N))-e);break}case 3:{R=this.blockReader.readUint8()+1,k.push(await(0,I.Ag)(this.blockReader,4));let e=k[0];for(let t=1;t<R-1;t++){let a=await(0,I.pf)(this.blockReader,4)+k[t-1];e+=a,k.push(a)}k.push(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-N))-e);break}case 2:R=this.blockReader.readUint8()+1;const e=(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-N)))/R;for(let t=0;t<R;t++)k.push(e);break;case 0:R=1,k.push(n.length-Number(BigInt.asIntN(32,this.blockReader.getPos()-N)))}const B=b.privData,v=B.timeScale||1;if(B.needDecryption)throw new Error("not support encryption stream");let w=(this.context.currentCluster.timeCode+BigInt(Math.floor(S*v)))*BigInt(0|this.context.info.timestampScale);B.codecDelay&&(w-=B.codecDelay),w/=BigInt(1e3),w=(0,V.k)(w,A.KR,b.timeBase),y=BigInt(Math.floor(Number(BigInt.asIntN(32,y))*v))*BigInt(0|this.context.info.timestampScale),y/=BigInt(1e3),y=(0,V.k)(y,A.KR,b.timeBase);for(let a=0;a<R;a++){const i=0!==a?(0,g._5)():t;let r,n=k[a],h=0;if(B.needDecompression){const e=B.encodings.entry.find((e=>!!e.compression));3===e.compression.algo?(r=e.compression.settings.data,n+=r.length,h=r.length):f.h2(`not support compression stream, algo: ${e.compression.algo}`,W,723)}p.M[17](i+56,c+this.blockReader.getPos()),p.M[15](i+32,b.index),(0,d.Mr)(i+72,b.timeBase[s.o9],8),p.M[17](i+8,w),p.M[15](i+28,n),p.M[17](i+48,y);const A=(0,u.sY)(n);r&&(0,d.lW)(A,h,r),(0,d.lW)(A+h,k[a],this.blockReader.readBuffer(k[a])),(0,g.NX)(i,A,n),0!==b.codecpar.codecType?(p.M[15](i+36,1|l.f[15](i+36)),p.M[17](i+16,w)):(m&&p.M[15](i+36,1|l.f[15](i+36)),27!==b.codecpar.codecId&&173!==b.codecpar.codecId&&196!==b.codecpar.codecId||p.M[15](i+80,b.codecpar.bitFormat)),o&&this.parseAdditions(i,o),0!==a&&e.interval.packetBuffer.push(i),this.context.maxPts<w&&(this.context.maxPts=w)}return this.context.currentCluster.block={pos:-BigInt(1),size:-BigInt(1)},this.context.currentCluster.blockGroup={block:null},0}addClusterIndex(e){if(this.context.clusterIndexesPosMap.has(e.pos))return;const t=N.El(this.context.clusterIndexes,(t=>t.time<e.time?1:-1));t>-1?(this.context.clusterIndexesPosMap.set(e.pos,t),this.context.clusterIndexes.splice(t,0,e)):(this.context.clusterIndexesPosMap.set(e.pos,this.context.clusterIndexes.length),this.context.clusterIndexes.push(e))}async readAVPacket_(e,t){const a=e.ioReader.getPos(),i=await(0,I.aL)(e,this.context.header.maxIdLength);if(i===h.LR)return await this.syncTopLevelElement(e),this.readAVPacket_(e,t);const r=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(r===BigInt(h.LR))return await this.syncTopLevelElement(e),this.readAVPacket_(e,t);if(524531317===i){this.context.currentCluster.pos=a,this.context.currentCluster.timeCode=BigInt(0),await(0,I.Pb)(e,r,I.GZ,this.context.currentCluster,[163,160]),this.context.isLive||this.addClusterIndex({time:this.context.currentCluster.timeCode,pos:a});let i=await this.parseBlock(e,t);if(i===h.OY)return this.readAVPacket_(e,t);if(i<0)return i}else if(163===i){this.context.currentCluster.block={pos:e.ioReader.getPos(),size:r,data:await e.ioReader.readBuffer(Number(BigInt.asIntN(32,r)))};let a=await this.parseBlock(e,t);if(a===h.OY)return this.readAVPacket_(e,t);if(a<0)return a}else{if(160!==i)return 475249515===i||307544935===i||423732329===i||272869232===i||357149030===i||374648427===i||290298740===i?(await e.ioReader.skip(Number(BigInt.asIntN(32,r))),this.readAVPacket_(e,t)):(await this.syncTopLevelElement(e),this.readAVPacket_(e,t));{await(0,I.Pb)(e,r,I.Wg,this.context.currentCluster.blockGroup);let a=await this.parseBlock(e,t);if(a===h.OY)return this.readAVPacket_(e,t);if(a<0)return a}}return 0}async readAVPacket(e,t){try{return await this.readAVPacket_(e,t)}catch(t){return-1048576!==e.ioReader.error?(f.z3(`read packet error, ${t}`,W,900),h.LR):e.ioReader.error}}async syncTopLevelElement(e,t=3){let a=A.Dh;for(;;)try{if(8&e.ioReader.flags)break;const i=e.ioReader.getPos(),r=await e.ioReader.peekUint32();if(524531317===r||475249515===r||307544935===r||423732329===r||272869232===r||357149030===r||374648427===r||290298740===r){a=i;let r=0;await e.ioReader.skip(4);const n=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(n===BigInt(h.LR)){await e.ioReader.seek(i+BigInt(1));continue}for(await e.ioReader.skip(Number(BigInt.asIntN(32,n)));r<=t;){const t=await(0,I.aL)(e,this.context.header.maxIdLength),a=await(0,I.Qb)(e.ioReader,this.context.header.maxSizeLength);if(524531317!==t&&475249515!==t&&307544935!==t&&423732329!==t&&272869232!==t&&357149030!==t&&374648427!==t&&290298740!==t)break;r++,await e.ioReader.skip(Number(BigInt.asIntN(32,a)))}if(!(r<t))break;await e.ioReader.seek(a+BigInt(1)),a=A.Dh}else await e.ioReader.skip(1),a=A.Dh}catch(e){break}a!==A.Dh&&await e.ioReader.seek(a)}async seek(e,t,a,i){var r;const n=e.ioReader.getPos(),c=(0,V.k)(a,t.timeBase,A.KR);let o=A.Dh;if(null!==(r=this.context.cues)&&void 0!==r&&r.entry.length){const e=t.privData;for(let t=0;t<this.context.cues.entry.length;t++)if((this.context.cues.entry[t].time||BigInt(0))*BigInt(0|this.context.info.timestampScale)/BigInt(1e3)>c){const a=this.context.cues.entry[Math.max(t-1,0)].pos;if(a.length){const t=a.find((t=>t.track===e.number));if(t){o=t.pos+this.context.segmentStart;break}}}}if(o===A.Dh&&this.context.clusterIndexes.length){for(let e=0;e<this.context.clusterIndexes.length;e++)if(this.context.clusterIndexes[e].time*BigInt(0|this.context.info.timestampScale)/BigInt(1e3)>c){o=this.context.clusterIndexes[Math.max(e-1,0)].pos;break}o===A.Dh&&(o=this.context.clusterIndexes[this.context.clusterIndexes.length-1].pos)}return o!==A.Dh?(await e.ioReader.seek(o),n):BigInt(h.E$)}getAnalyzeStreamsCount(){return 0}}},13663:(e,t,a)=>{a.d(t,{h:()=>r,u:()=>n});var i=a(79682);const r={[(0,i.A)("mp4v")]:12,[(0,i.A)("DIVX")]:12,[(0,i.A)("XVID")]:12,[(0,i.A)("3IV2")]:12,[(0,i.A)("vvc1")]:196,[(0,i.A)("vvi1")]:196,[(0,i.A)("hev1")]:173,[(0,i.A)("hvc1")]:173,[(0,i.A)("dvhe")]:173,[(0,i.A)("hev1")]:173,[(0,i.A)("avc1")]:27,[(0,i.A)("avc2")]:27,[(0,i.A)("avc3")]:27,[(0,i.A)("avc4")]:27,[(0,i.A)("ai5p")]:27,[(0,i.A)("ai5q")]:27,[(0,i.A)("ai52")]:27,[(0,i.A)("ai53")]:27,[(0,i.A)("ai55")]:27,[(0,i.A)("ai56")]:27,[(0,i.A)("ai1p")]:27,[(0,i.A)("ai1q")]:27,[(0,i.A)("ai12")]:27,[(0,i.A)("ai13")]:27,[(0,i.A)("ai15")]:27,[(0,i.A)("ai16")]:27,[(0,i.A)("AVin")]:27,[(0,i.A)("aivx")]:27,[(0,i.A)("rv64")]:27,[(0,i.A)("xalg")]:27,[(0,i.A)("avlg")]:27,[(0,i.A)("dva1")]:27,[(0,i.A)("dvav")]:27,[(0,i.A)("vp08")]:139,[(0,i.A)("vp09")]:167,[(0,i.A)("av01")]:225},n={[(0,i.A)("mp4a")]:86018,[(0,i.A)("ac-3")]:86019,[(0,i.A)("sac3")]:86019,[(0,i.A)("ac-4")]:86119,[(0,i.A)("dtsc")]:86020,[(0,i.A)("dtsh")]:86020,[(0,i.A)("dtsl")]:86020,[(0,i.A)("dtse")]:86020,[(0,i.A)("DTS ")]:86020,[(0,i.A)("ec-3")]:86056,[(0,i.A)(".mp3")]:86017,[(0,i.A)("mp3 ")]:86017,1836253269:86017,[(0,i.A)("spex")]:86051,[(0,i.A)("SPXN")]:86051,[(0,i.A)("fLaC")]:86028,[(0,i.A)("Opus")]:86076,[(0,i.A)("alaw")]:65543,[(0,i.A)("ulaw")]:65542,[(0,i.A)("fl32")]:65557,[(0,i.A)("fl64")]:65559,[(0,i.A)("twos")]:65537,[(0,i.A)("lpcm")]:65536,[(0,i.A)("sowt")]:65536,[(0,i.A)("in24")]:65548,[(0,i.A)("in32")]:65544,[(0,i.A)("sowt")]:65540,[(0,i.A)("raw ")]:65541,[(0,i.A)("NONE")]:65541}},5783:(e,t,a)=>{function i(e,t){for(let a=0;a<e.length;a++)if(e[a].privData.number===t)return e[a]}a.d(t,{A:()=>i})},93082:(e,t,a)=>{function i(e,t){for(let a=0;a<e.length;a++)if(e[a].privData.uid===t)return e[a]}a.d(t,{A:()=>i})},33919:(e,t,a)=>{a.d(t,{Ag:()=>N,Cr:()=>s,GZ:()=>y,Pb:()=>k,Qb:()=>b,Wg:()=>A,Wy:()=>p,Y0:()=>h,aL:()=>R,eG:()=>m,hK:()=>g,jt:()=>I,pf:()=>x,qi:()=>l,qp:()=>f});var i=a(4624),r=a(9705),n=a(67672),c=a(72739);const o="src/avformat/formats/matroska/imatroska.ts",d=BigInt(20971520),s={19899:{type:9,isArray:!0,filedName:"entry",child:{21419:{type:1,filedName:"id"},21420:{type:2,filedName:"pos"}}}},l={29604:{type:2,filedName:"segmentUUID"},2807729:{type:1,filedName:"timestampScale"},17545:{type:5,filedName:"duration"},31657:{type:7,filedName:"title"},19840:{type:7,filedName:"muxingApp"},22337:{type:7,filedName:"writingApp"},17505:{type:8,filedName:"dateUTC"}},p={174:{type:9,isArray:!0,filedName:"entry",child:{215:{type:1,filedName:"number"},29637:{type:1,filedName:"uid"},131:{type:1,filedName:"type"},21358:{type:7,filedName:"name"},136:{type:10,filedName:"default"},185:{type:10,filedName:"enabled"},2274716:{type:7,filedName:"language"},2306383:{type:6,filedName:"timeScale"},134:{type:7,filedName:"codecId"},2459272:{type:7,filedName:"codecName"},25506:{type:8,filedName:"codecPrivate"},225:{type:9,filedName:"audio",child:{181:{type:5,filedName:"sampleRate"},30901:{type:5,filedName:"outSampleRate"},25188:{type:1,filedName:"bitDepth"},159:{type:1,filedName:"channels"}}},224:{type:9,filedName:"video",child:{2327523:{type:1,filedName:"framerate"},21680:{type:1,filedName:"displayWidth"},21690:{type:1,filedName:"displayHeight"},176:{type:1,filedName:"pixelWidth"},186:{type:1,filedName:"pixelHeight"},3061028:{type:8,filedName:"colorSpace"},21440:{type:1,filedName:"alphaMode"},21936:{type:9,filedName:"color",child:{21937:{type:1,filedName:"matrixCoefficients"},21938:{type:1,filedName:"bitsPerChannel"},21941:{type:1,filedName:"cbSubHorz"},21942:{type:1,filedName:"cbSubVert"},21939:{type:1,filedName:"chromaSubHorz"},21940:{type:1,filedName:"chromaSubVert"},21943:{type:1,filedName:"chromaSitingHorz"},21944:{type:1,filedName:"chromaSitingVert"},21945:{type:1,filedName:"range"},21946:{type:1,filedName:"transferCharacteristics"},21947:{type:1,filedName:"primaries"},21948:{type:1,filedName:"maxCll"},21949:{type:1,filedName:"maxFall"},21968:{type:9,filedName:"masteringMeta",child:{21969:{type:5,filedName:"rx"},21970:{type:5,filedName:"ry"},21971:{type:5,filedName:"gx"},21972:{type:5,filedName:"gy"},21973:{type:5,filedName:"bx"},21974:{type:5,filedName:"by"},21975:{type:5,filedName:"whiteX"},21976:{type:5,filedName:"whiteY"},21978:{type:5,isArray:!0,filedName:"minLuminance"},21977:{type:5,filedName:"maxLuminance"}}}}},30320:{type:9,filedName:"projection",child:{30321:{type:1,filedName:"type"},30322:{type:8,filedName:"private"},30323:{type:5,filedName:"yaw"},30324:{type:5,filedName:"pitch"},30325:{type:5,filedName:"roll"}}},21682:{type:1,filedName:"displayUnit"},154:{type:1,filedName:"interlaced"},157:{type:1,filedName:"fieldOrder"},21432:{type:1,filedName:"stereoMode"},21683:{type:1,filedName:"aspectRatio"}}},226:{type:9,filedName:"operations",child:{227:{type:9,isArray:!0,filedName:"entry",child:{228:{type:9,isArray:!0,filedName:"planes",child:{230:{type:1,filedName:"type"},229:{type:1,filedName:"uid"}}}}}}},28032:{type:9,filedName:"encodings",child:{25152:{type:9,isArray:!0,filedName:"entry",child:{20530:{type:1,filedName:"scope"},20531:{type:1,filedName:"type"},20532:{type:9,filedName:"compression",child:{16980:{type:1,filedName:"algo"},16981:{type:8,filedName:"settings"}}},20533:{type:9,filedName:"encryption",child:{18401:{type:1,filedName:"algo"},18402:{type:8,filedName:"keyId"}}}}}}}}}},f={24999:{type:9,isArray:!0,filedName:"entry",child:{18094:{type:1,filedName:"uid"},18030:{type:7,filedName:"name"},18016:{type:7,filedName:"mime"},18046:{type:7,filedName:"description"},18012:{type:8,filedName:"data"}}}},h={17849:{type:9,isArray:!0,filedName:"entry",child:{182:{type:9,isArray:!0,filedName:"atom",child:{145:{type:2,filedName:"start"},146:{type:2,filedName:"end"},29636:{type:1,filedName:"uid"},128:{type:9,filedName:"display",child:{133:{type:7,filedName:"title"},17276:{type:7,filedName:"language"}}}}}}}},m={187:{type:9,isArray:!0,filedName:"entry",child:{179:{type:2,filedName:"time"},183:{type:9,isArray:!0,filedName:"pos",child:{247:{type:1,filedName:"track"},241:{type:2,filedName:"pos"}}}}}},u={17827:{type:7,filedName:"name"},17543:{type:7,filedName:"string"},17530:{type:7,filedName:"language"},17540:{type:1,filedName:"default"},17588:{type:1,filedName:"default"},26568:{type:9,filedName:"sub"}};u[26568].child=u;const g={29555:{type:9,isArray:!0,filedName:"entry",child:{26568:{type:9,filedName:"tag",child:u},25536:{type:9,filedName:"target",child:{25546:{type:7,filedName:"type"},26826:{type:1,filedName:"typeValue"},25541:{type:1,filedName:"trackUid"},25540:{type:1,filedName:"chapterUid"},25542:{type:1,filedName:"attachUid"}}}}}},A={161:{type:8,filedName:"block"},30113:{type:9,filedName:"additions",child:{166:{type:9,isArray:!0,filedName:"entry",child:{238:{type:1,filedName:"additionalId"},165:{type:8,filedName:"additional"}}}}},155:{type:2,filedName:"duration"},30114:{type:4,filedName:"discardPadding"},251:{type:4,isArray:!0,filedName:"reference"},164:{type:10,filedName:"nonSimple"}},y={163:{type:8,filedName:"block"},160:{type:9,filedName:"blockGroup",child:A},231:{type:2,filedName:"timeCode"},167:{type:2,filedName:"pos"},171:{type:2,filedName:"prevSize"}},I={17030:{type:1,filedName:"version"},17143:{type:1,filedName:"readVersion"},17138:{type:1,filedName:"maxIdLength"},17139:{type:1,filedName:"maxSizeLength"},17026:{type:7,filedName:"docType"},17031:{type:1,filedName:"docTypeVersion"},17029:{type:1,filedName:"docTypeReadVersion"}};async function N(e,t){const a=e.getPos();let n=await e.readUint8();if(!n)return i.z3(`0x00 as pos ${a} invalid as first byte of an EBML number`,o,766),r.LR;let c=1;for(;!(128&n);)c++,n<<=1;if(n&=127,c>t)return i.z3(`Length ${c} indicated by an EBML number's first byte ${n.toString(16)} at pos ${a} exceeds max length ${t}.`,o,779),r.LR;let d=n>>>c-1;for(;--c;)d<<=8,d|=await e.readUint8();return d}async function x(e,t){const a=e.getPos();return await N(e,t)-((1<<7*Number(BigInt.asIntN(32,e.getPos()-a))-1)-1)}async function b(e,t){const a=e.getPos();let n=await e.readUint8(),c=1;if(!n)return i.z3(`0x00 as pos ${a} invalid as first byte of an EBML number`,o,813),BigInt(r.LR);for(;!(128&n);)c++,n<<=1;if(n&=127,c>t)return i.z3(`Length ${c} indicated by an EBML number's first byte ${n.toString(16)} at pos ${a} exceeds max length ${t}.`,o,824),BigInt(r.LR);let d=BigInt(Math.floor(n>>>c-1));for(;--c;){d<<=BigInt(8);const t=await e.readUint8();d|=BigInt(Math.floor(t))}return d}async function S(e,t){switch(t){case BigInt(0):return 0;case BigInt(1):return e.ioReader.readUint8();case BigInt(2):return e.ioReader.readUint16();case BigInt(3):return e.ioReader.readUint24();case BigInt(4):return e.ioReader.readUint32();case BigInt(8):return e.ioReader.readUint64()}let a=BigInt(0),i=0;for(;i++<t;){const t=await e.ioReader.readUint8();a=a<<BigInt(8)|BigInt.asUintN(64,BigInt(Math.floor(t)))}return a}async function P(e,t){switch(t){case BigInt(0):return 0;case BigInt(1):return e.ioReader.readInt8();case BigInt(2):return e.ioReader.readInt16();case BigInt(4):return e.ioReader.readInt32();case BigInt(8):return e.ioReader.readInt64()}let a=BigInt(0),i=0;for(;i++<t;){const t=await e.ioReader.readUint8();a=a<<BigInt(8)|BigInt.asUintN(64,BigInt(Math.floor(t)))}return t===BigInt(3)?Number(BigInt.asIntN(32,BigInt.asIntN(24,a))):BigInt.asIntN(64,a)}async function R(e,t){const a=e.ioReader.getPos();let n=await e.ioReader.peekUint8();if(!n)return i.z3(`0x00 as pos ${a} invalid as first byte of an EBML number`,o,909),r.LR;let c=1;for(;!(128&n);)c++,n<<=1;if(c>t)return i.z3(`Length ${c} indicated by an EBML number's first byte ${n.toString(16)} at pos ${a} exceeds max length ${t}.`,o,921),r.LR;let d=0;for(;c--;)d<<=8,d|=await e.ioReader.readUint8();return d}async function k(e,t,a,i={},r=[]){return await async function(e,t,a){const i=e.privateData,r=e.ioReader.getPos();for(;e.ioReader.getPos()<r+t;){const t=await R(e,i.header.maxIdLength),r=await b(e.ioReader,i.header.maxSizeLength);if(e.ioReader.getPos(),!1===await a(t,r))return}}(e,t,(async(t,o)=>{if(a[t]){const r=a[t];let c;switch(r.type){case 1:c=await S(e,o);break;case 2:c=await S(e,o),n.ai(c)&&(c=BigInt(c));break;case 3:c=await P(e,o);break;case 4:c=await P(e,o),n.ai(c)&&(c=BigInt(c));break;case 6:case 5:c=await async function(e,t){return t===BigInt(4)?e.ioReader.readFloat():t===BigInt(8)?e.ioReader.readDouble():(await e.ioReader.skip(Number(BigInt.asIntN(32,t))),0)}(e,o);break;case 7:c=await e.ioReader.readString(Number(BigInt.asIntN(32,o)));break;case 10:c=!!await S(e,o);break;case 8:c={pos:e.ioReader.getPos(),size:o,data:o<d?await e.ioReader.readBuffer(Number(BigInt.asIntN(32,o))):null};break;case 9:c=r.child?await k(e,o,r.child):{};break;default:await e.ioReader.skip(Number(BigInt.asIntN(32,o)))}if(null!=c)if(r.isArray){const e=i[r.filedName]||[];e.push(c),i[r.filedName]=e}else i[r.filedName]=c}else await e.ioReader.skip(Number(BigInt.asIntN(32,o)));if(r.length&&c.zy(r,t))return!1})),i}},31866:(e,t,a)=>{a.d(t,{N:()=>r,e:()=>i});const i={A_AAC:86018,A_AC3:86019,A_ALAC:86032,A_DTS:86020,A_EAC3:86056,A_FLAC:86028,A_MLP:86045,"A_MPEG/L2":86016,"A_MPEG/L1":86058,"A_MPEG/L3":86017,A_OPUS:86076,"A_OPUS/EXPERIMENTAL":86076,"A_PCM/FLOAT/IEEE":65557,"A_PCM/INT/BIG":65537,"A_PCM/INT/LIT":65536,"A_QUICKTIME/QDMC":86066,"A_QUICKTIME/QDM2":86035,"A_REAL/14_4":77824,"A_REAL/28_8":77825,"A_REAL/ATRC":86047,"A_REAL/COOK":86036,"A_REAL/SIPR":86057,A_TRUEHD:86060,A_TTA1:86038,A_VORBIS:86021,A_WAVPACK4:86041,"D_WEBVTT/SUBTITLES":94226,"D_WEBVTT/CAPTIONS":94226,"D_WEBVTT/DESCRIPTIONS":94226,"D_WEBVTT/METADATA":94226,"S_TEXT/UTF8":94225,"S_TEXT/ASCII":94210,"S_TEXT/ASS":94230,"S_TEXT/SSA":94230,S_ASS:94230,S_SSA:94230,S_VOBSUB:94208,S_DVBSUB:94209,"S_HDMV/PGS":94214,"S_HDMV/TEXTST":94231,V_AV1:225,V_DIRAC:116,V_FFV1:33,V_MJPEG:7,V_MPEG1:1,V_MPEG2:2,"V_MPEG4/ISO/ASP":12,"V_MPEG4/ISO/AP":12,"V_MPEG4/ISO/SP":12,"V_MPEG4/ISO/AVC":27,"V_MPEGH/ISO/HEVC":173,"V_MPEGH/ISO/VVC":196,"V_MPEG4/MS/V3":16,V_PRORES:147,"V_REAL/RV10":5,"V_REAL/RV20":6,"V_REAL/RV30":68,"V_REAL/RV40":69,V_SNOW:208,V_THEORA:30,V_UNCOMPRESSED:13,V_VP8:139,V_VP9:167},r={V_VP8:139,V_VP9:167,V_AV1:225,A_VORBIS:86021,A_OPUS:86076,"D_WEBVTT/SUBTITLES":94226,"D_WEBVTT/CAPTIONS":94226,"D_WEBVTT/DESCRIPTIONS":94226,"D_WEBVTT/METADATA":94226}},53260:(e,t,a)=>{a.d(t,{g:()=>r,n:()=>n});var i=a(79682);const r={1:65541,2:69638,3:65557,6:65543,7:65542,10:86052,16:69664,17:69633,23:69664,32:69646,34:86037,49:86046,50:86046,56:73728,66:86068,69:69643,20:69643,64:69643,97:69635,98:69634,100:69643,105:69633,117:86079,131:86069,255:86018,273:86068,5632:86018,5634:86065,8192:86019},n={[(0,i.A)("H264")]:27,[(0,i.A)("h264")]:27,[(0,i.A)("X264")]:27,[(0,i.A)("x264")]:27,[(0,i.A)("avc1")]:27,[(0,i.A)("DAVC")]:27,[(0,i.A)("SMV2")]:27,[(0,i.A)("VSSH")]:27,[(0,i.A)("Q264")]:27,[(0,i.A)("V264")]:27,[(0,i.A)("GAVC")]:27,[(0,i.A)("UMSV")]:27,[(0,i.A)("tshd")]:27,[(0,i.A)("INMC")]:27,[(0,i.A)("FMP4")]:12,[(0,i.A)("DIVX")]:12,[(0,i.A)("DX50")]:12,[(0,i.A)("XVID")]:12,[(0,i.A)("MP4S")]:12,[(0,i.A)("M4S2")]:12,[(0,i.A)("DIVX")]:12,4:12,[(0,i.A)("ZMP4")]:12,[(0,i.A)("DIV1")]:12,[(0,i.A)("BLZ0")]:12,[(0,i.A)("mp4v")]:12,[(0,i.A)("UMP4")]:12,[(0,i.A)("WV1F")]:12,[(0,i.A)("SEDG")]:12,[(0,i.A)("RMP4")]:12,[(0,i.A)("3IV2")]:12,[(0,i.A)("WAWV")]:12,[(0,i.A)("FFDS")]:12,[(0,i.A)("FVFW")]:12,[(0,i.A)("DCOD")]:12,[(0,i.A)("MVXM")]:12,[(0,i.A)("PM4V")]:12,[(0,i.A)("SMP4")]:12,[(0,i.A)("DXGM")]:12,[(0,i.A)("VIDM")]:12,[(0,i.A)("M4T3")]:12,[(0,i.A)("GEOX")]:12,[(0,i.A)("G264")]:12,[(0,i.A)("HDX4")]:12,[(0,i.A)("DM4V")]:12,[(0,i.A)("DMK2")]:12,[(0,i.A)("DYM4")]:12,[(0,i.A)("DIGI")]:12,[(0,i.A)("EPHV")]:12,[(0,i.A)("EM4A")]:12,[(0,i.A)("M4CC")]:12,[(0,i.A)("SN40")]:12,[(0,i.A)("VSPX")]:12,[(0,i.A)("ULDX")]:12,[(0,i.A)("GEOV")]:12,[(0,i.A)("SIPP")]:12,[(0,i.A)("SM4V")]:12,[(0,i.A)("XVIX")]:12,[(0,i.A)("DreX")]:12,[(0,i.A)("QMP4")]:12,[(0,i.A)("PLV1")]:12,[(0,i.A)("GLV4")]:12,[(0,i.A)("GMP4")]:12,[(0,i.A)("MNM4")]:12,[(0,i.A)("GTM4")]:12,[(0,i.A)("MPG4")]:14,[(0,i.A)("MP41")]:14,[(0,i.A)("MP42")]:15,[(0,i.A)("DIV2")]:15,[(0,i.A)("MP43")]:16,[(0,i.A)("DIV3")]:16,[(0,i.A)("MPG3")]:16,[(0,i.A)("DIV5")]:16,[(0,i.A)("DIV6")]:16,[(0,i.A)("DIV4")]:16,[(0,i.A)("DVX3")]:16,[(0,i.A)("AP41")]:16,[(0,i.A)("COL1")]:16,[(0,i.A)("COL0")]:16,[(0,i.A)("VP80")]:139,[(0,i.A)("VP90")]:167}},79682:(e,t,a)=>{a.d(t,{A:()=>n});var i=a(4624);const r="src/avformat/function/mktagle.ts";function n(e){4!==e.length&&i.R8(`tag length is not 4, tag: ${e}`,r,30);let t=0;for(let a=3;a>=0;a--)t=t<<8|e.charCodeAt(a);return t}},95832:(e,t,a)=>{a.d(t,{Bq:()=>p,Ij:()=>l,XC:()=>s,f7:()=>f,uF:()=>n});var i=a(77231),r=a(37246);const n={1:"Main",2:"LC",3:"LC",4:"LC",5:"HE",6:"HE"},c={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12},o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,i.N_,i.N_,i.N_],d=[i.N_,1,2,3,4,5,6,7];function s(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t){const{profile:a,sampleRate:r,channels:n}=function(e){let t=i.N_,a=i.N_,r=i.N_;return e.length>=2&&(t=e[0]>>3&31,a=o[(7&e[0])<<1|e[1]>>7],r=d[e[1]>>3&15]),{profile:t,sampleRate:a,channels:r}}(t);e.codecpar.profile=a,e.codecpar.sampleRate=r,e.codecpar.chLayout.nbChannels=n,e.codecpar.frameSize=5===a?2048:1024,e.codecpar.format=8}}function l(e){const t=c[e.sampleRate],a=e.chLayout.nbChannels,r=e.profile===i.N_?2:e.profile,n=new Uint8Array(2);return n[0]=(31&r)<<3|(14&t)>>1,n[1]=(1&t)<<7|(15&a)<<3,n}function p(e){if(e.length<7)return-1;const t=e[0]<<4|e[1]>>4;if(4095!==t)return-1;const a=1&e[1],i=(192&e[2])>>>6,r=(60&e[2])>>>2,n=(1&e[2])<<2|(192&e[3])>>>6,c=(3&e[3])<<11|e[4]<<3|(224&e[5])>>>5,s=3&e[6];let l=1===a?7:9,p=c-l;return{syncWord:t,profile:i+1,sampleRate:o[r],channels:d[n],aacFrameLength:c,numberOfRawDataBlocksInFrame:s,headerLength:l,framePayloadLength:p}}function f(e,t){function a(){const e=t.readU(2);let a=0;for(let i=0;i<=e;i++)a<<=8,a|=t.readU(8);return a}t||(t=new r.A).appendBuffer(e);const i=t.getPointer(),n={syncWord:0,profile:0,sampleRate:0,channels:0,useSameStreamMux:!1,headerLength:0,framePayloadLength:0,muxLengthBytes:0},c=t.readU(11);if(695!==c)return-1;n.syncWord=c,n.muxLengthBytes=t.readU(13);const s=1===t.readU1();if(n.useSameStreamMux=s,!s){const e=1===t.readU1();if(e&&1===t.readU1())return-1;if(e&&a(),1!==t.readU1())return-1;if(0!==t.readU(6))return-1;if(0!==t.readU(4))return-1;if(0!==t.readU(3))return-1;let i=e?a():0;const r=t.readU(5);i-=5;const c=t.readU(4);i-=4;const s=t.readU(4);if(i-=4,t.readU(3),i-=3,i>0&&t.readU(i),0!==t.readU(3))return-1;if(t.readU(8),1===t.readU1())if(e)a();else{let e=0;for(;;){e<<=8;const a=1===t.readU1();if(e+=t.readU(8),!a)break}}1===t.readU1()&&t.readU(8),n.profile=r+1,n.sampleRate=o[c],n.channels=d[s]}let l=0;for(;;){const e=t.readU(8);if(l+=e,255!==e)break}return n.framePayloadLength=l,n.headerLength=t.getPointer()-i+(8===t.getBitLeft()?0:1),n}},21477:(e,t,a)=>{a.d(t,{Ui:()=>c,XC:()=>n,zk:()=>r});var i=a(37246);a(83314),a(97317);const r={0:"Main",1:"High",2:"Professional"};function n(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=4){const a=c(t);e.codecpar.profile=a.profile,e.codecpar.level=a.level}}function c(e){const t=new i.A(e.length);t.appendBuffer(e),t.readU1(),t.readU(7);const a=t.readU(3),r=t.readU(5),n=t.readU1();let c=t.readU1()?10:8;return t.readU1()&&(c=12),{profile:a,level:r,tier:n,bitDepth:c,monochrome:t.readU1(),chromaSubsamplingX:t.readU1(),chromaSubsamplingY:t.readU1(),chromaSamplePosition:t.readU(2)}}},14769:(e,t,a)=>{a.d(t,{DK:()=>o,XC:()=>s,Xr:()=>d,jA:()=>n,ob:()=>r,oe:()=>c});var i=a(31865);const r=34,n=8,c=[0,8,12,0,16,20,24,32],o=[0,88200,176400,192e3,8e3,16e3,22050,24e3,32e3,44100,48e3,96e3,0,0,0,0],d=[0,192,576,1152,2304,4608,0,0,256,512,1024,2048,4096,8192,16384,32768];function s(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length===r){const{bitsPerRawSample:a,sampleRate:r,channels:n}=function(e){const t=new i.A(e);t.skip(10);const a=t.readUint24();return{sampleRate:a>>4,channels:1+((15&a)>>>1),bitsPerRawSample:1+((1&a)<<4|(240&t.readUint8())>>>4)}}(t);e.codecpar.bitsPerRawSample=a,e.codecpar.sampleRate=r,e.codecpar.chLayout.nbChannels=n}}},64093:(e,t,a)=>{a.d(t,{Au:()=>y,He:()=>I,XC:()=>N,Y2:()=>u,hG:()=>g,oz:()=>A});var i=a(77231);const r=[44100,48e3,32e3,0],n=[22050,24e3,16e3,0],c=[11025,12e3,8e3,0],o=[0,1152,1152,384],d=[0,576,1152,384],s=[0,576,1152,384],l=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],p=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],f=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],h=[0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,-1],m=[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1];function u(e,t){switch(e){case 0:return c[t];case 2:return n[t];case 3:return r[t]}return i.N_}function g(e,t){switch(e){case 0:return s[t];case 2:return d[t];case 3:return o[t]}return i.N_}function A(e,t,a){switch(t){case 1:switch(e){case 0:case 2:return m[a];case 3:return f[a]}break;case 2:switch(e){case 0:case 2:return m[a];case 3:return p[a]}case 3:switch(e){case 0:case 2:return h[a];case 3:return l[a]}}return i.N_}function y(e){switch(e){case 1:return 34;case 2:return 33;case 3:return 32}return i.N_}const I={32:"Layer1",33:"Layer2",34:"Layer3"};function N(e,t){if(t&&t.length>=4){const a=t[1]>>>3&3,i=(6&t[1])>>1,r=(12&t[2])>>>2,n=3&~(t[3]>>>6)?2:1,c=y(i),o=u(a,r);e.codecpar.profile=c,e.codecpar.sampleRate=o,e.codecpar.chLayout.nbChannels=n}}},22576:(e,t,a)=>{a.d(t,{Ij:()=>s,XC:()=>d,kt:()=>o});var i=a(31865),r=a(729),n=a(44328);const c=[480,960,1920,2880,480,960,1920,2880,480,960,1920,2880,480,960,480,960,120,240,480,960,120,240,480,960,120,240,480,960,120,240,480,960];function o(e){let t=0,a=0,i=0;if(e.length<1)return 0;switch(t=e[0],a=c[t>>3],3&t){case 0:i=1;break;case 1:case 2:i=2;break;case 3:if(e.length<2)return 0;i=63&e[1]}return i*a}function d(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=19){const a=new i.A(t,!1);a.skip(9),e.codecpar.chLayout.nbChannels=a.readUint8(),e.codecpar.initialPadding=a.readUint16(),e.codecpar.sampleRate=a.readUint32(),e.codecpar.seekPreroll=Number((0,n.k)(BigInt(80),{den:1e3,num:1},{den:48e3,num:1}))}}function s(e){const t=new Uint8Array(19),a=new r.A(t,!1);return a.writeString("OpusHead"),a.writeUint8(1),a.writeUint8(e.chLayout.nbChannels),a.writeUint16(e.initialPadding),a.writeUint32(e.sampleRate),t}},97077:(e,t,a)=>{a.d(t,{Ui:()=>n,XC:()=>r});var i=a(37246);function r(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=6){const a=n(t);e.codecpar.profile=a.profile,e.codecpar.level=a.level}}function n(e){const t=new i.A(e.length);return t.appendBuffer(e.subarray(4)),{profile:t.readU(8),level:t.readU(8),bitDepth:t.readU(4),chromaSubsampling:t.readU(3),fullRangeFlag:t.readU1(),colorPrimaries:t.readU(8),colorTrc:t.readU(8),colorSpace:t.readU(8)}}},82014:(e,t,a)=>{a.d(t,{Ui:()=>c,XC:()=>n,wN:()=>r}),a(9599);var i=a(37246);a(77231),a(97317),a(729);const r={0:"Profile0",1:"Profile1",2:"Profile2",3:"Profile3"};function n(e,t){if(!t&&e.sideData[1]&&(t=e.sideData[1]),t&&t.length>=6){const a=c(t);e.codecpar.profile=a.profile,e.codecpar.level=a.level}}function c(e){const t=new i.A(e.length);return t.appendBuffer(e),{profile:t.readU(8),level:t.readU(8),bitDepth:t.readU(4),chromaSubsampling:t.readU(3),fullRangeFlag:t.readU1(),colorPrimaries:t.readU(8),colorTrc:t.readU(8),colorSpace:t.readU(8)}}},null:()=>{},28795:(e,t,a)=>{a(78978),a(97863),a(7914),a(21640),a(871),a(52584),a(98345),e.exports=a(46438).Set},21640:(e,t,a)=>{var i=a(95933),r=a(6096);e.exports=a(99373)("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return i.def(r(this,"Set"),e=0===e?0:e,e)}},i)},98345:(e,t,a)=>{a(643)("Set")},52584:(e,t,a)=>{a(44398)("Set")},871:(e,t,a)=>{var i=a(88535);i(i.P+i.R,"Set",{toJSON:a(5874)("Set")})},97860:(e,t,a)=>{e.exports=a(28795)}}]);
|