Created
July 27, 2022 18:07
-
-
Save madprops/bf50f32f1bb9f5c1d89cef0ebedfe380 to your computer and use it in GitHub Desktop.
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
import os | |
import sys | |
from pathlib import Path | |
# Main function | |
def main() -> None: | |
# Arguments | |
path = sys.argv[1] | |
if (len(sys.argv)) > 2: | |
bitrate = float(sys.argv[2]) | |
else: | |
bitrate = 600 | |
# Get new file name | |
new_file = str(Path(path).parent / Path(path).stem) + "_4c.webm" | |
# Convert to a webm with no sound | |
os.popen(f"ffmpeg -i '{path}' -c:v libvpx-vp9 -b:v {bitrate}K -an {new_file}") | |
# Program starts here | |
if __name__ == "__main__": main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment