Files
test/recipe-all-effects-modular.sexp
gilesb 406cc7c0c7 Initial commit: video effects processing system
Add S-expression based video effects pipeline with modular effect
definitions, constructs, and recipe files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 12:34:45 +00:00

56 lines
2.0 KiB
Common Lisp

;; All Effects Showcase (Modular Version)
;; Uses data-driven effect presets for easy customization
(recipe "all-effects-showcase-modular"
:version "1.0"
:encoding (:codec "libx264" :crf 20 :preset "medium" :audio-codec "aac" :fps 30)
;; Standard libraries - analyzers, effects, constructs
(include :path "libs/standard-analyzers.sexp")
(include :path "libs/all-effects.sexp")
(include :path "libs/standard-constructs.sexp")
;; Effect preset - SWAP THIS to change the entire effect palette
(include all-42-preset :path "effect-presets/all-42.sexp")
;; Sources with auto-detected info
(def video-a (source :path "monday.webm"))
(def video-b (source :path "new.webm"))
(def video-c (source :path "ecstacy.mp4"))
;; Video info analysis (duration, resolution, fps, etc.)
(def video-a-info (-> video-a (analyze video-info)))
(def video-b-info (-> video-b (analyze video-info)))
(def video-c-info (-> video-c (analyze video-info)))
(def videos (list video-a video-b video-c))
(def video-infos (list video-a-info video-b-info video-c-info))
;; Audio
(def audio (source :path "dizzy.mp3"))
;; Analysis
(def beats-data (-> audio (analyze beats)))
(def bass-data (-> audio (analyze bass)))
(def energy-data (-> audio (analyze energy)))
;; Analyzers dict for binding resolution (use dict fn, not literal, for symbol resolution)
(def analyzers (dict :bass bass-data :energy energy-data))
;; Segments - now just one clean call!
;; Note: kwargs use underscores (planner converts - to _)
(def segments (cycle-effects-preset
:beats beats-data
:videos videos
:video_infos video-infos
:preset all-42-preset
:analyzers analyzers
:beats_per_segment 21))
(assert (> (len segments) 0) "No segments created - all videos too short")
;; Sequence and output
(def showcase (-> segments
(sequence :resize-mode :fit :priority :width)))
(mux showcase audio))