Site Tools


linux:general:ffmpeg

Table of Contents

FFmpeg

FFmpeg is a free software project consisting of a vast software suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the FFmpeg program itself, designed for command-line-based processing of video and audio files, and widely used for format transcoding, basic editing (trimming and concatenation), video scaling, video post-production effects, and standards compliance (SMPTE, ITU). FFmpeg includes libavcodec, an audio/video codec library used by many commercial and free software products, libavformat (Lavf), an audio/video container mux and demux library, and the core ffmpeg command line program for transcoding multimedia files. FFmpeg is published under the GNU Lesser General Public License 2.1+ or GNU General Public License 2+ (depending on which options are enabled).

Wikipedia - FFmpeg

Installation

Ubuntu 14:

apt-get install libav-tools 

Ubuntu 15 and newer:

apt-get install ffmpeg

If you need the codecs for “MP3, AAC, AMR, MPEG-4 and H.264 (MPEG-4 AVC)”, install them via

apt-get install libavcodec-extra 

Usage

Ubuntu 14 uses “avconv”, 15+ uses “ffmpeg”, the parameters are mostly the same.

This is an example code to convert all images in the current folder to an .avi video with 5 frames per second

ffmpeg -f image2 -r 5 -pattern_type glob -i '*.jpg' 5fps.avi

If you consider using this to autogenerate videos via script, you might want to use the following code to mute the output

ffmpeg -f image2 -r 5 -pattern_type glob -i "$PATHJPG/*.jpg" $PATHAVI/movie.avi 2> /dev/null

If you want to join/ concat multiple files use the following

ffmpeg -safe 0 -f concat -i <(find $PATHAVI -type f -name '*.avi' -printf "file '%p'\n" | sort) -c copy $PATHAVI/movie.avi

linux/general/ffmpeg.txt · Last modified: 2023/04/29 21:16 by lunetikk