Liking cljdoc? Tell your friends :D

telegenic

Video creation and manipulation in Clojure

Telegenic is a wrapper for the pure-Java JCodec library for video encoding / decoding.

https://github.com/jcodec/jcodec

Currently you can use it to encode H264 video from a sequence of image frames. Not much support for anything else yet.

Usage

(use 'telegenic.core)
(use 'mikera.image.core :as img)

(let [;; A green frame
      f1 (img/new-image 100 100)
      _ (img/fill-rect! f1 0 0 100 100 java.awt.Color/GREEN)
      
      ;; A green frame
      f2 (img/new-image 100 100)
      
      ;; A sequence of frames. Frames can be re-used for efficiency.
      frames (concat (repeat 20 f1) (repeat 20 f2) (repeat 20 f1) (repeat 20 f2)))]
  
  ;; finally encode everything into an mp4
  (encode frames {:filename "out.mp4"})

Can you improve this documentation? These fine people already did:
mikera & Mike Anderson
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close