conformtools 0.6.10 → 0.6.12

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.
Files changed (84) hide show
  1. package/README.md +54 -22
  2. package/dist/{account-GFIQC77T.js → account-IUWNSDG5.js} +1 -1
  3. package/dist/{analysis-engine-4K5K6L53.js → analysis-engine-M7W32RRC.js} +1 -1
  4. package/dist/bridge-6NCHJWE6.js +3 -0
  5. package/dist/browser/timeline_core_bg.wasm +0 -0
  6. package/dist/{chunk-56EEBHP2.js → chunk-2CY2OOOJ.js} +1 -1
  7. package/dist/chunk-3XQI5SIV.js +3 -0
  8. package/dist/chunk-5YULBQJX.js +3 -0
  9. package/dist/chunk-64X5DLH5.js +6 -0
  10. package/dist/{chunk-XJNWAQON.js → chunk-6NLB5TZ2.js} +1 -1
  11. package/dist/chunk-B77ADB26.js +3 -0
  12. package/dist/chunk-DFQWQ3EA.js +10 -0
  13. package/dist/{chunk-JXTRQ3UG.js → chunk-F4PHKOAS.js} +1 -1
  14. package/dist/chunk-G3SZDPDS.js +3 -0
  15. package/dist/chunk-IN6XVTUS.js +3 -0
  16. package/dist/{chunk-NQNS4Y2B.js → chunk-LVGGCRDW.js} +1 -1
  17. package/dist/chunk-LYM757KG.js +158 -0
  18. package/dist/chunk-N34DQ6MH.js +14 -0
  19. package/dist/chunk-NMH62JSC.js +5 -0
  20. package/dist/chunk-NXJZXXC2.js +20 -0
  21. package/dist/{chunk-6HZP2OJA.js → chunk-OMPYIH6F.js} +1 -1
  22. package/dist/{chunk-DGXZB7MO.js → chunk-P3XI63Q2.js} +1 -1
  23. package/dist/chunk-QTA36RVO.js +502 -0
  24. package/dist/chunk-QTFFVLVJ.js +8 -0
  25. package/dist/{chunk-E5ENIKNR.js → chunk-SJ56EEFP.js} +2 -2
  26. package/dist/chunk-THVX57I3.js +4 -0
  27. package/dist/chunk-UUXHJNQA.js +8 -0
  28. package/dist/chunk-VJN4UXFJ.js +8 -0
  29. package/dist/chunk-XF3YMBI7.js +3 -0
  30. package/dist/chunk-XVRTAKDK.js +6 -0
  31. package/dist/chunk-YU3SUSK3.js +3 -0
  32. package/dist/claude-setup-REU4AOKX.js +13 -0
  33. package/dist/cli.js +8 -8
  34. package/dist/emscripten-module-Q67P5WYC-HW3D2R5O.js +2161 -0
  35. package/dist/engine-6ACEWA4S.js +5 -0
  36. package/dist/ffi-7KTOX2T4.js +3 -0
  37. package/dist/framing-CVJM5TT3.js +3 -0
  38. package/dist/gfx-worker.js +1 -1
  39. package/dist/{h264-B2TLLEMI.js → h264-5OGRVYUF.js} +1 -1
  40. package/dist/{h264-mxf-3GED5PBT.js → h264-mxf-FTHNCK4B.js} +1 -1
  41. package/dist/host-relink-ZP33BK53.js +10 -0
  42. package/dist/hosted-BWAYLJXR.js +3 -0
  43. package/dist/hosts-H3IKRZF2.js +3 -0
  44. package/dist/http.js +3 -3
  45. package/dist/{inspect-D3WEYL2W.js → inspect-BJYIDVDN.js} +2 -2
  46. package/dist/{isobmff-C5A2EFKH.js → isobmff-DN6MCHEK.js} +1 -1
  47. package/dist/{mc-video-ARKIHPA7.js → mc-video-TF3MD7LN.js} +1 -1
  48. package/dist/mcp.js +8 -7
  49. package/dist/{media-3YMIZSSF.js → media-MJKEKCPN.js} +1 -1
  50. package/dist/module-ES6BEMUI-L6VQ7K3J.js +3 -0
  51. package/dist/module-asyncify-2EFITU5U-Z4EEM6X7.js +3 -0
  52. package/dist/{mxf-CQSI6H5T.js → mxf-Q5723GPD.js} +1 -1
  53. package/dist/{ops-BCTGDBXT.js → ops-B2OA7VXN.js} +1 -1
  54. package/dist/{probe-COWUTQGN.js → probe-72QZKMCC.js} +1 -1
  55. package/dist/{r3d-FX7V4BIE.js → r3d-7OOZMPWH.js} +1 -1
  56. package/dist/{sequence-patch-JVEZW24V.js → sequence-patch-CN4VC5W3.js} +1 -1
  57. package/dist/store-4WZQF6YD.js +3 -0
  58. package/dist/timeline-ZP5H4YDQ.js +3 -0
  59. package/package.json +10 -1
  60. package/dist/bridge-73XMEZLH.js +0 -3
  61. package/dist/chunk-2MJAQROY.js +0 -5
  62. package/dist/chunk-7QUSVHO2.js +0 -10
  63. package/dist/chunk-CJYLQ3UM.js +0 -5
  64. package/dist/chunk-DFDXSIMI.js +0 -39
  65. package/dist/chunk-DNS4ZYIO.js +0 -3
  66. package/dist/chunk-GM262EDM.js +0 -8
  67. package/dist/chunk-JHTMYXJM.js +0 -20
  68. package/dist/chunk-QHXX5GDD.js +0 -440
  69. package/dist/chunk-TDIY4NRQ.js +0 -3
  70. package/dist/chunk-UGVGRL5M.js +0 -3
  71. package/dist/chunk-Y2QHZUGL.js +0 -5
  72. package/dist/chunk-YC7QDS5U.js +0 -19
  73. package/dist/chunk-ZVUKOFUX.js +0 -6
  74. package/dist/claude-setup-OKOPPDMB.js +0 -5
  75. package/dist/conformtools-analyze +0 -0
  76. package/dist/conformtools-decode +0 -0
  77. package/dist/engine-274GQLUB.js +0 -5
  78. package/dist/framing-BKTUEUZO.js +0 -3
  79. package/dist/host-relink-PTV44KXF.js +0 -10
  80. package/dist/hosts-D3TR2QEV.js +0 -3
  81. package/dist/i2o-transfer +0 -0
  82. package/dist/store-SZKXADGI.js +0 -3
  83. package/dist/timeline-PEUC3G7K.js +0 -3
  84. /package/dist/{still-WUCFH2WX.js → still-SX6RJ7O6.js} +0 -0
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{a as N}from"./chunk-TK55FA56.js";import{a as T,b as L}from"./chunk-AACY2V3L.js";import{b as p,c as O,g as J}from"./chunk-XDI6CPPV.js";import{b as V}from"./chunk-DGXZB7MO.js";import{b as $,c as _}from"./chunk-JXTRQ3UG.js";import{$ as f,A as P,B as x,C as F,D as A,Da as k,Ga as C,Ha as U,Ia as d,N as D,O as z,ha as E,k as w,m as v,n as y,p as R,qa as H,ta as I,x as S,y as M}from"./chunk-DPA26AOI.js";import"./chunk-PSANHDZM.js";function u(e){return(t,n)=>e.read(t,n)}function B(e){let t=e.toLowerCase().trim();return t==="aprn"||t==="aprh"?"prores_raw":t==="apch"||t==="apcn"||t==="apcs"||t==="apco"||t==="ap4h"||t==="ap4x"?"prores":t==="avdn"?"dnxhd":t==="dnxh"?"dnxhr":t==="avc1"||t==="avc3"?"h264":t==="hev1"||t==="hvc1"?"h265":t==="braw"?"braw":e}var h={apco:"Proxy",apcs:"LT",apcn:"422",apch:"HQ",ap4h:"4444",ap4x:"4444 XQ"},Z={1:"bt709",2:"unknown",5:"bt470bg",6:"smpte170m",9:"bt2020",11:"smpte431",12:"smpte432"},ee={1:"bt709",2:"unknown",6:"smpte170m",8:"linear",13:"iec61966-2-1",14:"bt2020-10",15:"bt2020-12",16:"smpte2084",18:"arib-std-b67"},re={0:"gbr",1:"bt709",2:"unknown",5:"bt470bg",6:"smpte170m",9:"bt2020nc",10:"bt2020c"};function te(e,t){return e==="ap4h"||e==="ap4x"?t===32?"yuva444p12le":"yuv444p12le":e in h?"yuv422p10le":void 0}var Q={66:"Baseline",77:"Main",88:"Extended",100:"High",110:"High 10",122:"High 4:2:2",244:"High 4:4:4"},G={1:"Main",2:"Main 10",3:"Main Still",4:"Rext"},ne={1270:"DNxHR 444",1271:"DNxHR HQX",1272:"DNxHR HQ",1273:"DNxHR SQ",1274:"DNxHR LB"};function oe(e,t){if(h[e.codec_fourcc])return`ProRes ${h[e.codec_fourcc]}`;if(e.vc3_cid)return ne[e.vc3_cid]??`DNxHD ${e.vc3_cid}`;if(e.video_profile!=null){if(t==="h264"&&Q[e.video_profile])return`H.264 ${Q[e.video_profile]}`;if(t==="h265"&&G[e.video_profile])return`HEVC ${G[e.video_profile]}`}}function ie(e,t){let n=e.video_chroma,r=e.video_bit_depth;if(n==null&&t==="h264"&&[66,77,88].includes(e.video_profile??-1)&&([n,r]=[1,8]),n==null&&e.vc3_cid&&(n=e.vc3_cid===1270||e.vc3_cid===1256?3:2),n==null||r==null)return;let i=["gray","yuv420p","yuv422p","yuv444p"][n];return r>8?`${i}${r}le`:i}function W(e,t){let n=[];for(let r of e){if(r.kind!=="clip"||!r.source_range)continue;let i=r.source_range.start.value,o=r.source_range.duration.value,c=Math.max(0,Math.floor(i)-t),a=Math.floor(i+o-1)+t;a>=c&&n.push({first_frame:c,last_frame:a})}return n}var be={async inspect(e){await d();let t=e.parts[0],n=await f(u(t),t.fileSize,e.format),r=JSON.parse(n);if(!r)return null;let i=r.timecode&&r.timecode.fps_denominator>0?r.timecode.fps_numerator/r.timecode.fps_denominator:null,o=B(r.codec_fourcc),c=[{kind:"video",codec:o,width:r.width??void 0,height:r.height??void 0,rate:i??void 0,bit_depth:p(r.codec_fourcc)??p(o)??O(o,r.video_profile)??r.video_bit_depth??void 0,codec_specific:{fourcc:r.codec_fourcc,profile:oe(r,o),pixel_format:te(r.codec_fourcc,r.video_depth)??ie(r,o),colr:r.colr?{primaries:Z[r.colr.primaries]??r.colr.primaries,transfer:ee[r.colr.transfer]??r.colr.transfer,matrix:re[r.colr.matrix]??r.colr.matrix}:void 0}}];for(let a of r.audio_tracks??(r.audio?[r.audio]:[]))c.push({kind:"audio",codec:a.codec_fourcc,channels:a.channels??void 0,rate:a.sample_rate??void 0,bit_depth:a.bit_depth??void 0,codec_specific:{fourcc:a.codec_fourcc,channel_layout:a.channel_layout??void 0}});return{id:t.filename,kind:"external",target_url:t.filename,available_range:i&&r.duration_seconds?{start:{value:0,rate:i},duration:{value:Math.round(r.duration_seconds*i),rate:i}}:null,reel_name:null,source_timecode:r.timecode?.display??null,container:e.format==="mov"?"mov":e.format,codec:o,size_bytes:t.fileSize,source_fps:i,source_resolution_w:r.width??null,source_resolution_h:r.height??null,streams:c,decode_provenance:r.decode_provenance??null,vendor_metadata:r.timecode?{drop_frame:r.timecode.drop_frame}:{},binding_state:"unbound",raw_extraction:{mov_probe:r},metadata:{}}},async extract(e){await d();let t=e.parts[0],n=JSON.parse(await E(u(t),t.fileSize,e.format));if(n.length===0)return null;let r=JSON.parse(await f(u(t),t.fileSize,e.format)),i=r?B(r.codec_fourcc):e.format,o=r?.timecode&&r.timecode.fps_denominator>0?r.timecode.fps_numerator/r.timecode.fps_denominator:void 0;return{v:1,container:e.format==="mov"?"mov":e.format,codec:i,width:r?.width??void 0,height:r?.height??void 0,fps:o,frame_count:T(n),timecode:r?.timecode?.display??void 0,granularity:L(n),segments:n}},async sparsify(e,t){await d();let n=e.parts[0],r=W(t.items,t.handles),i=await I(u(n),n.fileSize,JSON.stringify(r),e.format),o=JSON.parse(i);return[{filename:n.filename,fileSize:o.fileSize,structuralRanges:o.structuralRanges,essenceRanges:o.essenceRanges,trimInputs:o.trimInputs}]},async trim(e,t){await d();let n=e.parts[0],r=W(t.items,0);if(r.length===0)throw new Error("isobmff trim: no usable trim ranges in items");let i=await V(r,t.handles,(o,c)=>H(u(n),n.fileSize,o,c,e.format));return i.map((o,c)=>{let a=JSON.parse(o);return i.length>1&&(a.output_clip_number=c+1,a.output_clip_count=i.length,a.output_part_number=1),a})},async decode(e,t,n){await d();let r=n.detail==="coarse",i=e.parts[0];if(e.format==="crm"){let l=await R(u(i),i.fileSize,t,r?"preview":"full");return s(l)}let o=await Y(e);if(t<0||t>=o.length)throw new _(t,o.length);let c=o[t],a=await i.read(c.offset,c.size);if(e.format==="braw")return s(r?v(a,0):y(a));if(b(a)){let l=await q(e);return s(l?m.decode_prores_raw_tier(a,r?"preview":"full",l):r?P(a,0):x(a))}if(j(a))return s(r?D(a,0):z(a));if(r)return s(S(a,0));let g=await ae(a);return g||s(A(a))},async decode16(e,t){await d();let n=e.parts[0];if(e.format==="crm")throw new Error("crm: no 16-bit decoder");let r=await Y(e);if(t<0||t>=r.length)throw new _(t,r.length);let i=r[t],o=await n.read(i.offset,i.size),c=b(o)?await q(e):null,a=e.format==="braw"?w(o):b(o)?c?m.decode_prores_raw_tier(o,"rgb16",c):M(o):j(o)?(()=>{throw new Error("vc3: no 16-bit decoder")})():F(o);return $(a)}};async function ae(e){if(!U)return null;try{let t=await import("./prores-RIG37OIH.js");if(!await t.proresGpuAvailable())return null;let n=await t.decodeProResRgbaGpu(e);return n?{width:n.width,height:n.height,rgba:n.rgba}:null}catch{return null}}function j(e){return e.length>=4&&e[0]===0&&e[1]===0&&e[2]===2&&e[3]===128}function b(e){return e.length>=8&&e[4]===112&&e[5]===114&&e[6]===114&&e[7]===102}function s(e){let t=new DataView(e.buffer,e.byteOffset,8);return{width:t.getUint32(0,!0),height:t.getUint32(4,!0),rgba:e.slice(8)}}var m=C,X=new WeakMap;function q(e){let t=X.get(e);if(!t){let n=e.parts[0];t=m.prores_raw_container_color&&m.decode_prores_raw_tier?N({fileSize:n.fileSize,read:n.read}).then(r=>{let i=m.prores_raw_container_color(r);return i.length?i:null}):Promise.resolve(null),X.set(e,t)}return t}var K=new WeakMap;async function Y(e){let t=K.get(e);if(!t){let n=e.parts[0],r=J(await k(u(n),n.fileSize,e.format));if(!r.w||!r.h)throw new Error("could not find a video sample table");t=r.offs,K.set(e,t)}return t}export{be as isobmffFormat};
3
+ import{a as N}from"./chunk-TK55FA56.js";import{a as T,b as L}from"./chunk-AACY2V3L.js";import{b as p,c as O,g as J}from"./chunk-XDI6CPPV.js";import{b as V}from"./chunk-P3XI63Q2.js";import{b as $,c as _}from"./chunk-F4PHKOAS.js";import{$ as f,A as P,B as x,C as F,D as A,Da as k,Ga as C,Ha as U,Ia as d,N as D,O as z,ha as E,k as w,m as v,n as y,p as R,qa as H,ta as I,x as S,y as M}from"./chunk-DPA26AOI.js";import"./chunk-PSANHDZM.js";function u(e){return(t,n)=>e.read(t,n)}function B(e){let t=e.toLowerCase().trim();return t==="aprn"||t==="aprh"?"prores_raw":t==="apch"||t==="apcn"||t==="apcs"||t==="apco"||t==="ap4h"||t==="ap4x"?"prores":t==="avdn"?"dnxhd":t==="dnxh"?"dnxhr":t==="avc1"||t==="avc3"?"h264":t==="hev1"||t==="hvc1"?"h265":t==="braw"?"braw":e}var h={apco:"Proxy",apcs:"LT",apcn:"422",apch:"HQ",ap4h:"4444",ap4x:"4444 XQ"},Z={1:"bt709",2:"unknown",5:"bt470bg",6:"smpte170m",9:"bt2020",11:"smpte431",12:"smpte432"},ee={1:"bt709",2:"unknown",6:"smpte170m",8:"linear",13:"iec61966-2-1",14:"bt2020-10",15:"bt2020-12",16:"smpte2084",18:"arib-std-b67"},re={0:"gbr",1:"bt709",2:"unknown",5:"bt470bg",6:"smpte170m",9:"bt2020nc",10:"bt2020c"};function te(e,t){return e==="ap4h"||e==="ap4x"?t===32?"yuva444p12le":"yuv444p12le":e in h?"yuv422p10le":void 0}var Q={66:"Baseline",77:"Main",88:"Extended",100:"High",110:"High 10",122:"High 4:2:2",244:"High 4:4:4"},G={1:"Main",2:"Main 10",3:"Main Still",4:"Rext"},ne={1270:"DNxHR 444",1271:"DNxHR HQX",1272:"DNxHR HQ",1273:"DNxHR SQ",1274:"DNxHR LB"};function oe(e,t){if(h[e.codec_fourcc])return`ProRes ${h[e.codec_fourcc]}`;if(e.vc3_cid)return ne[e.vc3_cid]??`DNxHD ${e.vc3_cid}`;if(e.video_profile!=null){if(t==="h264"&&Q[e.video_profile])return`H.264 ${Q[e.video_profile]}`;if(t==="h265"&&G[e.video_profile])return`HEVC ${G[e.video_profile]}`}}function ie(e,t){let n=e.video_chroma,r=e.video_bit_depth;if(n==null&&t==="h264"&&[66,77,88].includes(e.video_profile??-1)&&([n,r]=[1,8]),n==null&&e.vc3_cid&&(n=e.vc3_cid===1270||e.vc3_cid===1256?3:2),n==null||r==null)return;let i=["gray","yuv420p","yuv422p","yuv444p"][n];return r>8?`${i}${r}le`:i}function W(e,t){let n=[];for(let r of e){if(r.kind!=="clip"||!r.source_range)continue;let i=r.source_range.start.value,o=r.source_range.duration.value,c=Math.max(0,Math.floor(i)-t),a=Math.floor(i+o-1)+t;a>=c&&n.push({first_frame:c,last_frame:a})}return n}var be={async inspect(e){await d();let t=e.parts[0],n=await f(u(t),t.fileSize,e.format),r=JSON.parse(n);if(!r)return null;let i=r.timecode&&r.timecode.fps_denominator>0?r.timecode.fps_numerator/r.timecode.fps_denominator:null,o=B(r.codec_fourcc),c=[{kind:"video",codec:o,width:r.width??void 0,height:r.height??void 0,rate:i??void 0,bit_depth:p(r.codec_fourcc)??p(o)??O(o,r.video_profile)??r.video_bit_depth??void 0,codec_specific:{fourcc:r.codec_fourcc,profile:oe(r,o),pixel_format:te(r.codec_fourcc,r.video_depth)??ie(r,o),colr:r.colr?{primaries:Z[r.colr.primaries]??r.colr.primaries,transfer:ee[r.colr.transfer]??r.colr.transfer,matrix:re[r.colr.matrix]??r.colr.matrix}:void 0}}];for(let a of r.audio_tracks??(r.audio?[r.audio]:[]))c.push({kind:"audio",codec:a.codec_fourcc,channels:a.channels??void 0,rate:a.sample_rate??void 0,bit_depth:a.bit_depth??void 0,codec_specific:{fourcc:a.codec_fourcc,channel_layout:a.channel_layout??void 0}});return{id:t.filename,kind:"external",target_url:t.filename,available_range:i&&r.duration_seconds?{start:{value:0,rate:i},duration:{value:Math.round(r.duration_seconds*i),rate:i}}:null,reel_name:null,source_timecode:r.timecode?.display??null,container:e.format==="mov"?"mov":e.format,codec:o,size_bytes:t.fileSize,source_fps:i,source_resolution_w:r.width??null,source_resolution_h:r.height??null,streams:c,decode_provenance:r.decode_provenance??null,vendor_metadata:r.timecode?{drop_frame:r.timecode.drop_frame}:{},binding_state:"unbound",raw_extraction:{mov_probe:r},metadata:{}}},async extract(e){await d();let t=e.parts[0],n=JSON.parse(await E(u(t),t.fileSize,e.format));if(n.length===0)return null;let r=JSON.parse(await f(u(t),t.fileSize,e.format)),i=r?B(r.codec_fourcc):e.format,o=r?.timecode&&r.timecode.fps_denominator>0?r.timecode.fps_numerator/r.timecode.fps_denominator:void 0;return{v:1,container:e.format==="mov"?"mov":e.format,codec:i,width:r?.width??void 0,height:r?.height??void 0,fps:o,frame_count:T(n),timecode:r?.timecode?.display??void 0,granularity:L(n),segments:n}},async sparsify(e,t){await d();let n=e.parts[0],r=W(t.items,t.handles),i=await I(u(n),n.fileSize,JSON.stringify(r),e.format),o=JSON.parse(i);return[{filename:n.filename,fileSize:o.fileSize,structuralRanges:o.structuralRanges,essenceRanges:o.essenceRanges,trimInputs:o.trimInputs}]},async trim(e,t){await d();let n=e.parts[0],r=W(t.items,0);if(r.length===0)throw new Error("isobmff trim: no usable trim ranges in items");let i=await V(r,t.handles,(o,c)=>H(u(n),n.fileSize,o,c,e.format));return i.map((o,c)=>{let a=JSON.parse(o);return i.length>1&&(a.output_clip_number=c+1,a.output_clip_count=i.length,a.output_part_number=1),a})},async decode(e,t,n){await d();let r=n.detail==="coarse",i=e.parts[0];if(e.format==="crm"){let l=await R(u(i),i.fileSize,t,r?"preview":"full");return s(l)}let o=await Y(e);if(t<0||t>=o.length)throw new _(t,o.length);let c=o[t],a=await i.read(c.offset,c.size);if(e.format==="braw")return s(r?v(a,0):y(a));if(b(a)){let l=await q(e);return s(l?m.decode_prores_raw_tier(a,r?"preview":"full",l):r?P(a,0):x(a))}if(j(a))return s(r?D(a,0):z(a));if(r)return s(S(a,0));let g=await ae(a);return g||s(A(a))},async decode16(e,t){await d();let n=e.parts[0];if(e.format==="crm")throw new Error("crm: no 16-bit decoder");let r=await Y(e);if(t<0||t>=r.length)throw new _(t,r.length);let i=r[t],o=await n.read(i.offset,i.size),c=b(o)?await q(e):null,a=e.format==="braw"?w(o):b(o)?c?m.decode_prores_raw_tier(o,"rgb16",c):M(o):j(o)?(()=>{throw new Error("vc3: no 16-bit decoder")})():F(o);return $(a)}};async function ae(e){if(!U)return null;try{let t=await import("./prores-RIG37OIH.js");if(!await t.proresGpuAvailable())return null;let n=await t.decodeProResRgbaGpu(e);return n?{width:n.width,height:n.height,rgba:n.rgba}:null}catch{return null}}function j(e){return e.length>=4&&e[0]===0&&e[1]===0&&e[2]===2&&e[3]===128}function b(e){return e.length>=8&&e[4]===112&&e[5]===114&&e[6]===114&&e[7]===102}function s(e){let t=new DataView(e.buffer,e.byteOffset,8);return{width:t.getUint32(0,!0),height:t.getUint32(4,!0),rgba:e.slice(8)}}var m=C,X=new WeakMap;function q(e){let t=X.get(e);if(!t){let n=e.parts[0];t=m.prores_raw_container_color&&m.decode_prores_raw_tier?N({fileSize:n.fileSize,read:n.read}).then(r=>{let i=m.prores_raw_container_color(r);return i.length?i:null}):Promise.resolve(null),X.set(e,t)}return t}var K=new WeakMap;async function Y(e){let t=K.get(e);if(!t){let n=e.parts[0],r=J(await k(u(n),n.fileSize,e.format));if(!r.w||!r.h)throw new Error("could not find a video sample table");t=r.offs,K.set(e,t)}return t}export{be as isobmffFormat};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- import{c as b}from"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import{c as w,g as y}from"./chunk-JXTRQ3UG.js";import{Ca as l,Ga as p,Ia as h}from"./chunk-DPA26AOI.js";import"./chunk-PSANHDZM.js";var F=72*1024*1024,S=16,m=p;function L(){return typeof m.video_open=="function"&&typeof m.video_decode=="function"}async function P(r,e){if(await h(),!L())return null;try{return JSON.parse(await m.video_open(r,e))}catch{return null}}function k(r){l?.(r)}var u=new WeakMap;function v(r){let e=u.get(r);if(!e){let t=r.parts[0];e=P((n,a)=>t.read(n,a),t.fileSize).then(n=>{if(!n)throw new Error(`mcvideo: media-core has no video decoder for ${t.filename}`);return{info:n,cache:new Map,cacheCoarse:!1,frameBytes:0,queue:Promise.resolve()}}),e.catch(()=>u.delete(r)),u.set(r,e)}return e}async function B(r){try{return(await v(r)).info.frames}catch{return 0}}function _(r){let e=new DataView(r.buffer,r.byteOffset,r.byteLength),t=new Map,n=4;for(let a=e.getUint32(0,!0);a>0&&n+12<=r.length;a--){let s=e.getUint32(n,!0),c=e.getUint32(n+4,!0),i=e.getUint32(n+8,!0),o=c*i*4;if(n+=12,n+o>r.length)break;t.set(s,{width:c,height:i,rgba:r.slice(n,n+o)}),n+=o}return t}async function C(r,e,t){let n=await v(r),{info:a}=n;if(e<0||e>=a.frames)throw new w(e,a.frames);let s=async()=>{let i=t&&a.codec==="dv";n.cacheCoarse!==i&&(n.cache.clear(),n.cacheCoarse=i);let o=n.cache.get(e);if(!o){let g=a.inter?Math.max(1,Math.min(S,n.frameBytes?Math.floor(F/n.frameBytes):4)):1,d=_(await m.video_decode(a.handle,e,Math.min(a.frames,e+g),i));n.cache=d,o=d.get(e),o&&(n.frameBytes=o.rgba.length)}if(!o)throw new Error(`mcvideo: ${a.codec} frame ${e} did not decode`);return n.cache.delete(e),o},c=n.queue.then(s,s);return n.queue=c.catch(()=>{}),c}async function f(r){let e=b(r.parts[0]?.filename??""),t=e?await y(e):null;return t&&e?[t,{...r,format:e}]:null}async function M(r){let e=await f(r);if(!e)throw new Error(`mcvideo: no container module for ${r.parts[0]?.filename} \u2014 ships whole`);return e}var I={async inspect(r){let e=await f(r);return e?e[0].inspect(e[1]):null},async extract(r){let e=await f(r);return e?e[0].extract(e[1]):null},async sparsify(r,e){let[t,n]=await M(r);return t.sparsify(n,e)},async trim(r,e){let[t,n]=await M(r);return t.trim(n,e)},async decode(r,e,{detail:t}){return C(r,e,t==="coarse")}};export{k as closeVideoLane,L as hasVideoLane,I as mcVideoFormat,P as openVideoLane,_ as unpackWindow,B as videoLaneFrames};
3
+ import{c as b}from"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import{c as w,g as y}from"./chunk-F4PHKOAS.js";import{Ca as l,Ga as p,Ia as h}from"./chunk-DPA26AOI.js";import"./chunk-PSANHDZM.js";var F=72*1024*1024,S=16,m=p;function L(){return typeof m.video_open=="function"&&typeof m.video_decode=="function"}async function P(r,e){if(await h(),!L())return null;try{return JSON.parse(await m.video_open(r,e))}catch{return null}}function k(r){l?.(r)}var u=new WeakMap;function v(r){let e=u.get(r);if(!e){let t=r.parts[0];e=P((n,a)=>t.read(n,a),t.fileSize).then(n=>{if(!n)throw new Error(`mcvideo: media-core has no video decoder for ${t.filename}`);return{info:n,cache:new Map,cacheCoarse:!1,frameBytes:0,queue:Promise.resolve()}}),e.catch(()=>u.delete(r)),u.set(r,e)}return e}async function B(r){try{return(await v(r)).info.frames}catch{return 0}}function _(r){let e=new DataView(r.buffer,r.byteOffset,r.byteLength),t=new Map,n=4;for(let a=e.getUint32(0,!0);a>0&&n+12<=r.length;a--){let s=e.getUint32(n,!0),c=e.getUint32(n+4,!0),i=e.getUint32(n+8,!0),o=c*i*4;if(n+=12,n+o>r.length)break;t.set(s,{width:c,height:i,rgba:r.slice(n,n+o)}),n+=o}return t}async function C(r,e,t){let n=await v(r),{info:a}=n;if(e<0||e>=a.frames)throw new w(e,a.frames);let s=async()=>{let i=t&&a.codec==="dv";n.cacheCoarse!==i&&(n.cache.clear(),n.cacheCoarse=i);let o=n.cache.get(e);if(!o){let g=a.inter?Math.max(1,Math.min(S,n.frameBytes?Math.floor(F/n.frameBytes):4)):1,d=_(await m.video_decode(a.handle,e,Math.min(a.frames,e+g),i));n.cache=d,o=d.get(e),o&&(n.frameBytes=o.rgba.length)}if(!o)throw new Error(`mcvideo: ${a.codec} frame ${e} did not decode`);return n.cache.delete(e),o},c=n.queue.then(s,s);return n.queue=c.catch(()=>{}),c}async function f(r){let e=b(r.parts[0]?.filename??""),t=e?await y(e):null;return t&&e?[t,{...r,format:e}]:null}async function M(r){let e=await f(r);if(!e)throw new Error(`mcvideo: no container module for ${r.parts[0]?.filename} \u2014 ships whole`);return e}var I={async inspect(r){let e=await f(r);return e?e[0].inspect(e[1]):null},async extract(r){let e=await f(r);return e?e[0].extract(e[1]):null},async sparsify(r,e){let[t,n]=await M(r);return t.sparsify(n,e)},async trim(r,e){let[t,n]=await M(r);return t.trim(n,e)},async decode(r,e,{detail:t}){return C(r,e,t==="coarse")}};export{k as closeVideoLane,L as hasVideoLane,I as mcVideoFormat,P as openVideoLane,_ as unpackWindow,B as videoLaneFrames};