FFMPEG is a very fast video and audio converter that can also
grab streaming data from a live audio/video source. The most common use
for FFMPEG is simply to convert a sequence of still images into a movie.
FFMPEG can also convert between arbitrary sample rates and resize
video on the fly with a high quality polyphase filter.
FFMPEG reads from an arbitrary number of input files (which can be
regular files, pipes, network streams, or grabbing devices), specified by
the -i option, and writes to an arbitrary number of output files,
which are specified by a plain output URL.
Anything found on the command line which cannot be interpreted as an
option is considered to be an output URL.
Each input or output URL can, in principle, contain any number of
streams of different types (video/audio/subtitle/attachment/data).
The allowed number and types of streams may be limited by the container
format. Selecting which streams from which inputs will go into which
output is either done automatically or with the -map option.
On any ARC cluster, check the installation details
by typing "module spider ffmpeg".
FFMPEG requires that the appropriate modules be loaded before it can be run.
One version of the appropriate commands for use on NewRiver is:
module purge module load gcc/5.2.0 module load yasm/1.3 module load x264/1.0 module load fdk-aac/1.0 module load lame/3.99.5 module load ffmpeg/2.5.4
In the following batch file, FFMPEG is used to take 30 PNG files
and construct a movie. (The original example used 300 files, but
our documentation system doesn't want to store such large amounts
#! /bin/bash # #PBS -l walltime=00:05:00 #PBS -l nodes=1:ppn=1 #PBS -W group_list=newriver #PBS -q open_q #PBS -j oe # cd $PBS_O_WORKDIR # module purge module load gcc/5.2.0 module load yasm/1.3 module load x264/1.0 module load fdk-aac/1.0 module load lame/3.99.5 module load ffmpeg/2.5.4 # # Extract PNG files from tar file. # tar xvf foo.tar # # Concatenate all files of the form "bahnnnnnn.png" into a movie. # # -r 24 <-- movie should use 24 frames per second; # -i bah%06d.png <-- input file names have form "bahNNNNNN.png"; # -b:v 16384k <-- set video bit rate to 16,384 kilobytes/second; # -vf scale=1014:-1 <-- resize the output to width 1014 pixels, # and set height to preserve aspect ratio; # bee.mp4 <-- name of output movie. # ffmpeg -r 24 -i bah%06d.png -b:v 16384k -vf scale=1024:-1 bee.mp4 #
A complete set of files to carry out a similar process are available in