Created
April 25, 2021 12:52
-
-
Save theycallmeloki/e521b531674e735691a3cbbb3a185a48 to your computer and use it in GitHub Desktop.
FFMPEG converter standalone script for Pachyderm pipeline
This file contains hidden or 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
import ffmpeg | |
import os | |
import subprocess | |
from subprocess import PIPE | |
def convert_job(job): | |
tail = os.path.split(job)[1].rstrip(".mp4") | |
output = subprocess.run( | |
["ffmpeg", "-i", job, "-c:v", "copy", "-c:a", "copy", os.path.join("/pfs/out", tail + ".mkv")], | |
stdout=PIPE, | |
stderr=PIPE, | |
) | |
for dirpath, dirs, files in os.walk("/pfs/videos"): | |
for file in files: | |
convert_job(os.path.join(dirpath, file)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment