Created
September 27, 2018 13:14
-
-
Save filipgorczynski/831685e9f980f0a0eb22cfb22d108d69 to your computer and use it in GitHub Desktop.
A friend from work is saying that it's useful for previously downloaded PornHub movies.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just a simple tool to convert mp4 files to avi. | |
import os | |
import subprocess | |
import glob | |
path = '.' | |
files = glob.glob('*.mp4') | |
files_count = len(files) | |
for index, name in enumerate(files, start=1): | |
raw_filename = name[:-4] | |
print("Converting file {} of {}: {}".format(index, files_count, raw_filename)) | |
input_file = raw_filename + '.mp4' | |
out_file = raw_filename + '.avi' | |
subprocess.call(["ffmpeg", "-i", input_file, "-vcodec", "copy", "-acodec", "copy", out_file]) | |
os.remove(input_file) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment