@open-take/compositor 0.5.2 → 0.6.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/cdp-CzT5BKNY.js +3 -0
- package/dist/cdp-QXbQfXna.js +373 -0
- package/dist/cdp-QXbQfXna.js.map +1 -0
- package/dist/index.d.ts +4327 -195
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26282 -160
- package/dist/index.js.map +1 -1
- package/dist/server-841PMF2H.js +163 -0
- package/dist/server-841PMF2H.js.map +1 -0
- package/dist/server-C2aVv4-t.js +3 -0
- package/kit/audio.mjs +2366 -0
- package/kit/camera.js +587 -0
- package/kit/cursor.js +264 -0
- package/kit/cut.js +427 -0
- package/kit/draw.js +346 -0
- package/kit/look.js +589 -0
- package/kit/map.js +170 -0
- package/kit/media.js +3568 -0
- package/kit/motion.js +1115 -0
- package/kit/seams.js +1006 -0
- package/kit/stage.js +923 -0
- package/kit/time.js +812 -0
- package/kit/world.js +1072 -0
- package/package.json +7 -3
- package/src/ffmpeg.ts +63 -0
- package/src/film/beats.ts +1285 -0
- package/src/film/carry.ts +221 -0
- package/src/film/changes.ts +330 -0
- package/src/film/check.ts +996 -0
- package/src/film/clock.ts +2530 -0
- package/src/film/components-probe.ts +809 -0
- package/src/film/components.ts +1566 -0
- package/src/film/frames.ts +389 -0
- package/src/film/gallery.ts +3276 -0
- package/src/film/kit.ts +515 -0
- package/src/film/layout.ts +701 -0
- package/src/film/listen.ts +1979 -0
- package/src/film/look.ts +3829 -0
- package/src/film/materials.ts +976 -0
- package/src/film/moving.ts +248 -0
- package/src/film/part-files.ts +729 -0
- package/src/film/picture.ts +74 -0
- package/src/film/probe-text.ts +843 -0
- package/src/film/probe.ts +3456 -0
- package/src/film/provenance.ts +596 -0
- package/src/film/render.ts +2447 -0
- package/src/film/report.ts +1631 -0
- package/src/film/sheet.ts +156 -0
- package/src/film/study-declared.ts +123 -0
- package/src/film/study-picture.ts +791 -0
- package/src/film/study-sound.ts +416 -0
- package/src/film/study.ts +864 -0
- package/src/film/tuning.ts +155 -0
- package/src/film/viewer.ts +174 -0
- package/src/html/cdp.ts +575 -0
- package/src/html/server.ts +208 -0
- package/src/index.ts +202 -0
- package/src/launch-render.ts +3 -2
- package/src/math.ts +3 -3
- package/src/mjpeg-matroska.ts +228 -0
- package/src/render.ts +6 -4
- package/src/state-diff.ts +215 -0
- package/src/state-index.ts +99 -0
- package/src/types.ts +59 -1
- package/starter/PLAN.md +84 -0
- package/starter/START.md +460 -0
- package/starter/lib/anim.js +760 -0
- package/starter/lib/devices.js +1402 -0
- package/starter/lib/handoff.js +421 -0
- package/starter/lib/hud.js +1879 -0
- package/starter/lib/measure.mjs +154 -0
- package/starter/lib/moves.js +1095 -0
- package/starter/lib/palette.mjs +803 -0
- package/starter/lib/physics-seeds.mjs +198 -0
- package/starter/lib/physics.js +738 -0
- package/starter/lib/sampler.mjs +242 -0
- package/starter/lib/solid.js +727 -0
- package/starter/lib/space.js +1227 -0
- package/starter/lib/swarm.js +1398 -0
- package/starter/reference/motion.md +276 -0
- package/starter/reference/structure.md +466 -0
- package/starter/reference/travel/motion.md +433 -0
- package/starter/reference/travel/sound.md +241 -0
- package/starter/reference/travel/structure.md +518 -0
- package/starter/samples/NOTICE.txt +55 -0
- package/starter/samples/celli/celli_24_1.opus +0 -0
- package/starter/samples/celli/celli_24_3.opus +0 -0
- package/starter/samples/celli/celli_28_1.opus +0 -0
- package/starter/samples/celli/celli_28_3.opus +0 -0
- package/starter/samples/celli/celli_31_1.opus +0 -0
- package/starter/samples/celli/celli_31_3.opus +0 -0
- package/starter/samples/celli/celli_35_1.opus +0 -0
- package/starter/samples/celli/celli_35_3.opus +0 -0
- package/starter/samples/celli/celli_38_1.opus +0 -0
- package/starter/samples/celli/celli_38_3.opus +0 -0
- package/starter/samples/celli/celli_41_1.opus +0 -0
- package/starter/samples/celli/celli_41_3.opus +0 -0
- package/starter/samples/celli/celli_45_1.opus +0 -0
- package/starter/samples/celli/celli_45_3.opus +0 -0
- package/starter/samples/celli/celli_48_1.opus +0 -0
- package/starter/samples/celli/celli_48_3.opus +0 -0
- package/starter/samples/celli/celli_52_1.opus +0 -0
- package/starter/samples/celli/celli_52_3.opus +0 -0
- package/starter/samples/celli/celli_55_1.opus +0 -0
- package/starter/samples/celli/celli_55_3.opus +0 -0
- package/starter/samples/celli/celli_59_1.opus +0 -0
- package/starter/samples/celli/celli_59_3.opus +0 -0
- package/starter/samples/celli/celli_62_1.opus +0 -0
- package/starter/samples/celli/celli_62_3.opus +0 -0
- package/starter/samples/celli/celli_65_1.opus +0 -0
- package/starter/samples/celli/celli_65_3.opus +0 -0
- package/starter/samples/crash/crash_f_1.flac +0 -0
- package/starter/samples/crash/crash_fff_1.flac +0 -0
- package/starter/samples/ebass/ebass_0_x.flac +0 -0
- package/starter/samples/ebass/ebass_10_x.flac +0 -0
- package/starter/samples/ebass/ebass_11_x.flac +0 -0
- package/starter/samples/ebass/ebass_1_x.flac +0 -0
- package/starter/samples/ebass/ebass_2_x.flac +0 -0
- package/starter/samples/ebass/ebass_3_x.flac +0 -0
- package/starter/samples/ebass/ebass_4_x.flac +0 -0
- package/starter/samples/ebass/ebass_5_x.flac +0 -0
- package/starter/samples/ebass/ebass_6_x.flac +0 -0
- package/starter/samples/ebass/ebass_7_x.flac +0 -0
- package/starter/samples/ebass/ebass_8_x.flac +0 -0
- package/starter/samples/ebass/ebass_9_x.flac +0 -0
- package/starter/samples/ek_clap/ek_clap_1_1.flac +0 -0
- package/starter/samples/ek_hat/ek_hat_1_1.flac +0 -0
- package/starter/samples/ek_hat/ek_hat_1_2.flac +0 -0
- package/starter/samples/ek_kick/ek_kick_1_1.flac +0 -0
- package/starter/samples/ek_kick/ek_kick_1_2.flac +0 -0
- package/starter/samples/glock/glock_67_x.flac +0 -0
- package/starter/samples/glock/glock_72_x.flac +0 -0
- package/starter/samples/glock/glock_79_x.flac +0 -0
- package/starter/samples/glock/glock_84_x.flac +0 -0
- package/starter/samples/glock/glock_91_x.flac +0 -0
- package/starter/samples/glock/glock_96_x.flac +0 -0
- package/starter/samples/harp/harp_101_f.opus +0 -0
- package/starter/samples/harp/harp_28_f.opus +0 -0
- package/starter/samples/harp/harp_31_mp.opus +0 -0
- package/starter/samples/harp/harp_35_mf.opus +0 -0
- package/starter/samples/harp/harp_38_mf.opus +0 -0
- package/starter/samples/harp/harp_41_mf.opus +0 -0
- package/starter/samples/harp/harp_45_mf.opus +0 -0
- package/starter/samples/harp/harp_48_mf.opus +0 -0
- package/starter/samples/harp/harp_52_mf.opus +0 -0
- package/starter/samples/harp/harp_55_mf.opus +0 -0
- package/starter/samples/harp/harp_59_mf.opus +0 -0
- package/starter/samples/harp/harp_62_mf.opus +0 -0
- package/starter/samples/harp/harp_65_mf.opus +0 -0
- package/starter/samples/harp/harp_69_mf.opus +0 -0
- package/starter/samples/harp/harp_72_mf.opus +0 -0
- package/starter/samples/harp/harp_76_mf.opus +0 -0
- package/starter/samples/harp/harp_79_mf.opus +0 -0
- package/starter/samples/harp/harp_83_mf.opus +0 -0
- package/starter/samples/harp/harp_86_mf.opus +0 -0
- package/starter/samples/harp/harp_89_mf.opus +0 -0
- package/starter/samples/harp/harp_93_mf.opus +0 -0
- package/starter/samples/harp/harp_95_mf.opus +0 -0
- package/starter/samples/harp/harp_98_f.opus +0 -0
- package/starter/samples/manifest.json +2951 -0
- package/starter/samples/marimba/marimba_29_x.flac +0 -0
- package/starter/samples/marimba/marimba_36_x.flac +0 -0
- package/starter/samples/marimba/marimba_43_x.flac +0 -0
- package/starter/samples/marimba/marimba_47_x.flac +0 -0
- package/starter/samples/marimba/marimba_53_x.flac +0 -0
- package/starter/samples/marimba/marimba_60_x.flac +0 -0
- package/starter/samples/marimba/marimba_67_x.flac +0 -0
- package/starter/samples/marimba/marimba_71_x.flac +0 -0
- package/starter/samples/marimba/marimba_77_x.flac +0 -0
- package/starter/samples/marimba/marimba_84_x.flac +0 -0
- package/starter/samples/piano/piano_102_12.opus +0 -0
- package/starter/samples/piano/piano_102_16.opus +0 -0
- package/starter/samples/piano/piano_102_4.opus +0 -0
- package/starter/samples/piano/piano_102_8.opus +0 -0
- package/starter/samples/piano/piano_105_12.opus +0 -0
- package/starter/samples/piano/piano_105_16.opus +0 -0
- package/starter/samples/piano/piano_105_4.opus +0 -0
- package/starter/samples/piano/piano_105_8.opus +0 -0
- package/starter/samples/piano/piano_108_12.opus +0 -0
- package/starter/samples/piano/piano_108_16.opus +0 -0
- package/starter/samples/piano/piano_108_4.opus +0 -0
- package/starter/samples/piano/piano_108_8.opus +0 -0
- package/starter/samples/piano/piano_21_12.opus +0 -0
- package/starter/samples/piano/piano_21_16.opus +0 -0
- package/starter/samples/piano/piano_21_4.opus +0 -0
- package/starter/samples/piano/piano_21_8.opus +0 -0
- package/starter/samples/piano/piano_24_12.opus +0 -0
- package/starter/samples/piano/piano_24_16.opus +0 -0
- package/starter/samples/piano/piano_24_4.opus +0 -0
- package/starter/samples/piano/piano_24_8.opus +0 -0
- package/starter/samples/piano/piano_27_12.opus +0 -0
- package/starter/samples/piano/piano_27_16.opus +0 -0
- package/starter/samples/piano/piano_27_4.opus +0 -0
- package/starter/samples/piano/piano_27_8.opus +0 -0
- package/starter/samples/piano/piano_30_12.opus +0 -0
- package/starter/samples/piano/piano_30_16.opus +0 -0
- package/starter/samples/piano/piano_30_4.opus +0 -0
- package/starter/samples/piano/piano_30_8.opus +0 -0
- package/starter/samples/piano/piano_33_12.opus +0 -0
- package/starter/samples/piano/piano_33_16.opus +0 -0
- package/starter/samples/piano/piano_33_4.opus +0 -0
- package/starter/samples/piano/piano_33_8.opus +0 -0
- package/starter/samples/piano/piano_36_12.opus +0 -0
- package/starter/samples/piano/piano_36_16.opus +0 -0
- package/starter/samples/piano/piano_36_4.opus +0 -0
- package/starter/samples/piano/piano_36_8.opus +0 -0
- package/starter/samples/piano/piano_39_12.opus +0 -0
- package/starter/samples/piano/piano_39_16.opus +0 -0
- package/starter/samples/piano/piano_39_4.opus +0 -0
- package/starter/samples/piano/piano_39_8.opus +0 -0
- package/starter/samples/piano/piano_42_12.opus +0 -0
- package/starter/samples/piano/piano_42_16.opus +0 -0
- package/starter/samples/piano/piano_42_4.opus +0 -0
- package/starter/samples/piano/piano_42_8.opus +0 -0
- package/starter/samples/piano/piano_45_12.opus +0 -0
- package/starter/samples/piano/piano_45_16.opus +0 -0
- package/starter/samples/piano/piano_45_4.opus +0 -0
- package/starter/samples/piano/piano_45_8.opus +0 -0
- package/starter/samples/piano/piano_48_12.opus +0 -0
- package/starter/samples/piano/piano_48_16.opus +0 -0
- package/starter/samples/piano/piano_48_4.opus +0 -0
- package/starter/samples/piano/piano_48_8.opus +0 -0
- package/starter/samples/piano/piano_51_12.opus +0 -0
- package/starter/samples/piano/piano_51_16.opus +0 -0
- package/starter/samples/piano/piano_51_4.opus +0 -0
- package/starter/samples/piano/piano_51_8.opus +0 -0
- package/starter/samples/piano/piano_54_12.opus +0 -0
- package/starter/samples/piano/piano_54_16.opus +0 -0
- package/starter/samples/piano/piano_54_4.opus +0 -0
- package/starter/samples/piano/piano_54_8.opus +0 -0
- package/starter/samples/piano/piano_57_12.opus +0 -0
- package/starter/samples/piano/piano_57_16.opus +0 -0
- package/starter/samples/piano/piano_57_4.opus +0 -0
- package/starter/samples/piano/piano_57_8.opus +0 -0
- package/starter/samples/piano/piano_60_12.opus +0 -0
- package/starter/samples/piano/piano_60_16.opus +0 -0
- package/starter/samples/piano/piano_60_4.opus +0 -0
- package/starter/samples/piano/piano_60_8.opus +0 -0
- package/starter/samples/piano/piano_63_12.opus +0 -0
- package/starter/samples/piano/piano_63_16.opus +0 -0
- package/starter/samples/piano/piano_63_4.opus +0 -0
- package/starter/samples/piano/piano_63_8.opus +0 -0
- package/starter/samples/piano/piano_66_12.opus +0 -0
- package/starter/samples/piano/piano_66_16.opus +0 -0
- package/starter/samples/piano/piano_66_4.opus +0 -0
- package/starter/samples/piano/piano_66_8.opus +0 -0
- package/starter/samples/piano/piano_69_12.opus +0 -0
- package/starter/samples/piano/piano_69_16.opus +0 -0
- package/starter/samples/piano/piano_69_4.opus +0 -0
- package/starter/samples/piano/piano_69_8.opus +0 -0
- package/starter/samples/piano/piano_72_12.opus +0 -0
- package/starter/samples/piano/piano_72_16.opus +0 -0
- package/starter/samples/piano/piano_72_4.opus +0 -0
- package/starter/samples/piano/piano_72_8.opus +0 -0
- package/starter/samples/piano/piano_75_12.opus +0 -0
- package/starter/samples/piano/piano_75_16.opus +0 -0
- package/starter/samples/piano/piano_75_4.opus +0 -0
- package/starter/samples/piano/piano_75_8.opus +0 -0
- package/starter/samples/piano/piano_78_12.opus +0 -0
- package/starter/samples/piano/piano_78_16.opus +0 -0
- package/starter/samples/piano/piano_78_4.opus +0 -0
- package/starter/samples/piano/piano_78_8.opus +0 -0
- package/starter/samples/piano/piano_81_12.opus +0 -0
- package/starter/samples/piano/piano_81_16.opus +0 -0
- package/starter/samples/piano/piano_81_4.opus +0 -0
- package/starter/samples/piano/piano_81_8.opus +0 -0
- package/starter/samples/piano/piano_84_12.opus +0 -0
- package/starter/samples/piano/piano_84_16.opus +0 -0
- package/starter/samples/piano/piano_84_4.opus +0 -0
- package/starter/samples/piano/piano_84_8.opus +0 -0
- package/starter/samples/piano/piano_87_12.opus +0 -0
- package/starter/samples/piano/piano_87_16.opus +0 -0
- package/starter/samples/piano/piano_87_4.opus +0 -0
- package/starter/samples/piano/piano_87_8.opus +0 -0
- package/starter/samples/piano/piano_90_12.opus +0 -0
- package/starter/samples/piano/piano_90_16.opus +0 -0
- package/starter/samples/piano/piano_90_4.opus +0 -0
- package/starter/samples/piano/piano_90_8.opus +0 -0
- package/starter/samples/piano/piano_93_12.opus +0 -0
- package/starter/samples/piano/piano_93_16.opus +0 -0
- package/starter/samples/piano/piano_93_4.opus +0 -0
- package/starter/samples/piano/piano_93_8.opus +0 -0
- package/starter/samples/piano/piano_96_12.opus +0 -0
- package/starter/samples/piano/piano_96_16.opus +0 -0
- package/starter/samples/piano/piano_96_4.opus +0 -0
- package/starter/samples/piano/piano_96_8.opus +0 -0
- package/starter/samples/piano/piano_99_12.opus +0 -0
- package/starter/samples/piano/piano_99_16.opus +0 -0
- package/starter/samples/piano/piano_99_4.opus +0 -0
- package/starter/samples/piano/piano_99_8.opus +0 -0
- package/starter/samples/piano/piano_rel_102_x.opus +0 -0
- package/starter/samples/piano/piano_rel_105_x.opus +0 -0
- package/starter/samples/piano/piano_rel_108_x.opus +0 -0
- package/starter/samples/piano/piano_rel_21_x.opus +0 -0
- package/starter/samples/piano/piano_rel_24_x.opus +0 -0
- package/starter/samples/piano/piano_rel_27_x.opus +0 -0
- package/starter/samples/piano/piano_rel_30_x.opus +0 -0
- package/starter/samples/piano/piano_rel_33_x.opus +0 -0
- package/starter/samples/piano/piano_rel_36_x.opus +0 -0
- package/starter/samples/piano/piano_rel_39_x.opus +0 -0
- package/starter/samples/piano/piano_rel_42_x.opus +0 -0
- package/starter/samples/piano/piano_rel_45_x.opus +0 -0
- package/starter/samples/piano/piano_rel_48_x.opus +0 -0
- package/starter/samples/piano/piano_rel_51_x.opus +0 -0
- package/starter/samples/piano/piano_rel_54_x.opus +0 -0
- package/starter/samples/piano/piano_rel_57_x.opus +0 -0
- package/starter/samples/piano/piano_rel_60_x.opus +0 -0
- package/starter/samples/piano/piano_rel_63_x.opus +0 -0
- package/starter/samples/piano/piano_rel_66_x.opus +0 -0
- package/starter/samples/piano/piano_rel_69_x.opus +0 -0
- package/starter/samples/piano/piano_rel_72_x.opus +0 -0
- package/starter/samples/piano/piano_rel_75_x.opus +0 -0
- package/starter/samples/piano/piano_rel_78_x.opus +0 -0
- package/starter/samples/piano/piano_rel_81_x.opus +0 -0
- package/starter/samples/piano/piano_rel_84_x.opus +0 -0
- package/starter/samples/piano/piano_rel_87_x.opus +0 -0
- package/starter/samples/piano/piano_rel_90_x.opus +0 -0
- package/starter/samples/piano/piano_rel_93_x.opus +0 -0
- package/starter/samples/piano/piano_rel_96_x.opus +0 -0
- package/starter/samples/piano/piano_rel_99_x.opus +0 -0
- package/starter/samples/pizz/pizz_24_2.flac +0 -0
- package/starter/samples/pizz/pizz_28_2.flac +0 -0
- package/starter/samples/pizz/pizz_31_2.flac +0 -0
- package/starter/samples/pizz/pizz_35_2.flac +0 -0
- package/starter/samples/pizz/pizz_38_2.flac +0 -0
- package/starter/samples/pizz/pizz_41_2.flac +0 -0
- package/starter/samples/pizz/pizz_45_2.flac +0 -0
- package/starter/samples/pizz/pizz_48_2.flac +0 -0
- package/starter/samples/pizz/pizz_52_2.flac +0 -0
- package/starter/samples/pizz/pizz_57_2.flac +0 -0
- package/starter/samples/pizz/pizz_60_2.flac +0 -0
- package/starter/samples/pizz/pizz_64_2.flac +0 -0
- package/starter/samples/pizz/pizz_67_2.flac +0 -0
- package/starter/samples/pizz/pizz_71_2.flac +0 -0
- package/starter/samples/pizz/pizz_74_2.flac +0 -0
- package/starter/samples/pk_hat/pk_hat_2_1.flac +0 -0
- package/starter/samples/pk_hat/pk_hat_2_2.flac +0 -0
- package/starter/samples/pk_hat/pk_hat_6_1.flac +0 -0
- package/starter/samples/pk_hat/pk_hat_6_2.flac +0 -0
- package/starter/samples/pk_kick/pk_kick_3_1.flac +0 -0
- package/starter/samples/pk_kick/pk_kick_3_2.flac +0 -0
- package/starter/samples/pk_kick/pk_kick_7_1.flac +0 -0
- package/starter/samples/pk_kick/pk_kick_7_2.flac +0 -0
- package/starter/samples/pk_ohat/pk_ohat_3_1.flac +0 -0
- package/starter/samples/pk_ohat/pk_ohat_3_2.flac +0 -0
- package/starter/samples/pk_ohat/pk_ohat_6_1.flac +0 -0
- package/starter/samples/pk_ohat/pk_ohat_6_2.flac +0 -0
- package/starter/samples/pk_rim/pk_rim_2_1.flac +0 -0
- package/starter/samples/pk_rim/pk_rim_2_2.flac +0 -0
- package/starter/samples/pk_rim/pk_rim_5_1.flac +0 -0
- package/starter/samples/pk_rim/pk_rim_5_2.flac +0 -0
- package/starter/samples/pk_snare/pk_snare_3_1.flac +0 -0
- package/starter/samples/pk_snare/pk_snare_3_2.flac +0 -0
- package/starter/samples/pk_snare/pk_snare_7_1.flac +0 -0
- package/starter/samples/pk_snare/pk_snare_7_2.flac +0 -0
- package/starter/samples/shaker/shaker_1_1.flac +0 -0
- package/starter/samples/shaker/shaker_2_1.flac +0 -0
- package/starter/samples/snap/snap_r_1.flac +0 -0
- package/starter/samples/snap/snap_r_2.flac +0 -0
- package/starter/samples/snap/snap_r_3.flac +0 -0
- package/starter/samples/snap/snap_r_4.flac +0 -0
- package/starter/samples/snap/snap_r_5.flac +0 -0
- package/starter/samples/snap/snap_r_6.flac +0 -0
- package/starter/samples/tom/tom_3_1.flac +0 -0
- package/starter/samples/tom/tom_3_2.flac +0 -0
- package/starter/samples/tom/tom_4_1.flac +0 -0
- package/starter/samples/tom/tom_4_2.flac +0 -0
- package/starter/samples/vibes/vibes_41_1.opus +0 -0
- package/starter/samples/vibes/vibes_41_2.opus +0 -0
- package/starter/samples/vibes/vibes_45_1.opus +0 -0
- package/starter/samples/vibes/vibes_45_2.opus +0 -0
- package/starter/samples/vibes/vibes_48_1.opus +0 -0
- package/starter/samples/vibes/vibes_48_2.opus +0 -0
- package/starter/samples/vibes/vibes_52_1.opus +0 -0
- package/starter/samples/vibes/vibes_52_2.opus +0 -0
- package/starter/samples/vibes/vibes_55_1.opus +0 -0
- package/starter/samples/vibes/vibes_55_2.opus +0 -0
- package/starter/samples/vibes/vibes_59_1.opus +0 -0
- package/starter/samples/vibes/vibes_59_2.opus +0 -0
- package/starter/samples/vibes/vibes_62_1.opus +0 -0
- package/starter/samples/vibes/vibes_62_2.opus +0 -0
- package/starter/samples/vibes/vibes_65_1.opus +0 -0
- package/starter/samples/vibes/vibes_65_2.opus +0 -0
- package/starter/samples/vibes/vibes_69_1.opus +0 -0
- package/starter/samples/vibes/vibes_69_2.opus +0 -0
- package/starter/samples/vibes/vibes_72_1.opus +0 -0
- package/starter/samples/vibes/vibes_72_2.opus +0 -0
- package/starter/samples/vibes/vibes_76_1.opus +0 -0
- package/starter/samples/vibes/vibes_76_2.opus +0 -0
- package/starter/samples/violas/violas_36_1.opus +0 -0
- package/starter/samples/violas/violas_36_2.opus +0 -0
- package/starter/samples/violas/violas_38_1.opus +0 -0
- package/starter/samples/violas/violas_38_2.opus +0 -0
- package/starter/samples/violas/violas_40_1.opus +0 -0
- package/starter/samples/violas/violas_40_2.opus +0 -0
- package/starter/samples/violas/violas_43_1.opus +0 -0
- package/starter/samples/violas/violas_43_2.opus +0 -0
- package/starter/samples/violas/violas_47_1.opus +0 -0
- package/starter/samples/violas/violas_47_2.opus +0 -0
- package/starter/samples/violas/violas_50_1.opus +0 -0
- package/starter/samples/violas/violas_50_2.opus +0 -0
- package/starter/samples/violas/violas_53_1.opus +0 -0
- package/starter/samples/violas/violas_53_2.opus +0 -0
- package/starter/samples/violas/violas_57_1.opus +0 -0
- package/starter/samples/violas/violas_57_2.opus +0 -0
- package/starter/samples/violas/violas_60_1.opus +0 -0
- package/starter/samples/violas/violas_60_2.opus +0 -0
- package/starter/samples/violas/violas_64_1.opus +0 -0
- package/starter/samples/violas/violas_64_2.opus +0 -0
- package/starter/samples/violas/violas_67_1.opus +0 -0
- package/starter/samples/violas/violas_67_2.opus +0 -0
- package/starter/samples/violas/violas_71_1.opus +0 -0
- package/starter/samples/violas/violas_71_2.opus +0 -0
- package/starter/samples/violas/violas_74_1.opus +0 -0
- package/starter/samples/violas/violas_74_2.opus +0 -0
- package/starter/samples/violins/violins_43_1.opus +0 -0
- package/starter/samples/violins/violins_43_2.opus +0 -0
- package/starter/samples/violins/violins_45_1.opus +0 -0
- package/starter/samples/violins/violins_45_2.opus +0 -0
- package/starter/samples/violins/violins_47_1.opus +0 -0
- package/starter/samples/violins/violins_47_2.opus +0 -0
- package/starter/samples/violins/violins_50_1.opus +0 -0
- package/starter/samples/violins/violins_50_2.opus +0 -0
- package/starter/samples/violins/violins_54_1.opus +0 -0
- package/starter/samples/violins/violins_54_2.opus +0 -0
- package/starter/samples/violins/violins_57_1.opus +0 -0
- package/starter/samples/violins/violins_57_2.opus +0 -0
- package/starter/samples/violins/violins_60_1.opus +0 -0
- package/starter/samples/violins/violins_60_2.opus +0 -0
- package/starter/samples/violins/violins_64_1.opus +0 -0
- package/starter/samples/violins/violins_64_2.opus +0 -0
- package/starter/samples/violins/violins_67_1.opus +0 -0
- package/starter/samples/violins/violins_67_2.opus +0 -0
- package/starter/samples/violins/violins_71_1.opus +0 -0
- package/starter/samples/violins/violins_71_2.opus +0 -0
- package/starter/samples/violins/violins_74_1.opus +0 -0
- package/starter/samples/violins/violins_74_2.opus +0 -0
- package/starter/samples/woodblock/woodblock_f_1.flac +0 -0
- package/starter/samples/woodblock/woodblock_f_2.flac +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// `open-take film sheet`: a film (or any video) as one image — frames on a
|
|
2
|
+
// grid, each captioned with its time — for looking at a whole cut at once.
|
|
3
|
+
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
7
|
+
import { join, resolve } from "node:path";
|
|
8
|
+
import { pathToFileURL } from "node:url";
|
|
9
|
+
import { resolveFfmpeg, resolveFfprobe, runTool } from "../ffmpeg";
|
|
10
|
+
import { launchHtmlBrowser } from "../html/cdp";
|
|
11
|
+
|
|
12
|
+
export type FilmSheetOptions = {
|
|
13
|
+
/** the video */
|
|
14
|
+
input: string;
|
|
15
|
+
/** the PNG to write */
|
|
16
|
+
out: string;
|
|
17
|
+
chromePath: string;
|
|
18
|
+
/** seconds between frames; default: about 48 frames over the film */
|
|
19
|
+
every?: number;
|
|
20
|
+
/** exact times instead (seconds) */
|
|
21
|
+
at?: readonly number[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export async function filmSheet(opts: FilmSheetOptions): Promise<{ out: string; times: number[] }> {
|
|
25
|
+
const [ffmpeg, ffprobe] = await Promise.all([resolveFfmpeg(), resolveFfprobe()]);
|
|
26
|
+
const info = JSON.parse(
|
|
27
|
+
await runTool(ffprobe, [
|
|
28
|
+
"-v",
|
|
29
|
+
"error",
|
|
30
|
+
"-select_streams",
|
|
31
|
+
"v:0",
|
|
32
|
+
"-show_entries",
|
|
33
|
+
"stream=width,height,r_frame_rate:format=duration",
|
|
34
|
+
"-of",
|
|
35
|
+
"json",
|
|
36
|
+
opts.input,
|
|
37
|
+
]),
|
|
38
|
+
) as {
|
|
39
|
+
streams?: { width: number; height: number; r_frame_rate?: string }[];
|
|
40
|
+
format?: { duration?: string };
|
|
41
|
+
};
|
|
42
|
+
const duration = Number(info.format?.duration ?? 0);
|
|
43
|
+
const [rn, rd] = String(info.streams?.[0]?.r_frame_rate ?? "60/1")
|
|
44
|
+
.split("/")
|
|
45
|
+
.map(Number);
|
|
46
|
+
const fps = rn && rd ? rn / rd : 60;
|
|
47
|
+
const vw = info.streams?.[0]?.width ?? 16;
|
|
48
|
+
const vh = info.streams?.[0]?.height ?? 9;
|
|
49
|
+
if (!(duration > 0)) throw new Error(`film sheet: ${opts.input} has no duration`);
|
|
50
|
+
const every = opts.every ?? Math.max(0.25, Math.round((duration / 48) * 4) / 4);
|
|
51
|
+
// inside the last frame (a 30 fps draft's last frame starts 1/30 s before the end)
|
|
52
|
+
const last = Math.max(0, duration - 1.5 / fps);
|
|
53
|
+
const times = opts.at?.length
|
|
54
|
+
? [...opts.at].filter((t) => t >= 0 && t <= duration).sort((a, b) => a - b)
|
|
55
|
+
: Array.from(
|
|
56
|
+
{ length: Math.floor(last / every) + 1 },
|
|
57
|
+
(_, i) => Math.round(i * every * 1000) / 1000,
|
|
58
|
+
);
|
|
59
|
+
if (!opts.at?.length && last - times[times.length - 1]! > every / 2)
|
|
60
|
+
times.push(Math.round(last * 1000) / 1000);
|
|
61
|
+
const columns = vw >= vh ? 6 : 10;
|
|
62
|
+
const tileW = vw >= vh ? 480 : 216;
|
|
63
|
+
const tileH = Math.round((tileW * vh) / vw);
|
|
64
|
+
|
|
65
|
+
const tmp = await mkdtemp(join(tmpdir(), "open-take-sheet-"));
|
|
66
|
+
try {
|
|
67
|
+
// a time no frame can be read at (past the end, a damaged stretch) is
|
|
68
|
+
// tried a frame earlier, then left out — it never costs the whole sheet
|
|
69
|
+
const got = new Set<number>();
|
|
70
|
+
await Promise.all(
|
|
71
|
+
chunked(times, 6).map(async (group) => {
|
|
72
|
+
for (const t of group) {
|
|
73
|
+
const i = times.indexOf(t);
|
|
74
|
+
const file = join(tmp, `f${String(i).padStart(4, "0")}.jpg`);
|
|
75
|
+
for (const at of [t, Math.max(0, t - 1 / fps)]) {
|
|
76
|
+
await runTool(ffmpeg, [
|
|
77
|
+
"-v",
|
|
78
|
+
"error",
|
|
79
|
+
"-ss",
|
|
80
|
+
String(at),
|
|
81
|
+
"-i",
|
|
82
|
+
resolve(opts.input),
|
|
83
|
+
"-frames:v",
|
|
84
|
+
"1",
|
|
85
|
+
"-vf",
|
|
86
|
+
`scale=${tileW * 2}:-2`,
|
|
87
|
+
"-q:v",
|
|
88
|
+
"3",
|
|
89
|
+
"-y",
|
|
90
|
+
file,
|
|
91
|
+
]).catch(() => {});
|
|
92
|
+
if (existsSync(file)) {
|
|
93
|
+
got.add(i);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
);
|
|
100
|
+
const kept = times.filter((_, i) => got.has(i));
|
|
101
|
+
if (!kept.length) throw new Error(`film sheet: no frame of ${opts.input} could be read`);
|
|
102
|
+
const rows = Math.ceil(kept.length / columns);
|
|
103
|
+
const gap = 6;
|
|
104
|
+
const caption = 22;
|
|
105
|
+
const width = columns * tileW + (columns + 1) * gap;
|
|
106
|
+
const height = rows * (tileH + caption + gap) + gap;
|
|
107
|
+
const cells = times
|
|
108
|
+
.map((t, i) =>
|
|
109
|
+
got.has(i)
|
|
110
|
+
? `<figure><img src="f${String(i).padStart(4, "0")}.jpg"><figcaption>${fmt(t)}</figcaption></figure>`
|
|
111
|
+
: "",
|
|
112
|
+
)
|
|
113
|
+
.join("");
|
|
114
|
+
await writeFile(
|
|
115
|
+
join(tmp, "sheet.html"),
|
|
116
|
+
`<!doctype html><meta charset="utf-8"><style>
|
|
117
|
+
html,body{margin:0;background:#fff}
|
|
118
|
+
body{display:grid;grid-template-columns:repeat(${columns},${tileW}px);gap:${gap}px;padding:${gap}px}
|
|
119
|
+
figure{margin:0}img{display:block;width:${tileW}px;height:${tileH}px;object-fit:cover;background:#000}
|
|
120
|
+
figcaption{height:${caption}px;font:600 13px/22px ui-monospace,Menlo,monospace;color:#111}
|
|
121
|
+
</style>${cells}`,
|
|
122
|
+
);
|
|
123
|
+
const browser = await launchHtmlBrowser({
|
|
124
|
+
chromePath: opts.chromePath,
|
|
125
|
+
url: pathToFileURL(join(tmp, "sheet.html")).href,
|
|
126
|
+
width,
|
|
127
|
+
height,
|
|
128
|
+
profilePrefix: "open-take-sheet-",
|
|
129
|
+
});
|
|
130
|
+
try {
|
|
131
|
+
await browser.evaluate(
|
|
132
|
+
"Promise.all([...document.images].map((i) => i.decode().catch(() => {})))",
|
|
133
|
+
);
|
|
134
|
+
await writeFile(resolve(opts.out), await browser.screenshot({ format: "png" }));
|
|
135
|
+
} finally {
|
|
136
|
+
await browser.close();
|
|
137
|
+
}
|
|
138
|
+
return { out: resolve(opts.out), times: kept };
|
|
139
|
+
} finally {
|
|
140
|
+
await rm(tmp, { recursive: true, force: true });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const fmt = (t: number) => {
|
|
145
|
+
const m = Math.floor(t / 60);
|
|
146
|
+
const s = (t - m * 60).toFixed(2).padStart(5, "0");
|
|
147
|
+
return m ? `${m}:${s}` : `${s}s`;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
function chunked<T>(xs: readonly T[], n: number): T[][] {
|
|
151
|
+
const out: T[][] = Array.from({ length: n }, () => []);
|
|
152
|
+
xs.forEach((x, i) => {
|
|
153
|
+
out[i % n]!.push(x);
|
|
154
|
+
});
|
|
155
|
+
return out.filter((g) => g.length);
|
|
156
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// What a film's own page declared about its boundaries, for `film study` to
|
|
2
|
+
// set beside what it reads from the picture. A film rendered with this tool
|
|
3
|
+
// has <film>.events.json next to it: events of kind "cut" and "hidden-cut",
|
|
4
|
+
// the beat sheet's segments with their handoffs, and for a segment that names
|
|
5
|
+
// a carry, the box of that thing followed across the boundary by the render.
|
|
6
|
+
// A cut the page made on purpose with something flying across it looks, on a
|
|
7
|
+
// small grey copy, like any other hard cut; the declaration says what it was
|
|
8
|
+
// meant as and the render's own measurement says whether the thing crossed.
|
|
9
|
+
// A film from elsewhere has no such file and is read from the picture alone.
|
|
10
|
+
|
|
11
|
+
import { existsSync } from "node:fs";
|
|
12
|
+
import { readFile } from "node:fs/promises";
|
|
13
|
+
import { type BoundaryCarry, boundaryCarries, carryChange } from "./carry";
|
|
14
|
+
import { eventsPathFor, type FilmEvents } from "./render";
|
|
15
|
+
|
|
16
|
+
export type DeclaredBoundary = {
|
|
17
|
+
/** s on the film's own clock */
|
|
18
|
+
at: number;
|
|
19
|
+
/** the kinds of the page's events here: "cut", "hidden-cut", or the page's own word */
|
|
20
|
+
kinds: string[];
|
|
21
|
+
/** those events' labels */
|
|
22
|
+
labels: string[];
|
|
23
|
+
/** the handoff written on the segment ending here */
|
|
24
|
+
handoff?: string;
|
|
25
|
+
/** what that segment named to follow across */
|
|
26
|
+
carry?: string;
|
|
27
|
+
/** what the render measured of that thing (carry.ts), when it named one */
|
|
28
|
+
carried?: { kind: "carried" | "anchored" | "bare"; change: string; note?: string };
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type Declarations = { file: string; boundaries: DeclaredBoundary[] };
|
|
32
|
+
|
|
33
|
+
/** why an events file beside a film was left unread */
|
|
34
|
+
export type DeclarationsSkipped = { file: string; skipped: string };
|
|
35
|
+
|
|
36
|
+
const isNumber = (v: unknown): v is number => typeof v === "number" && Number.isFinite(v);
|
|
37
|
+
|
|
38
|
+
/** The boundaries an events file declares, on the film's clock: every "cut"
|
|
39
|
+
* and "hidden-cut" event and every segment that ends before the film does.
|
|
40
|
+
* Other events at one of those times (a "whip", say) lend their kind and
|
|
41
|
+
* label. Times within `tolerance` seconds are one boundary. */
|
|
42
|
+
export function declaredBoundaries(ev: FilmEvents, tolerance: number): DeclaredBoundary[] {
|
|
43
|
+
const from = ev.range?.[0] ?? 0;
|
|
44
|
+
const to = ev.range?.[1] ?? ev.duration;
|
|
45
|
+
const inside = (t: number) => t > from + tolerance && t < to - tolerance;
|
|
46
|
+
const out: DeclaredBoundary[] = [];
|
|
47
|
+
const at = (t: number) => {
|
|
48
|
+
const film = +(t - from).toFixed(6);
|
|
49
|
+
let b = out.find((x) => Math.abs(x.at - film) <= tolerance);
|
|
50
|
+
if (!b) {
|
|
51
|
+
b = { at: film, kinds: [], labels: [] };
|
|
52
|
+
out.push(b);
|
|
53
|
+
}
|
|
54
|
+
return b;
|
|
55
|
+
};
|
|
56
|
+
for (const e of ev.events)
|
|
57
|
+
if ((e.kind === "cut" || e.kind === "hidden-cut") && inside(e.t)) at(e.t);
|
|
58
|
+
const carries = new Map<number, BoundaryCarry>();
|
|
59
|
+
for (const c of boundaryCarries(ev, from)) {
|
|
60
|
+
const page = c.at + from;
|
|
61
|
+
if (!inside(page)) continue;
|
|
62
|
+
carries.set(at(page).at, c);
|
|
63
|
+
}
|
|
64
|
+
for (const b of out) {
|
|
65
|
+
for (const e of ev.events) {
|
|
66
|
+
if (e.kind === "mark" || Math.abs(e.t - from - b.at) > tolerance) continue;
|
|
67
|
+
if (!b.kinds.includes(e.kind)) b.kinds.push(e.kind);
|
|
68
|
+
if (e.label && !b.labels.includes(e.label)) b.labels.push(e.label);
|
|
69
|
+
}
|
|
70
|
+
const c = carries.get(b.at);
|
|
71
|
+
if (!c) continue;
|
|
72
|
+
if (c.handoff) b.handoff = c.handoff;
|
|
73
|
+
if (c.carry) b.carry = c.carry;
|
|
74
|
+
if (c.how.measured)
|
|
75
|
+
b.carried = {
|
|
76
|
+
kind: c.how.kind,
|
|
77
|
+
change: carryChange(c),
|
|
78
|
+
...(c.how.note ? { note: c.how.note } : {}),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return out.sort((a, b) => a.at - b.at);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** The declarations beside a film, when its events file is there and is this
|
|
85
|
+
* film's: null when there is none (a film from elsewhere), `skipped` when a
|
|
86
|
+
* file is there but cannot be this film's. `duration` is the picture's. */
|
|
87
|
+
export async function readDeclarations(
|
|
88
|
+
film: string,
|
|
89
|
+
duration: number,
|
|
90
|
+
frameSeconds: number,
|
|
91
|
+
): Promise<Declarations | DeclarationsSkipped | null> {
|
|
92
|
+
const file = eventsPathFor(film);
|
|
93
|
+
if (!existsSync(file)) return null;
|
|
94
|
+
let ev: FilmEvents;
|
|
95
|
+
try {
|
|
96
|
+
ev = JSON.parse(await readFile(file, "utf8")) as FilmEvents;
|
|
97
|
+
} catch {
|
|
98
|
+
return { file, skipped: "it is not JSON" };
|
|
99
|
+
}
|
|
100
|
+
if (!ev || !isNumber(ev.duration) || !isNumber(ev.fps) || !Array.isArray(ev.events))
|
|
101
|
+
return { file, skipped: "it is not an events file" };
|
|
102
|
+
const range = Array.isArray(ev.range) && ev.range.every(isNumber) ? ev.range : undefined;
|
|
103
|
+
const length = range ? range[1] - range[0] : ev.duration;
|
|
104
|
+
// A film re-cut or trimmed after the render no longer shares its clock.
|
|
105
|
+
if (Math.abs(length - duration) > 0.5)
|
|
106
|
+
return {
|
|
107
|
+
file,
|
|
108
|
+
skipped: `it describes ${length.toFixed(2)} s and the picture runs ${duration.toFixed(2)} s`,
|
|
109
|
+
};
|
|
110
|
+
const clean: FilmEvents = {
|
|
111
|
+
...ev,
|
|
112
|
+
range,
|
|
113
|
+
events: ev.events.filter((e) => e && isNumber(e.t) && typeof e.kind === "string"),
|
|
114
|
+
segments: (Array.isArray(ev.segments) ? ev.segments : []).filter(
|
|
115
|
+
(s) => s && isNumber(s.from) && isNumber(s.to),
|
|
116
|
+
),
|
|
117
|
+
curves:
|
|
118
|
+
ev.curves && Array.isArray(ev.curves.names) && Array.isArray(ev.curves.rows)
|
|
119
|
+
? ev.curves
|
|
120
|
+
: { names: [], t0: 0, dt: 1 / ev.fps, rows: [] },
|
|
121
|
+
};
|
|
122
|
+
return { file, boundaries: declaredBoundaries(clean, 1.5 * frameSeconds) };
|
|
123
|
+
}
|