     nil))
 
 (defn audio-title-options
+  "Returns the encoding options for adding a title to an audio track."
   [index codec lang chans]
   [(str "-metadata:s:a:" index) (str "title=" (audio-title codec lang chans))])
 

      (json/read-str (:out exec) :key-fn keyword))))

(defn detect-interlace
  [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 format-options
  "Returns the ffmpeg options for the type of output file."
  [{:keys [format]}]
  (when (#{:m4v :mp4} format)
    ["-movflags" "faststart"]))

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