Skip to content

Instantly share code, notes, and snippets.

@zmarffy
Created November 14, 2020 16:56
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 zmarffy/f89956bd3ae87c97501066d57f150471 to your computer and use it in GitHub Desktop.
Save zmarffy/f89956bd3ae87c97501066d57f150471 to your computer and use it in GitHub Desktop.
Get the bitrate of an input file
import re
import subprocess
import sys
print(re.findall(r"(?<=rate: ).+(?=\n)",
subprocess.run(["ffmpeg", "-i", sys.argv[1]], stderr=subprocess.PIPE).stderr.decode())[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment