How to find frames per second of any video file?
Is there any simple way to find the fps of a video in ubuntu? In windows I use Gspot to find out all the information about a video file. But in ubuntu I find it very difficult to find out this basic information. Any help is appreciated.
This will tell you the framerate if it's not variable framerate:
ffmpeg -i filename
Sample output with filename obscured:
Input #0, matroska,webm, from 'somerandom.mkv': Duration: 01:16:10.90, start: 0.000000, bitrate: N/A Stream #0.0: Video: h264 (High), yuv420p, 720x344 [PAR 1:1 DAR 90:43], 25 fps, 25 tbr, 1k tbn, 50 tbc (default) Stream #0.1: Audio: aac, 48000 Hz, stereo, s16 (default)
ffmpeg -i filename 2>&1 | sed -n "s/.*, \(.*\) fp.*/\1/p"
Someone edited with one that didn't quite work the way I wanted. It's referenced here
Additional edit...If you want the tbr value this sed line works
sed -n "s/.*, \(.*\) tbr.*/\1/p"
ffprobe -v 0 -of csv=p=0 -select_streams v:0 -show_entries stream=r_frame_rate infile
Result:
2997/100