Skip to content

FFmpeg

FFmpeg (Fast Forward MPEG) is a multimedia framework able to encode, decode, mux, demux, stream, filter and play any type of media including audio and video.

FFmpeg is available as a module on Apocrita.

Usage

To run the latest installed version of FFmpeg, simply load the ffmpeg module:

$ module load ffmpeg
$ ffmpeg --help
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

For full usage documentation, run ffmpeg --help.

Example jobs

Serial jobs

Here are two example jobs each running on 1 core and 1GB memory:

#!/bin/bash
#$ -cwd
#$ -j y
#$ -pe smp 1
#$ -l h_rt=1:0:0
#$ -l h_vmem=1G

module load ffmpeg

# Convert image(s) to video with 24 frames per second
ffmpeg -framerate 24 -i image1.png image2.png output.mp4
#!/bin/bash
#$ -cwd
#$ -j y
#$ -pe smp 1
#$ -l h_rt=1:0:0
#$ -l h_vmem=1G

module load ffmpeg

# Create a thumbnail image every 1 second of the video
ffmpeg -i output.mp4 fps=1 out%03d.png

The %03d in the above example dictates that the ordinal number of each output image will be formatted using 3 digits i.e. out001.png, out002.png, out003.png, etc.

References