Last active
May 7, 2020 19:50
-
-
Save ToshY/69483e4c99ab69ac28960cf85ed78436 to your computer and use it in GitHub Desktop.
FFprobe file metadata (Python 3.x)
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
# Use FFprobe to get file metadata, e.g. streams, tags, etc., in JSON format | |
import json | |
import subprocess as sp | |
def get_file_metadata(input_file): | |
return json.loads(sp.check_output(["ffprobe","-v","quiet","-print_format","json","-show_streams","-show_format",input_file]).decode('utf-8')) | |
file_metadata = get_file_metadata(r"D:\hello_world.mp4") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment