Skip to content

Instantly share code, notes, and snippets.

@madprops
Created July 27, 2022 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madprops/bf50f32f1bb9f5c1d89cef0ebedfe380 to your computer and use it in GitHub Desktop.
Save madprops/bf50f32f1bb9f5c1d89cef0ebedfe380 to your computer and use it in GitHub Desktop.
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