Skip to content

Instantly share code, notes, and snippets.

@kobojp
Forked from davetromp/bulk_convert.py
Created January 21, 2020 16:08
Show Gist options
  • Save kobojp/8099d5137962fc936166d95dff2b680e to your computer and use it in GitHub Desktop.
Save kobojp/8099d5137962fc936166d95dff2b680e to your computer and use it in GitHub Desktop.
# the code is explained here: https://youtu.be/Eex4zBc9r7Y
import os
def main():
files = os.listdir("./")
for f in files:
if f.lower()[-3:] == "mp4":
print "processing", f
process(f)
def process(f):
inFile = f
outFile = f[:-3] + "mp3"
cmd = "ffmpeg -i {} -vn -ac 2 -ar 44100 -ab 320k -f mp3 {}".format(inFile, outFile)
os.popen(cmd)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment