     (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]

    nil))

(defn audio-title-options
  [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
  "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"))]
