Use ffmpeg and ffprobe to calculate frames
1. Download the bin files directly.
http://ftrack.rtd.ftrack.com/en/3.5.0/administering/managing_local_installation/configuring_ffmpeg.html
$ curl -O https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz
$ tar -xf ffmpeg-release-64bit-static.tar.xz
2. calcute frames using ffprobe
https://stackoverflow.com/questions/19642736/count-frames-in-h-264-bitstream
$ ffprobe -show_streams -count_frames -pretty filename
You will find in the output:
- nb_read_frames=....
3. And for the fps, as I heard that ffprobe may report some error for the fps, try a simple ffmpeg -i
command.
ffmpeg -i filename 2>&1 | sed -n "s/.*, \(.*\) fps.*/\1/p"