Skip to content

Instantly share code, notes, and snippets.

@jdye64
Created June 23, 2015 03:59
Show Gist options
  • Save jdye64/ca07e01ff3d8e93210c3 to your computer and use it in GitHub Desktop.
Save jdye64/ca07e01ff3d8e93210c3 to your computer and use it in GitHub Desktop.

Revisions

  1. jdye64 created this gist Jun 23, 2015.
    14 changes: 14 additions & 0 deletions gistfile1.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/usr/bin/python

    print "Converting all of the .dav files in this current directory into .mp4 files using ffmpeg"
    import os
    from subprocess import call

    files = [f for f in os.listdir('.') if os.path.isfile(f)]
    for f in files:
    ext = f.split(".")[-1]
    if ext == "dav" or ext == "DAV":
    mp4Name = f.replace("dav", "mp4")
    print "Converting: " + f
    call(['ffmpeg', '-y', '-i', f, "-vcodec", "libx264", "-crf", "24", mp4Name])
    print "Converted: " + f