Files
test/recipe-sexp-slice.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

31 lines
1.1 KiB
Common Lisp

; Test recipe using S-expression slice-on construct
(recipe "sexp-slice-test"
:version "1.0"
:encoding (:codec "libx264" :crf 22 :preset "fast" :audio-codec "aac" :fps 30)
(analyzer beats :path "../artdag-analyzers/beats/analyzer.py")
;; Import slice-on as a user-defined construct (not the built-in!)
(construct slice-on :path "constructs/slice-on.sexp")
(def video-a (source :path "monday.webm" :description "Video A"))
(def video-b (source :path "new.webm" :description "Video B"))
(def audio (-> (source :path "dizzy.mp3" :description "Audio input")
(segment :start 0 :duration 10)))
(def beats-data (-> audio (analyze beats)))
;; Use the S-expression slice-on with a reducer function
(def segments (slice-on beats-data
:init 0
:fn (fn [acc i start end]
{:source (nth (list video-a video-b) (mod acc 2))
:effects (list)
:acc (inc acc)})))
(def synced-video (-> segments
(sequence :resize-mode :fit :priority :width)))
(mux synced-video audio))