Created
January 25, 2022 15:52
-
-
Save lambdan/50be89d8129c9632053c20fab0d6050a to your computer and use it in GitHub Desktop.
convert videos with mp3 audio to aac
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
# remove .exe's to make it unix compatible | |
# needs mediainfo and ffmpeg | |
import os, subprocess | |
path = "Z:/Videos" | |
for f in os.listdir(path): | |
mi = subprocess.check_output(["mediainfo.exe", os.path.join(path,f)]) | |
if "MPEG Audio" in str(mi): | |
print(f, "= mp3") | |
cmd = ["ffmpeg.exe", "-hide_banner", "-i", os.path.join(path,f), "-c:v", "copy", "-c:a", "aac", "fixed/" + f] | |
subprocess.call(cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment