3

Is there any way to get how many bits per second are in any video?

ej:

ffmpeg/mediainfo -commands input.mkv

Result:

sec 1 - 500bits
sec 2 - 600bits
sec 3 - 300bits

Thanks!

2 Answers2

4

You can output frame information such as the packet size and time with ffprobe:

ffprobe -show_entries frame=pkt_size,pkt_pts_time <input>

You can then aggregate them as you like. For eg. the plotframes ffmpeg tool uses this information to generate a video frame size by type plot.

enter image description here

aergistal
  • 29,947
  • 5
  • 70
  • 92
  • Do you know have a link to a guide on how to download the software and doing this? Thanks mate! – Christian Recinos Oct 10 '15 at 20:39
  • 1
    ffprobe is part of ffmpeg. You can find the source, packages and static builds on http://ffmpeg.org/download.html. There's also a compilation guide – aergistal Oct 11 '15 at 07:23
  • I have an ffmpeg build with the plotframe tool and can't find any example how to use it. Can it be run from within ffmpeg ?Care to share a working command? – o_ren Feb 12 '17 at 13:50
  • BTW, this is how to use plotframes: `plotframes -i file.mp4 -t svg -o file.svg`. Assuming you have an ffmpeg build with tools installed and have gnuplot and perl (with JSON module) on your system. – o_ren Feb 12 '17 at 15:49
4

To install on OS X, first install Xcode and Homebrew, then:

Python

brew install python3
pip3 install matplotlib
curl -OLJ https://raw.githubusercontent.com/zeroepoch/plotbitrate/master/plotbitrate.py
chmod +x plotbitrate.py
./plotbitrate.py -f svg -o out.svg input.mkv

Pearl

brew install cpanm gnuplot
sudo cpanm -v JSON
curl -OLJ https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/tools/plotframes
chmod +x plotframes
./plotframes.pl -i input.mkv -o output.svg -t svg
Rodrigo Polo
  • 4,314
  • 2
  • 26
  • 32