diff clojure/com/aurellem/run/final_cut.clj @ 547:b3b7a06686c4

all synching issues resolved.
author Robert McIntyre <rlm@mit.edu>
date Wed, 27 Jun 2012 19:38:13 -0500
parents 36e5fa62eb3c
children 6ce1d5fd4911
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/final_cut.clj	Wed Jun 27 14:08:59 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/final_cut.clj	Wed Jun 27 19:38:13 2012 -0500
     1.3 @@ -49,9 +49,7 @@
     1.4             wave-writer (WaveWriter. audio-file)
     1.5             moves (vec moves)
     1.6             desired-fps 60
     1.7 -           seconds-per-frame (/ 1.0 desired-fps)
     1.8 -
     1.9 -           ]
    1.10 +           seconds-per-frame (/ 1.0 desired-fps)]
    1.11         (set-state! initial-state)
    1.12         ;; clear sound buffer
    1.13         (sound-bytes)
    1.14 @@ -138,9 +136,10 @@
    1.15     target])
    1.16  
    1.17  (defn generate-composite-frames!
    1.18 -  [^File rendered-dir moves]
    1.19 +  [^File rendered-dir]
    1.20    (let [final-frames (File. rendered-dir "final")
    1.21          _ (.mkdir final-frames)
    1.22 +        move-images (file-names (File. rendered-dir "moves"))
    1.23          screenshots (file-names (File. rendered-dir "frames"))
    1.24          ram-maps    (file-names (File. rendered-dir "ram-map"))
    1.25          targets (map #(.getCanonicalPath
    1.26 @@ -152,8 +151,8 @@
    1.27         (partial apply clojure.java.shell/sh)
    1.28         flatten
    1.29         (partial apply composite-frames-command)
    1.30 -       (fn [a b c d] (println c) [a b c d]))
    1.31 -      screenshots ram-maps targets moves))))
    1.32 +       (fn [a b c d] (println d) [a b c d]))
    1.33 +      move-images screenshots ram-maps targets))))
    1.34  
    1.35  
    1.36  (defn final-cut! [^File render-dir]
    1.37 @@ -161,6 +160,7 @@
    1.38          final-audio (File. render-dir "final.wav")
    1.39          final (File. render-dir "final")]
    1.40      (.delete movie)
    1.41 +    (.delete final-audio)
    1.42      (clojure.java.shell/sh
    1.43       "sox" (.getCanonicalPath (File. render-dir "audio.wav"))
    1.44       (.getCanonicalPath final-audio))
    1.45 @@ -171,7 +171,7 @@
    1.46       "-b:a" "128k"
    1.47       "-b:v" "9000k"
    1.48       "-c:a" "libvorbis"
    1.49 -     "-c:v" "libtheora"
    1.50 +     "-f"   "webm"
    1.51       "-g"   "200"
    1.52       (.getCanonicalPath movie)) nil))
    1.53