2015-10-12 00:53:13 +02:00
plotframes
===========
A Node.js CLI frame plotter inspired on [FFmpeg plotframes ](https://github.com/FFmpeg/FFmpeg/blob/master/tools/plotframes ) but 350x faster!
2015-10-14 19:07:34 +02:00
![Frame Based ](http://i.imgur.com/M4gT0eX.png "Frame Based" )
![Time Based ](http://i.imgur.com/J3l0Y7h.png "Time Based" )
2015-10-12 00:53:13 +02:00
Requirements:
* [gnuplot ](http://www.gnuplot.info/ )
* [FFmpeg >= 1.2 with the ffprobe command ](https://www.ffmpeg.org/ )
Installation and running
```
npm install plotframes -g
plotframes input.mkv
```
Usage
```
Usage: plotframes [OPTIONS]
options:
-h, --help Print this help and exit.
-i FILE, --input=FILE Specify multimedia file to read. This is the
file passed to the ffprobe command. If not
specified it is the first argument passed to
the script.
2015-10-14 19:07:34 +02:00
-s 0, --stream=0 Specify stream. The value must be a string
2015-10-12 00:53:13 +02:00
containing a stream specifier. Default value
2015-10-14 19:07:34 +02:00
is "0".
2015-10-12 00:53:13 +02:00
-o FILE.png, --output=FILE.png Set the name of the output used by gnuplot.
If not specified no output is created. Must
be used in conjunction with the terminal
option.
-t png, --terminal=png Set the name of the terminal used by
2015-10-14 19:07:34 +02:00
gnuplot. By default it is "windows". Must be
2015-10-12 00:53:13 +02:00
used in conjunction with the output option.
Check the gnuplot manual for the valid
values.
2015-10-14 19:07:34 +02:00
-f, --frames Create a plot based on frame number instead
of frame time.
2015-10-12 00:53:13 +02:00
```
>**WARNING:** This is **NOT** a node.js module for inclusion in other Node.js scripts, it is just a CLI for use in the terminal/console, maybe in the future I'll see to integrate it somehow.
2015-10-13 18:34:58 +02:00
### Installing dependencies
2015-10-12 00:53:13 +02:00
2015-10-13 18:34:58 +02:00
#### Windows
1. [Download ](https://nodejs.org ) and install Node.js
2. [Download ](http://ffmpeg.zeranoe.com/builds/ ) a FFmpeg build, uncompress it into a directory that is included in the system `%path%` .
3. [Download ](http://sourceforge.net/projects/gnuplot/ ) and install `gnpuplot` :
There are [other downloads ](http://sourceforge.net/projects/gnuplot/files/gnuplot/ ) in case you want to download a different version.
4. Open your `Command Promt` and run `npm install plotframes` .
2015-10-12 00:53:13 +02:00
2015-10-13 18:34:58 +02:00
#### OS X
* Install Xcode from the App Store
2015-10-12 00:53:13 +02:00
* Install [Homebrew ](http://brew.sh )
2015-10-13 18:34:58 +02:00
Then, using Hombrew intall FFmpeg, XQuartz (needed to render to x11) and gnuplot.
2015-10-12 00:53:13 +02:00
```
2015-10-13 18:34:58 +02:00
brew install ffmpeg
2015-10-12 00:53:13 +02:00
brew install Caskroom/cask/xquartz
brew install gnuplot --with-x11
```
2015-10-13 18:34:58 +02:00
#### Ubuntu
Install Node.js
```
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install nodejs
```
Install FFmpeg
```
sudo ppa-purge ppa:mc3man/trusty-media
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg
```
Install gnuplot
```
sudo apt-get install gnuplot-x11
```
Or do all at once
```
sudo ppa-purge ppa:mc3man/trusty-media
sudo add-apt-repository ppa:mc3man/trusty-media
2015-10-14 21:54:19 +02:00
curl -sL https://deb.nodesource.com/setup | sudo bash -
2015-10-13 18:34:58 +02:00
sudo apt-get install ffmpeg gnuplot-x11 nodejs
```
2015-10-14 21:54:19 +02:00
After that you can install `plotframes` :
2015-10-13 18:34:58 +02:00
```
2015-10-14 21:54:19 +02:00
sudo npm install plotframes -g
```
#### Problems installing global packages on OS X or Ubuntu?
Ubuntu fix:
2015-10-13 18:34:58 +02:00
```
2015-10-14 21:54:19 +02:00
npm config set prefix ~/.npm
echo 'export PATH=$HOME/.npm/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
```
OS X fix:
```
npm config set prefix ~/.npm
echo 'export PATH=$HOME/.npm/bin:$PATH' >> ~/.bashrc
echo . ~/.bashrc >> ~/.bash_profile
. ~/.bashrc
```
### Donations
Did you find this useful? ** *Consider donating***. Your contribution will help cover the costs of developing, distributing and supporting this project, not to mention the great relief it would bring my bank account, seriously, donate, it will make me very :smiley:
2015-10-12 00:53:13 +02:00
2015-10-14 21:54:19 +02:00
< a href = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=U7B2YPB82R47U" > < img src = "https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" alt = "Donate" > < / a >
2015-10-12 00:53:13 +02:00
## License
(The MIT License)
Copyright (c) by Rodrigo Polo http://RodrigoPolo.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2015-10-14 19:32:55 +02:00
THE SOFTWARE.