FFmpeg: Basic examples of usage in command line

2014-02-15 Software

In my previous article about FFmpeg I’ve described a method of removing sound from the surce video stream. Today I will present some general examples of how to use FFmpeg. That includes conversion from one format into another, setting specific bitrate (quality determinant) and other minor settings.

(Check this article from time to time, because all usage examples will be updated below rather than in new article).

Converting videos

From MP4 to OGV

ffmpeg -i input.mp4 -b 1920k -vcodec libtheora -f ogg output.ogv

This example will convert your MP4 file into OGV using 1920kb bitrate.

Extracting audio from video

Before you will do this, restricted extras may be required.

ffmpeg -i input.mp4 -ab 320k -ac 2 -vn output.mp3

This example will output MP3 file with the audio stream extracted from the input video stream with selected bitrate, equal to 320kb/s.