Code for How to Extract Video Metadata in Python Tutorial


View on Github

extract_media_metadata.py

import ffmpeg
import sys
from pprint import pprint # for printing Python dictionaries in a human-readable way

# read the audio/video file from the command line arguments
media_file = sys.argv[1]
# uses ffprobe command to extract all possible metadata from the media file
pprint(ffmpeg.probe(media_file)["streams"])


🕒 Black Friday Offer!
EBook Image

Black Friday Special! All of our eBooks and bundles are at 50% off!
Get our The Python Code eBook Bundle at 50% off. Limited time only!

$122.00 $61.00