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>
34 lines
1.1 KiB
Common Lisp
34 lines
1.1 KiB
Common Lisp
;; Parametric Effect Test
|
|
;; Demonstrates using command-line parameters for effect values
|
|
;;
|
|
;; Usage:
|
|
;; python3 plan.py recipe-parametric.sexp -p strength=3 -p amount=50 | python3 execute.py - -d . -o output.mp4
|
|
;;
|
|
;; Parameters (with defaults):
|
|
;; strength - swirl strength (default: 2)
|
|
;; amount - brightness amount (default: 0)
|
|
|
|
(recipe "parametric-test"
|
|
:version "1.0"
|
|
:encoding (:codec "libx264" :crf 20 :preset "medium" :audio-codec "aac" :fps 30)
|
|
|
|
;; Effects
|
|
(effect swirl :path "sexp_effects/effects/swirl.sexp")
|
|
(effect brightness :path "sexp_effects/effects/brightness.sexp")
|
|
|
|
;; Source
|
|
(def video (source :path "monday.webm"))
|
|
(def audio (source :path "dizzy.mp3"))
|
|
|
|
;; 10 second segments
|
|
(def clip (-> video (segment :start 0 :duration 10)))
|
|
(def audio-clip (-> audio (segment :start 0 :duration 10)))
|
|
|
|
;; Apply effects with parameters (passed via -p flag)
|
|
;; Parameters are injected as bindings before compilation
|
|
(def result (-> clip
|
|
(effect swirl :strength strength)
|
|
(effect brightness :amount amount)))
|
|
|
|
(mux result audio-clip))
|