FFMPEG An Intermediate Guide

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

FFMPEG is a powerful video encoding package, that work with a large number of formats, on most platforms. Unfortunately the documentation can a but scary for the beginner to uses. The purpose of this book is to guide you through the basic of using FFMPEG, best practices, defining concept and problem solving.

Please feel free to help develop this book.

Index

[edit] The Basics

Helping you get started with FFMPEG transcoding.

FFMPEG is a command line video transcode/encoder so you need to be in your systems command line to use it or Install a Graphic User Interface. For more information look at the Installation section.

To run a basic FFMPEG transcode simply type the following command, input_video, and output_video with your chosen files.

FFMPEG -i "input_video.mpg" "output_video.mov"

To simply break down the command.

  • FFMPEG

Run the FFMPEG programme. If you have a message along the lines of the programme not found, you either need to run the command in the same folder as FFMPEG or read up on ore specific instructions on you system.

  • -i

Input: Your input video should follow this command. Note! File extensions are essential in the command line.

  • Output_Video

The name of the file, that you intend to create the output video as. The the extention (in this case .mov) defines the kind of video file you intend on creating. As this is the simplest of FFMPEG commands it assumes that you want the most generic output file in the type defined by the extension. Unfortunately I find you need to make one or to tweaks before you get the video file that you actually want.

Putting your video files names in Quotation Marks is not necessary but helps with special characters in your file name, especially spaces as FFMPEG expects a new command or setting after a space.

FFMPEG -i "input_video.mpg" -b 3000k "output_video.mov"

  • -b

Video Bit Rate: Defines in bit per second the quality of video stored to the new file. This should dramatically improve you video quality or file size depending on how large the number is that follows the -b. The k at the end of the number indicates that the number is in kilobytes. There is a more in-depth explanation later in the documentation.

Now that you can create a basic video file in FFMPEG read the basic or read more in depth if you already understand the basics.

[edit] Universal Video

A common question is, "I need a a video format that will work on any stock system, Windows, Apple or Linux." Unfortunately there is only one answer to this question, MPEG1. Due to copyrights and development focus, it is the only one that's been incorporated into most operating systems, except light operating systems such as mobile phones. Unfortunately although its a great universal format, its old and simply doesn't compete for quality or size with newer formats.

[edit] The Best Format...

Also a common question, although next to impossible to answer. It depends completely on what you are doing and what you intend to do with the video, editors, colourest or internet views all need completely different thing. Colorest needs the highest colour and video size to work with, were as editors need quality but speed is equally important not to mention the ability to play footage backwards frame by frame. End uses watching streaming footage online, want small, clear video. All this need to be taking into consideration before you encode your video.

Though under duress I would select the h.264 codec as the most advanced with the largest variety of uses from 4:4:4 to streaming video. It most likely will be the next most incorporated format as everything from blu-ray players, to mp4, to mov have the ability to store and play back h.264 encoded video.