Skip to content

Instantly share code, notes, and snippets.

View cadmi's full-sized avatar

Dmitry Ishutkin cadmi

  • Russia, Krasnoyarsk
View GitHub Profile
@cadmi
cadmi / video-metada-finder.py
Created February 3, 2018 11:04 — forked from oldo/video-metada-finder.py
A python function utilising `ffprobe` to find any metadata related to a video file. Examples of what it can find include bitrate, fps, codec details, duration and many more. This gist returns the video height and width as an example.
#!/usr/local/bin/python3
import subprocess
import shlex
import json
# function to find the resolution of the input video file
def findVideoMetada(pathToInputVideo):
cmd = "avprobe -v 0 -show_format -show_streams -of json"
args = shlex.split(cmd)
args.append(pathToInputVideo)