       (json/read-str (:out exec) :key-fn keyword))))
 
 (defn detect-interlace
+  "Performs interlace detection, returning true if present."
   [input]
   (let [output (:err (exec "ffmpeg" "-y" "-ss" 300 "-i" input "-f" "matroska"
                            "-t" 120 "-an" "-sn" "-vf" "idet" "/dev/null"))]

    (for [stream subtitle-streams]
      ["-map" (str "0:" (:index stream)) "-c:s" "copy"])))

(defn encode-cmd
  "Returns the ffmpeg command for encoding a video."
  [spec]

        (first audio)))) ; TODO: check language

(defn audio-codec-options
  "Returns the encoding options for the specified codec."
  [index codec]
  (case codec
    "aac" ["-q:a" 100 (str "-ac:a:" index) 2 "-strict" "-2"]
