Add streaming video compositor with sexp interpreter
- New streaming/ module for real-time video processing: - compositor.py: Main streaming compositor with cycle-crossfade - sexp_executor.py: Executes compiled sexp recipes in real-time - sexp_interp.py: Full S-expression interpreter for SLICE_ON Lambda - recipe_adapter.py: Bridges recipes to streaming compositor - sources.py: Video source with ffmpeg streaming - audio.py: Real-time audio analysis (energy, beats) - output.py: Preview (mpv) and file output with audio muxing - New templates/: - cycle-crossfade.sexp: Smooth zoom-based video cycling - process-pair.sexp: Dual-clip processing with effects - Key features: - Videos cycle in input-videos order (not definition order) - Cumulative whole-spin rotation - Zero-weight sources skip processing - Live audio-reactive effects - New effects: blend_multi for weighted layer compositing - Updated primitives and interpreter for streaming compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
:desc "Blend opacity (0=video-a only, 1=video-b only)")
|
||||
(blend_mode :type string :default "overlay"
|
||||
:desc "Blend mode: alpha, add, multiply, screen, overlay, difference")
|
||||
(duration :type float :default 10 :range [1 300]
|
||||
:desc "Clip duration in seconds")
|
||||
)
|
||||
|
||||
;; Registry - effects and analyzers
|
||||
@@ -35,7 +37,7 @@
|
||||
;; Stage 1: Analysis
|
||||
(stage :analyze
|
||||
:outputs [energy-data]
|
||||
(def audio-clip (-> audio (segment :start 60 :duration 10)))
|
||||
(def audio-clip (-> audio (segment :start 60 :duration duration)))
|
||||
(def energy-data (-> audio-clip (analyze energy))))
|
||||
|
||||
;; Stage 2: Process both videos
|
||||
@@ -45,10 +47,10 @@
|
||||
:outputs [blended audio-clip]
|
||||
|
||||
;; Get audio clip for final mux
|
||||
(def audio-clip (-> audio (segment :start 60 :duration 10)))
|
||||
(def audio-clip (-> audio (segment :start 60 :duration duration)))
|
||||
|
||||
;; Process video A with ASCII effect
|
||||
(def clip-a (-> video-a (segment :start 0 :duration 10)))
|
||||
(def clip-a (-> video-a (segment :start 0 :duration duration)))
|
||||
(def ascii-a (-> clip-a
|
||||
(effect ascii_fx_zone
|
||||
:cols cols
|
||||
@@ -66,7 +68,7 @@
|
||||
(- 1 (get zone "row-norm")))))))))))
|
||||
|
||||
;; Process video B with ASCII effect
|
||||
(def clip-b (-> video-b (segment :start 0 :duration 10)))
|
||||
(def clip-b (-> video-b (segment :start 0 :duration duration)))
|
||||
(def ascii-b (-> clip-b
|
||||
(effect ascii_fx_zone
|
||||
:cols cols
|
||||
|
||||
Reference in New Issue
Block a user