Ffmpeg is not an internal or external command. FFmpeg basic commands. Extract audio track from video and save to mp3

If you often work with video on the Linux operating system, then you've probably heard about the ffmpeg utility and set of libraries. This is a powerful cross-platform library that allows you to do almost anything with video. You can merge, encode, change, trim videos, but all this through the terminal.

At first glance, this may seem very difficult. To some extent this is true. But you have the widest possible customization options and very great flexibility. Graphical tools often fail and may not support a particular format. The ffmpeg library supports all existing formats and works almost always.

It can save you when other programs get stuck. In this article, we will look at useful ffmpeg commands that will be useful to you in your daily work with video.

ffmpeg is one of the best multimedia frameworks that contains various tools to solve different tasks. For example, ffplay is a portable media player, the ffmpeg utility can be used to process and invert files, ffserver can be used for streaming data, and ffprobe can analyze a multimedia stream.

In addition to utilities, the ffmpeg set includes the following libraries: libavutil libavcodec libavformat libavdevice libavfilter libavresample libswscale libswresample libpostproc. Because of its architecture, this toolkit is very secure and with it you can do almost anything with video or audio. In this article we will mainly look at the ffmpeg utility. Let's look at its syntax:

[source options]-i [source] [basic options][codecs] [successor]

  • Source Options- indicate file reading parameters, settings, etc.;
  • Source- the -i option specifies the source from which the file will be read; there can be several sources and it can be not only a file, but also a device;
  • Basic options- set the operating parameters of the entire utility;
  • Codecs- codec that will be used to save video and audio;
  • Successor- file or device where the data will be written.

Now we will not consider the options in detail; we will consider them later, in the commands themselves.

Useful ffmpeg commands

As I already said, the ffmpeg utility supports most audio and video formats. To check which formats are supported you can run:

If you are new to using this tool, then here are some commands that can help you a lot. Next you will learn how to use ffmpeg.

1. Get video information

To get accessible information about a video, simply specify the source file. Run this command:

ffmpeg -i video.mp4 -hide_banner

The -hide_banner option tells the program not to show information about itself, build options, and so on. You can run the command without this option, then you will get all the information, including about ffmpeg:

ffmpeg -i video.mp4

2. Split the video into frames

To split a video into images, the following command will do:

ffmpeg -i video.mp4 image%d.jpg

The utility will generate images with the names image1.jpg, image2.jpg, image3.jpg and so on. Once completed, you will find a very large number of images in the video folder.

3. Compile video from images

You can take the resulting set of pictures and put everything back into a video. To do this, run:

ffmpeg -f image2 -i image%d.jpg imagestovideo.mpg

The -f option specifies the input file format, you can use jpeg, png, jpg and other images. And you already know how to view supported ffmpeg formats.

4. Extract audio from video

To convert video to mp3 run the command:

ffmpeg -i video.mp4 -vn -ar 44100 -ac 2 -ab 192 -f mp3 audio.mp3

Here is a description of the new options:

  • -vn- do not process the video, all video information will be discarded;
  • -ar- sampling frequency, measured in hertz, the higher the better quality sound;
  • -ab- sets audio bitrate;
  • -ac- sets the number of channels;
  • -f- indicates the format of the received file.

5. Convert flv to mpg

To convert flv to mpg run:

ffmpeg -i video.flv video.mpg

6. Convert video to gif

In the same way, you can convert a video into an animated GIF image:

ffmpeg -i video.flv animated.gif

We do not indicate ffmpeg codecs and format, because the program itself can determine them by extension.

7. Convert mpg to flv

To convert mpg video to flv do:

ffmpeg -i video.mpg -ab 26k -f flv video1.flv

Here we have already set the bitrate and format.

8. Convert avi to mpeg

To do this, run the command:

ffmpeg -i video.avi -target pal-dvd -ps 2000000000 -aspect 16:9 video.mpeg

Options used:

  • -target pal-dvd- outgoing file format;
  • -ps 2000000000 - maximum size received file;
  • -aspect 16:9- screen aspect ratio.

9. Convert video to CD or DVD format

To convert ffmpeg video to DVD format, you need to specify your format using the -target option. The following formats are available: vcd, svcd, dvd, dv, pal-vcd or ntsc-svcd. To create a VCD do:

ffmpeg -i video.mpg -target vcd vcd_video.mpg

10. Stitch audio and video together

You can combine the video and audio file into one track using the command:

ffmpeg -i audio.mp3 -i video.avi video_audio_mix.mpg

11. Increase/decrease video speed

To increase the video playback speed we will use filters using the -vf option. The setpts filter is responsible for speed. For example:

ffmpeg -i video.mpg -vf "setpts=4*PTS" highspeed.mpg

And this is how you can reduce the speed:

ffmpeg -i video.mpg -vf "setpts=0.5*PTS" lowerspeed.mpg -hide_banner

12. Cut a rectangle from a video

Filters are also used to cut out a certain section of a frame from a video. This time the crop filter:

ffmpeg -i in.mp4 -vf "crop=out_w:out_h:x:y" out.mp4

  • out_w- the width of the desired rectangle;
  • out_h- the height of the desired rectangle;
  • x,y- set the coordinates of the rectangle from the beginning of the video.

For example, let’s cut a rectangle of size 80x60 from the position 100x200:

ffmpeg -i in.mp4 -vf "crop=80:60:200:100" video.mp4

In addition to these options, you can set ffmpeg codecs and formats here to perform ffmpeg encoding in parallel.

13. Trim video

Here filters won’t help us, but we can use options to indicate at what point we need to start and where to end, for example:

ffmpeg -i video.mp4 -ss 00:01:00 -t 00:01:00 -c copy video_clip.mp4

We start from a minute and write another minute:

  • -ss sets the time on the video from which to start recording;
  • -t specifies the time when the recording needs to be completed relative to ss;
  • -With sets codecs for audio and video; in our case, just copy files without recoding anything.

14. Join two videos

To merge two videos use the command:

ffmpeg -i concat:"video1.mpg|video2.mpg" -c copy video.mpg

15. Play video

You can quickly play a video to evaluate its quality, there is a command for this:

ffplay video.mp4

The program opens both video and audio.

16. Photo banner for audio

You can add a photo banner to your audio recording using the following command:

ffmpeg -loop 1 -i image.jpg -i Bryan\ Adams\ -\ Heaven.mp3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest output.mp4

Let's look at the options:

  • -loop- specifies that you must always repeat the same picture;
  • -i- specify incoming files, picture and audio file;
  • -с:v- sets the video codec, equivalent to -vc;
  • -c:a- specifies the audio codec, equivalent to -ac;
  • -b:a- sets the audio bitrate, equivalent to -ab;
  • -strict experimental- the aac codec for ffmpeg is experimental, so this option is needed to use it.

17. Add subtitles to videos

If you have a separate subtitle file, for example named subtutle.srt, you can use a command like this to add it to the video:

ffmpeg -i video.mp4 -i subtitles.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast video-output.mkv

conclusions

These are all the useful ffmpeg commands that were covered today. But you can find even more commands and even more features by viewing the official documentation of the utility. If you know other very interesting and useful ffmpeg commands, write in the comments!

For dessert, a video on the topic of what video codecs and encoders are, as well as a description of the main video formats:

ffmpeg is a really powerful video encoder/decoder. It runs on the command line rather than a GUI. The Command Prompt is that black window you'll find by clicking and typing cmd , then hitting enter. This is also called "command line". Once configured, you enter ffmpeg commands in one of these windows to use it.

Here are the basic steps to "install" and use it:

Installation

ffmpeg is now "installed". The command line will now recognize ffmpeg commands and will try to run them.

FFmpeg update

To update FFmpeg, simply return to the download page in step 1 and download the file postal code. Unzip the files and copy them over the old files in the folder created in step 2.

Using FFmpeg

Using FFmpeg requires you to open a command prompt window and then enter FFmpeg specific commands. Here is a typical FFmpeg command:

Ffmpeg -i video.mp4 -vn -ar 44100 -ac 1 -b:a 32k -f mp3 audio.mp3

This command consists of four parts:

  1. ffmpeg - This command tells the CMD that we want to run FFmpeg commands. cmd first looks for ffmpeg.exe in one of the folders from step 6 in the Installation section. If found, it will try to execute the command.
  2. -i video.mp4 - This is the input file. We will work on this file.
  3. -vn -ar 44100 -ac 1 -b:a 32k -f mp3 - These are “arguments”. These symbols are like mini commands that define exactly what we want to do. In this case it says to create an mp3 file from the input source.
    • -vn - Leave from video stream
    • -ar 44100 - Specifies the audio resolution in hertz.
    • -ac 1 - Audio channels, 1 only. This effectively "makes it mono".
    • -b:a 32k - Audio bitrate, set to 32 kbps.
    • -f mp3 - Force MP3 conversion. Without this command, ffmpeg tries to interpret what you want based on the extension you use in the output file name.
  4. audio.mp3 - This is the output file.

As you can guess, this short command makes an MP3 audio file from an MP4 file.

To run this command if you have an MP4 file to try this on, follow these steps:

  1. Press Windows key + R.
  2. Type cmd then enter.
  3. Change the path to the file you want to work on. CD type. It should look something like cd C:\Users\name\Desktop\ .
  4. Now enter the ffmpeg command with the name of your input file. The team will work with some feedback. When this is done, cmd will be available for more commands.

This is the main way to use ffmpeg. The commands can be much more complex, but that's only because the program has so much energy. Using the ffmpeg documentation you can learn all the commands and create very powerful scripts. You can then save these scripts to a .bat file so that you just have to double-click the file instead of typing the entire command each time. For example, this answer contains a script that will create MP3"s from all the MP4"s in a folder . Then we will combine the power of ffmpeg with the power of cmd and this is the sweet spot when you need to do professional video/audio encoding in mountain files.

FFmpeg is a set of libraries and command line utilities that allow you to perform almost all the basic operations of editing and converting video and audio files. Below is a cheat sheet of the main commands for working with FFmpeg, which can be useful when editing video. We especially pay attention to non-destructive editing of video and audio files without loss of quality. License: GNU LGPL and GNU GPL. Website: http://ffmpeg.org

FFmpeg for beginners

Shooting videos in digital formats using smartphones, cameras and other digital devices has become common. Naturally, there is a need to somehow edit the captured videos, for example, for posting on YouTube. That is, videos often need to be trimmed, the audio track replaced or removed, the size of the video format changed, and then everything needs to be merged into single file video.

Many programs are being created for this mass activity. Take, for example, the MoveMaker video editor that was previously supplied to Windows systems. We will look at a set of utilities and libraries for editing and converting media files called FFmpeg.

What's good about FFmpeg:

    FFmpeg files are available under a public license. That is, the source code is freely open for study, modification and distribution. And the programs themselves are practically free, like books in a public library.

    As is typical for public programs, FFmpeg is distributed for all popular operating systems - GNU/Linux, Windows, MacOS.

    FFmpeg programs are console-based; you can edit multimedia files directly from the command line. What makes FFmpeg utilities indispensable for automating the processing of video and audio files in various kinds of scripts and scripts - for example, on websites.

    FFmpeg has its own library with support for a large number of codecs for various multimedia file formats - for almost all occasions. Plus, you can build FFmpeg with the ability to connect third-party codecs.

    Accordingly, for console utilities, you can also create software shells, similar, for example, to MoveMaker, where operations are performed not through the command line, but using a graphical interface and a mouse. By virtue of the public license, FFmpeg components can be found practically in most programs for video transcoding and editing.

    FFmpeg for work allows you to edit many videos without losing quality. The average consumer usually does not have the opportunity to shoot uncompressed or lossless video; the videos are already compressed and further editing with recoding will add even more artifacts to the video image. Therefore, the possibility of non-destructive editing of video files without compression will not hurt anyone.

It should also be noted that FFmpeg has an alternative - a fork of Libav. The command parameter syntax is the same in both cases.

About formats and codecs

Briefly, as a non-lyrical digression, I need to say about video and audio file formats. Understanding this is necessary so that the commands of this set of utilities and libraries do not look like magic spells.

Typically a video file is a container. This is something like an archive created by a zip or tar archiver, which contains many files. Essentially, such a container contains video data files, one or more audio tracks, there may be text files of subtitles, and there may be some other data. Typically, these files included in a container are called streams.

Common container formats for video are 3gp, MP4, MOV, MPEG, AVI, MKV (Matryoshka), WEBM, etc. FFmpeg works with a large number of such container formats.

The audio file format - MP3, OGG Vorbis, WAV, etc. - usually contains an audio track and text metadata about the genre, author, artist, etc.

The video data itself in containers is “packed” in the form of various formats, which are determined by codecs - programs for video encoding and decoding. The most popular codecs are H.264 and H.265 codecs for the MP4 container, V8 and V9 for the WEBM container.

FFmpeg works with a large number of codecs, including exotic ones. You can find out the list of possible codecs in FFmpeg by running the ffmpeg command with the -codecs parameter.

ffmpeg-codecs

The main parameters of video data are:

  • video image resolution - for example, 320x240, p720, etc.;
  • format and codec used to create the video stream;
  • bitrate - the amount of data in kilobytes or megabytes that is needed to play a video in one second - for example, 240 Kb/s, 1Mb/s;
  • frame rate - the number of frames per second (frame per second) - for example 24 fps, 30 fps.

For audio data, the important parameters are:

  • format and codec used to create the audio stream;
  • sampling frequency - for example, 44 KHz;
  • bitrate - the amount of data in kilobytes that is needed to play an audio file in one second - for example, 96 Kb/s, 128Mb/s;
  • mono mode, stereo mode, etc.

But there are actually more parameters. You can easily find out the parameters of the video container and the video and audio data included in it using the fmpeg command with the -i parameter, which is passed the path and name of the multimedia file

Ffmpeg -i video.mp4

VidCutter: GUI for FFmpeg

But you can start using FFmpeg not only from the command line. There are also graphical shells for FFmpeg - programs in which basic commands and operations can be performed using a graphical interface and a mouse.

An example of such a very simple graphical shell is the very simple VidCutter program. It allows you to use the graphical interface to trim video files without recoding, that is, without loss of quality.

Working in this program consists of one operation - select the beginning and end of the fragment and press the video trim button. But in most cases, there's more to it than just trimming video files.

Installing the FFmpeg utility kit

Linux. FFmpeg utilities are usually included in all Linux distribution repositories and are easily installed by the native package managers of these distributions. You can also download ready-made ffmpeg binary assemblies from the official website and run them directly from your home folder. Or compile from sources.

For Windows And MacOS You can download an archive with ready-made FFmpeg binary assemblies from the official website and unpack them into any directory. The necessary utilities are usually located in the bin folder. You need to run them from the command line by specifying the path to these utilities directly on the command line or by adding the path to the utilities through global system variables.

There are two main utilities in the FFmpeg set:

  • ffmpeg - a utility for all operations with multimedia files;
  • ffplay is a very simple media player that can be used in place of any other player.

Editing with FFmpeg

Let's say we have several video files that are dear to us, made once by some old Canon, or Nikon, or camcorder. We wanted to trim the excess in these videos, remove background sound from them and add some music. Then merge everything into a single file without recoding or loss of quality.

Let's put these files in a separate folder and go to this folder from the command line to edit video files using ffmpeg commands.

You also need to maintain the correct order and grouping of the command line parameters of the ffmpeg utility:

  • Don't forget that the input file(s) for manipulation and editing are specified immediately after the ffmpeg command after the -i option: ffmpeg -i video.mp4 ;
  • after the parameters of the input or input files there are global parameters - for example, the option to select streams, the option of a new video resolution;
  • then there is the video codec option, followed by its parameters, including video filters;
  • then there is an audio codec option and its parameters are listed, including filters;
  • completes the command output filename.

Example command line

FFmpeg: transcoding and destructive editing

For many video file editing operations, such as video stitching, these files need to be converted to a single format.

The main purpose of FFmpeg is to transcode media files from one format to another. And transcoding into FFmpeg can be done very easily.

At a minimum, for recoding to another format you need to specify in the output file required extension file. That's all. Using this extension, the utility will select the required codec and transcode the input file according to the default parameters for this codec, based on the parameters of the input file. For example, the following command will transcode an MP4 video.mp4 input file into a WEBM container file video.webm

Fmpeg -i video.mp4 video.webm

But the default settings are usually basic and may not provide the desired quality or the ability to be further edited. Therefore, format parameters can be set explicitly. Let's list the main options for the video parameter block and the audio block.

ffmpeg options for video parameters:

  • -vcodec or briefly c:v - video codec parameters, or "copy", or an empty parameter (default value)
  • -f - container format
  • -b - bitrate in kilobits or megabits per second is specified by the letter K or M
  • -aspect - aspect ratio of the image (4:3, 16:9, 1.3333, 1.7777)
  • -r - framerate

ffmpeg options for sound options:

  • -acodec or briefly c:a - audio codec parameters, or "copy", or an empty parameter (default value)
  • -f - audio format
  • -ab - audio bitrate
  • -ar - discredit frequency
  • -ac - number of channels

For example, let's recode the MP4 video.mp4 input file into the WEBM video.webm container file with some explicitly specified parameters

As a result of this command, the process of transcoding video and audio streams using the selected codecs will start according to the new parameters. Depending on the parameters of the multimedia files and the power of the computer, this transcoding process can take quite a long time.

FFmpeg: change video resolution

Re-encoding will be done, naturally, and if you simply set a new resolution for the video using the global option -s

Ffmpeg -i video.mp4 -s 320x240 video.webm

FFmpeg: transcoding and non-destructive video editing without quality loss

Now about converting video from one format to another without losing quality. For some operations, editing is possible without recoding audio and video, without loss of quality, when the streams inside the container file remain untouched and are simply copied as is from one file to another. To do this, the -vcodec and -acodec options use the copy option. For example, let’s “pour” a video stream and an audio stream from an MP4 video.mp4 file into the TS video.ts container file:

As a result new file The video.ts container will contain the untouched video and audio from the video.ts container file.

FFmpeg: Non-destructive slicing and trimming of video files

The video file is trimmed using the -ss and -t options. The -ss option specifies the start of trimming, and the -t option specifies the duration of the further fragment. Time is specified in the format "hours:minutes:seconds". To non-destructively edit the contents of a video file, use the copy parameter.

Trimming without recoding is very fast and does not take up much computer power.

FFmpeg: gluing and joining video files

To glue and connect video files using ffmpeg, they must be of the same format, including the same in terms of the parameters of video and audio streams of this format. If this is not the case, then you need to first transcode the video files to a single format.

For many formats, concatenating files in ffmpeg is done using the concat operator, which after a colon is passed a sequence of input files separated by a pipe character. An example of gluing files file1.avi and file2.avi of the same format and type without recoding:

Ffmpeg -i "concat:file1.avi|file2.avi" -vcodec copy -acodec copy output.avi

When combining video fragments into a single file, you should take into account that the video streams and audio streams of the fragments are added separately and then combined into one container. Therefore, if in one of the fragments the audio track is shorter in time than the video stream, then the audio tracks of the remaining fragments will shift to the end of this short audio track and sound desynchronization will occur. This must be taken into account.

FFmpeg: splicing and joining MP4 video files

Video files in an MP4 container cannot be concatenated using the concat operator. But you can first convert these files into a container, for example, MPEG-TS without transcoding video and audio:

Ffmpeg -i vid1.mp4 -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f mpegts vid1.ts ffmpeg -i vid2.mp4 -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f mpegts vid2.ts

And then these files can be combined using the concat operator into the final mp4 file:

Ffmpeg -i "concat:vid1.ts|vid2.ts" -vcodec copy -acodec copy out.mp4

FFmpeg: removing audio track

Often you need to remove an audio stream from a video file in order to later replace it with some other one. This is done using the -an (audio not) option.

Ffmpeg -i zvuk.mpg -vcodec copy -an bezzvuka.mpg

FFmpeg: adding or replacing audio track

You need to add an audio stream to a video file using additional option-i which passes the path to the sound file as a parameter.

FFmpeg: "-map" option to access streams in video files

Above we saw an example of the repeated use of the -i option for ffmpeg when multiple input media files are processed, concatenated, multiplexed. It was also said above that container files can contain several multimedia streams of video, sound and data. FFmpeg has a special option -map , which can be used to specify a specific input media stream or internal stream in the container to process, copy, or paste.

Streams are designated by a double number separated by a colon - “0:0”, “0:1”, “1:0”, “2:1”, etc. The first digit before the colon is the serial number of each input file specified by the -i option, starting from zero. And the number after the colon indicates the thread number inside the file.

Let's look at the -map option using specific examples.

Save a separate audio track from a video file (demultiplexing)

The stream numbers in each video file can be determined through the output of the ffmpeg -i command, which will have approximately the following format:

Ffmpeg -i video.mkv ... Stream #0:0(und): Video ... Stream #0:1(ger): Audio ... Stream #0:2(eng): Audio ... Stream # 0:3(rus): Subtitle…

That is, the 0 before the colon means that this is the first input file for ffmpeg - in the example above it is the video.mkv file. And the numbers after the colon mean the numbers of the internal streams of this file. To process a specific stream, the -map option must be passed the specific number of that stream. An example of a command with the -map option, which demultiplexes, that is, saves one of the container’s audio tracks into a separate file:

Ffmpeg -i video.mkv -map 0:2 sound.wav

FFmpeg: add multiple audio tracks to a video file (multiplexing)

Now let's look at an example of adding multiple audio tracks to a video file using FFmpeg. To do this, we again use the -map option.

Let's say we have a clean video file video.avi and we have selected several audio tracks zvuk1.mp3 and zvuk2.mp3 for it - for example, different music or comments on different languages. Now we use the "-map" option for multiplexing, that is, combining these files into a single container file:

Ffmpeg -i video.avi -i zvuk1.mp3 -i zvuk2.mp3 -map 0:0 -map 1:0 -map 2:0 out.avi

As you can see, for input files after -i options, -map options use numbers before the colon. And we received an output video file with two audio tracks inside, which can be switched between in many players - for example, in an mpv player, switching between audio tracks is done via “#” (Shift+2).

Naturally, it was possible to add encoding parameters for a new video file. For example, the -c:v copy -c:a copy options would allow, in the example above, to create a new out.avi file by pure copying without recoding the input files video.avi, zvuk1.mp3 and zvuk2.mp3.

Thus, using FFmpeg you can add subtitles to a video file. The main thing is not to get confused in the numbers of input streams and threads inside the container.

Always at hand

The above article describes the basic FFmpeg commands for beginners in a cheat sheet style. Beyond the scope of the article there were many syntactic features of the ffmpeg command line, and there are many functionality this program. For example, there is no talk about FFmpeg filters. More successful use of FFmpeg requires further familiarity with the complete documentation of the program and with the documentation of the required multimedia formats.

The article may be supplemented in the future with new examples of using FFmpeg. But everyone always has a manual and reference book in English at hand.

Ffmpeg -h full > ffmpeg_help.txt

In this article, we will try to explain “on the fingers” what FFmpeg is for novice Linux users (and Windows too). FFmpeg is a popular set of programs and libraries among multimedia and web developers. Based on FFmpeg, many programs have been made for converting video from one format to another. The popularity of this program is extremely high. Why is it so popular? What is it most often used for? How to install and how to run?

So, the main features of FFmpeg that can attract the attention of an inexperienced Linux user who has just started learning Ubuntu:

  • FFMpeg is free.
  • Available in all Linux distributions.
  • You can watch any movie.
  • Works with all kinds of video formats.
  • Allows you to convert video from one format to another.
  • Supports parallel encoding on multiple processors.
  • Accelerated encoding on NVidia cards.
  • You can use FFmpeg in your programs and then sell them.

FFmpeg is available on Linux, Windows, Mac Os. And it works the same everywhere. So, if you have learned to work with FFmpeg on Windows, then you need to run it in the same way on Linux and vice versa.

FFmpeg absolutely self-sufficient. In order to watch a movie, there is no need to search the Internet, download and install codecs. Just one file (ffplay.exe) is enough, all codecs are contained inside this file.

FFmpeg - free software (GPL 2.0 and LGPL 2.1 licenses) and you can use its code in your projects, both commercial and freely distributed.

As already mentioned, FFmpeg is a collection of programs. What does “set of programs” mean? Do I need to download all programs or can I download them separately? What's inside? We will now try to answer these questions.

But first, let's define the term FF mpeg is short for F ast F orward Mpeg. When we talk about FFmpeg as a set of programs, the first two letters “F” must be capitalized (FF).

So, FFmpeg consists of the following tools: ffmpeg, ffplay, ffserver, ffprobe(note, everything is in lower case). For Windows these are ordinary exe files. Moreover, their size is very impressive. The thing is that all video and audio codecs are already inside them. If you need to watch a movie, then just download ffplay.exe from the Internet, nothing else is required. No installers, no codecs, no Administrator rights required. Downloaded, unzipped, you can start watching the movie.

FFmpeg on Windows, the size of each file is 38-39Mb, all codecs are compiled and linked “inside” the executable file.

ffmpeg

With this program you can convert videos from one format to another. Stitch several videos into one. Parse video into separate frames (images), and then glue them back together. Speed ​​up/slow down, zoom, add subtitles and multiple audio tracks. And 100,500 more useful actions.

The list of available options for this command spans 203 pages:

Impressive, isn't it?

ffplay


Used to watch movies. If you start getting acquainted with FFmpeg by watching movies, then ffplay is what you need. At the initial stage, the entire FFmpeg package for beginners comes down to using only this program.

ffserver


If you suddenly want to create your own video hosting similar to YouTube, then use ffserver.

ffprobe


A magical program that will tell you everything about the movie you downloaded (format, duration, how many audio tracks and much more). It will display so much information about the film that it will take half a day to read it all.

In addition to the four programs, the FFmpeg package also includes a set of freely distributed libraries (from which the above programs are compiled):

  • libavutil— a set of auxiliary functions;
  • libavcodec— audio/video codecs;
  • libavformat— library for working with containers;
  • libavdevice— working with devices that supply media content;
  • libavfilter— various filters;
  • libswscale— scaling library, working with color spaces;
  • libswresample— sound processing library.

In principle, it was because of these libraries that the entire FFmpeg project was started, and the programs were already a bonus :)

Using these libraries, you can create your own applications for working with multimedia content and even then sell them. Writing your own video player or video converter is not difficult. The web is full of tutorials and instructions on how to use FFmpeg libraries.

Story

The history of FFmpeg is as rich as its contents. Having started in 2000, it suffered a strong shock in 2011, when some developers decided to create their own library for working with media content, they called it Libav. They explained their desire to leave the project by dissatisfaction with the organization of the FFmpeg project, where essentially all power was in the hands of one person and all decisions were made only by him.

Now Libav goes its own way and doesn’t listen to anyone. The code is not updated as often as FFmpeg. Each update is carefully checked.

FFmpeg did not remain in debt and regularly, every two days, takes into its hole the changes in the code made by the Libav team :-)

Currently, FFmpeg continues to actively develop, as evidenced by a screenshot of the source code repository:

Installation

FFmpeg is so popular that it is included by default in many Linux distributions. If for some reason you did not install it right away, you can do this later using a package manager. Installing FFmpeg for beginners should not pose any problems. Depending on your Linux distribution, you will need to run a number of standard commands.

Sudo add-apt-repository ppa:mc3man/trusty-media sudo apt-get update sudo apt-get install ffmpeg

Yum -y install ffmpeg ffmpeg-devel

openSuSe

Zipper install ffmpeg

The most latest versions FFmpeg for Windows can be downloaded from:

https://ffmpeg.zeranoe.com/builds/

Two types of FFmpeg

There are two forms in which FFmpeg comes to your computer:

1) static-build— in this case, all codecs, filters and utilities are compiled “inside” ffmpeg.exe (ffprobe.exe, ffplay.exe) and you only need to download one of these files to start watching a movie (ffplay.exe). In this case, the size of the executable module is greatly inflated (up to 39Mb). But it is very convenient.

2) shared-build- here codecs, filters and other auxiliary programs are independent separate files that FFmpeg finds and loads as needed. In this case, the size of the executable module is only 190Kb.

If you install FFmpeg on Linux, there is a 99.9% chance that shared-build will be installed.

Personally, I prefer static-build (no need to think about other libraries). To get static-build under Linux, you need to build FFmpeg yourself from the source code. For new Linux users, this can be difficult.

How to watch a movie?

Everything is clear, but how to watch movies? As mentioned above, ffplay (ffplay.exe - for Windows) is a console program, that is, it does not have a graphical interface. To watch the video you need to run on the command line:

Ffmpeg.exe film.avi

after which the movie immediately starts playing:

For a novice user, this method of launching a movie may seem unusual. But this is the whole power of ffplay. It has the same huge number of options as ffmpeg, which will help you customize the picture for the most demanding movie lovers.

If you feel unsure when working with command line Windows, then you can use the following method. Grab the movie with your mouse and drag it onto ffplay.exe, the movie will immediately begin to play.

Playback control (short list of commands):

q,ESC- exit,
f— full screen (double-click with the left mouse button),
p- pause
m— sound on/off,
9, 0 - volume up/down,
t- switching subtitles,
c- cycle program
s— frame-by-frame movement through the film,
left/right arrow— move 10 seconds back/forward,
down/up arrow— move 1 minute back/forward,
page down/page up— move 10 minutes back/forward.

The graphical interface of the ffplay player looks rather ascetic, or rather, it doesn’t exist at all. There are no usual sliders, buttons, menus inherent in media players with a graphical interface. When working with ffplay, you only see the movie itself and some strange numbers and words flashing in the terminal window, like in the movie “The Matrix”. In fact, controlling the movie from the keyboard is simple and clear; after a few viewings, your fingers will remember which buttons to press.

Several examples of launching ffplay with various options:

Reduce image size by 4 times width

Ffplay -vf scale=iw/4:-1 video.avi

Clear video from noise

Ffplay -vf hqdn3d=4:3:6:4.5 video.avi

2x acceleration

Ffplay -vf setpts=0.5*PTS video.avi

How to recode?

Convert mpg to avi

Ffmpeg -i video.mpg video.avi

Extract audio from video and record as MP3

Ffmpeg -i video.mp4 -vn -ab 128 audio.mp3

Combine audio and video

Ffmpeg -i audio.wav -i video.avi final_video.mpg

Extract video track (without audio)

Ffmpeg -i video.mp4 -an video_bez_zvuka.mp4

Resize video

Ffmpeg -i video.mp4 -s 640x480 -c:a copy video640480.mp4

Throw out the first 45 seconds of the video and leave a section lasting 40 seconds

Transcode WAV to MP3

Ffmpeg -i audio.wav -b:a 192k audio.mp3

Decompose video into frames (images)

Ffmpeg -i video.webm thumb%04d.jpg

Make a video from a set of images

Ffmpeg -i frame-%03d.png video.avi

Conclusion

This article aims to introduce the reader to the most powerful set of FFmpeg programs. A brief description of the FFmpeg package is given. Examples of its use are given for watching video and for processing (converting) audio and video materials.

Only a small part of the capabilities of the FFmpeg package is listed. I think that's enough for a first look. Left behind the scenes are such FFmpeg features as multi-pass encoding, filters and filter chains, a combination with Avisynth, and assembly of FFmpeg with third-party codecs.

The purpose of this article was to show that FFmpeg for novice Linux users should be an indispensable tool when working with media content. There is no need to be afraid of the lack of GUI. Working with audio and video from the console can also be very effective.

P.S. Since I have to use FFmpeg often, I decided to collect all the popular usage techniques in one book.

— Remove the x264, libx264-dev, and ffmpeg packages if they were installed:

$ sudo apt-get purge ffmpeg x264 libx264-dev libmp3lame-dev

— If auto-update of packages is enabled on the system, we prohibit updating the ffmpeg package:
If the file "/etc/apt/apt.conf.d/50unattended-upgrades" exists, then add the ffmpeg package to the “Package-Blacklist” section; if the file does not exist, create it:

$ sudo echo -e "Unattended-Upgrade::Package-Blacklist (n "ffmpeg";n);" > /etc/apt/apt.conf.d/50unattended-upgrades

For assembly x264 latest version required yasm. Let's check which version is installed:

$ yasm --version yasm 1.2.0 Compiled on Nov 20 2013.

If the versions match, then skip the next step

$ apt-get remove yasm $ wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz $ tar xvfz yasm-1.2.0.tar.gz $ cd yasm-1.2 .0 $ ./configure --prefix=/usr/local $ make $ sudo make install $ yasm --version yasm 1.2.0 Compiled on Nov 20 2013.

— We get the dependent packages necessary to install ffmpeg and x264:

$ sudo apt-get update $ sudo apt-get install build-essential subversion texi2html libfaac-dev libfaad-dev libmp3lame-dev libtheora-dev quilt libsdl1.2-dev libogg-dev libvorbis-dev liba52-dev libdts-dev libimlib2-dev libraw1394-dev libdc1394-22-dev libtheora-dev libgsm1-dev libfaac-dev libfaad-dev git-core checkinstall yasm libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev zlib1g-dev nasm python-chardet gstreamer1.0-libav gstreamer0.10-ffmpeg

If during the installation process you received an error regarding the dependency of the gstreamer0.10-ffmpeg package

add a new repository and update indexes

Sudo add-apt-repository ppa:mc3man/trusty-media sudo apt-get update

after which we repeat the process of installing packages

— Install x264 from source

$ mkdir ~/src; cd ~/src $ git clone git://git.videolan.org/x264.git $ cd ./x264/ $ ./configure --prefix=/usr/local --enable-shared $ make $ sudo checkinstall -- pkgname = x264 --pkgversion head -c 7`" --backup = no --deldoc = yes --fstrans = no --default sudo checkinstall --pkgname =x264 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | cut -d" " -f3`.`git rev-list HEAD | wc -l` +git `git rev-list HEAD -n 1 | head -c 7`" --backup =no --default $ sudo make install-lib-dev && sudo cp libx264.a /usr/local/lib/

— Install x264_b10 from source

$ mkdir ~/src; cd ~/src $ git clone git://git.videolan.org/x264.git $ cd ./x264/ $ ./configure --prefix=/usr/local --enable-shared --bit-depth=10 $ make $ sudo checkinstall --pkgname=x264_b10 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | cut -d" " -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | head -c 7`" --backup = no --deldoc = yes --fstrans = no --default $ sudo make install-lib-dev $ sudo cp libx264.a /usr/local/lib/

Let's check which version of lame is installed:

$lame -h LAME 64bits version 3.99.5 (http://lame.sf.net)

If you receive a response that the version is older than 3.99, then skip the next step

— Installs lame codec support

$cd ~/src $ sudo mkdir -p /usr/local/share/doc/lame $ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz $ tar xzvf lame-3.99.5.tar.gz $ cd lame-3.99.5 $ ./configure --enable-nasm --disable-shared $ make $ sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.99 .5" --backup=no --default --deldoc=yes

— Install libxvid from source

$ cd ~/src $ wget http://downloads.xvid.org/downloads/xvidcore-1.3.3.tar.gz $ tar xzvf xvidcore-1.3.3.tar.gz $ cd ./xvidcore/build/generic $ ./configure --prefix=/usr/local $ make $ sudo make install apt-get install libopencore-amrnb-dev libopencore-amrwb-dev libgsm1-dev libfaac-dev libtheora-dev libvorbis-dev libx264-dev libdc1394-22- dev libxext-dev libxfixes-dev

— Install ffmpeg with x264 codec support:

$ cd ~/src $ git clone git://git.videolan.org/ffmpeg.git $ cd ffmpeg/ $ ./configure --prefix=/usr/local --enable-gpl --enable-postproc --enable -swscale --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable -libxvid --enable-nonfree --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-shared $ make $ sudo checkinstall --pkgname=ffmpeg --pkgversion="7:$( date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default $ hash x264 ffmpeg ffplay ffprobe $ldconfig -v

  • install the necessary coding utilities

$ sudo apt-get install mkvtoolnix gpac mencoder dvdrip avidemux

Let's check the installation

$ which ffmpeg /usr/local/bin/ffmpeg

$ ffmpeg-encoders| grep-E "mp3|xvid|aac|gsm|amr|x264|theora|vorbis"
ffmpeg version N-55691-gca7f637 Copyright 2000—2013 the FFmpeg developers
built on Aug 21 2013 15:44:17 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --prefix=/usr/local --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac - -enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid
libavutil 52.42.100 / 52.42.100
libavcodec 55.29.100 / 55.29.100
libavformat 55.14.100 / 55.14.100
libavdevice 55.3.100 / 55.3.100
libavfilter 3.82.100 / 3.82.100
libswscale 2.5.100 / 2.5.100
libswresample 0.17.103 / 0.17.103
libpostproc 52.3.100 / 52.3.100
V... libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
V... libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
V... libxvid libxvidcore MPEG-4 part 2 (codec mpeg4)
V... libtheora libtheora Theora (codec theora)
A...X... aac AAC(Advanced Audio Coding)
A... libfaac libfaac AAC (Advanced Audio Coding) (codec aac)
A... libopencore_amrnb OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band) (codec amr_nb)
A... libgsm libgsm GSM (codec gsm)
A... libgsm_ms libgsm GSM Microsoft variant (codec gsm_ms)
A... libmp3lame libmp3lame MP3 (MPEG audio layer 3) (codec mp3)
A...X...vorbis Vorbis
A... libvorbis libvorbis (codec vorbis)

Examples of using

One pass coding:

ffmpeg -i input. avi -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 -threads 0 output. mp4

The lower the parameter -crf, the higher the quality, but more file. Reasonable values ​​are from 18 to 28.

Two-pass encoding:

ffmpeg -i input. avi -pass 1 -vcodec libx264 -vpre fast_firstpass -b 512k -bt 512k -threads 0 -f rawvideo -an -y /dev/null && ffmpeg -i input. avi -pass 2 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre fast -b 512k -bt 512k -threads 0 output. mp4

Re-encoding for iPod (640x480):

ffmpeg -i input. avi -acodec libfaac -aq 100 -ac 2 -vcodec libx264 -vpre slow -vpre ipod640 -crf 26 -map _meta_data 0 : 0 -vf scale = 640 : -1 -threads 0 output. mp4

1. Getting information about a video file

ffmpeg -i video.avi

2. Turn a set of pictures into a video

ffmpeg -f image2 -i image%d.jpg video.mpg This command will convert all images in the current directory (named image1.jpg, image2.jpg, etc.) into a video file video.mpg (translator's note: I prefer this format: ffmpeg -r 12 -y -i "image_%010d.png" output.mpg here the frame rate (12) for the video is set, the format “image_%010d.png” means that pictures will be searched in the form image_0000000001.png, image_0000000002.png, etc., that is, in printf format)

3. Cut videos into pictures

ffmpeg -i video.mpg image%d.jpg

This command will create files image1.jpg, image2.jpg, etc., PGM, PPM, PAM, PGMYUV, JPEG, GIF, PNG, TIFF, SGI formats are also supported.

4. Convert video to iPod/iPhone format

ffmpeg -i source_video.avi input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X final_video.mp4

Explanations:

  • Source: source_video.avi
  • Audio codec: aac
  • Audio bitrate: 128kb/s
  • Video codec: mpeg4
  • Video bitrate: 1200kb/s

5. Convert videos to PSP format

ffmpeg -i source_video.avi -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac final_video.mp4

Explanations:

  • Source: source_video.avi
  • Audio codec: aac
  • Audio bitrate: 32kb/s
  • Video codec: xvid
  • Video bitrate: 1200kb/s
  • Video size: 320 by 180 pixels
  • Received video: final_video.mp4

6. Extract audio track from video and save to mp3

ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3

Explanations:

  • Source: source_video.avi
  • Audio bitrate: 192kb/s
  • Output format: mp3
  • Received audio file: sound.mp3

7. Convert wav to mp3

ffmpeg -i son_origin.wav -vn -ar 44100 -ac 2 -ab 192 -f mp3 son_final.mp3

8. Convert .avi to .mpg

ffmpeg -i video_origin.avi video_finale.mpg 

9. Convert .mpg to .avi

ffmpeg -i video_origin.mpg video_finale.avi 

10. Convert .avi to .gif (no compression)

ffmpeg -i video_origin.avi gif_anime.gif

11. Add sound to video

ffmpeg -i son.wav -i video_origin.avi video_finale.mpg

12. Convert .avi to .flv

ffmpeg -i video_origin.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv video_finale.flv

13. Convert .avi to .dv

ffmpeg -i video_origin.avi -s pal -r pal -aspect 4:3 -ar 48000 -ac 2 video_finale.dv

Ffmpeg -i video_origin.avi -target pal-dv video_finale.dv

14. Convert .avi to mpeg for DVD players

ffmpeg -i source_video.avi -target pal-dvd -ps 2000000000 -aspect 16:9 finale_video.mpeg

Explanations:

  • Output format: pal-dvd
  • Maximum size for output file: 2000000000 (2 Gb)
  • Widescreen format: 16:9

15. Compress .avi to DivX

ffmpeg -i video_origin.avi -s 320x240 -vcodec msmpeg4v2 video_finale.avi

16. Compress OGG Theora to mpeg DVD

ffmpeg -i film_sortie_cinelerra.ogm -s 720x576 -vcodec mpeg2video -acodec mp3 film_termin.mpg

17. Compress .avi to SVCD mpeg2

ffmpeg -i video_origin.avi -target ntsc-svcd video_finale.mpg

PAL format:

Ffmpeg -i video_origin.avi -target pal-svcd video_finale.mpg

18. Compress .avi to VCD mpeg2

NTSC Format:

Ffmpeg -i video_origin.avi -target ntsc-vcd video_finale.mpg

PAL format:

Ffmpeg -i video_origin.avi -target pal-vcd video_finale.mpg

19. Multi-pass encoding with ffmpeg

ffmpeg -i fichierentree -pass 2 -passlogfile ffmpeg2pass fichiersortie-2

20. Convert .m4b to .mp3

ffmpeg -i filename.m4b -acodec libmp3lame -ar 22050 filename.mp3 or find -iname "*.m4b" -print0 | xargs -0 -I () ffmpeg -i () -acodec libmp3lame -ar 22050 ().mp3

Update

Remove previously installed packages:

Sudo apt-get remove ffmpeg x264 libx264-dev

We update x264:

Cd ~ /src/x 264 make distclean git pull

We update FFmpeg:

Cd ~ /src/ffmpeg make distclean svn update

In both cases, repeat the installation procedure FFmpeg And x264, as described earlier, only from the place “./configure la-la-la...”

Cancels all changes made according to this instruction

sudo apt-get remove x264 ffmpeg build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libsdl1.2 -dev libtheora-dev libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev rm -rf ~/src/x264 ~/src/ffmpeg

Addition

if you need to install x264 to work with 10-bit video. Then yes. It's worth doing all this. Now about the libx264 library. ffmpeg in Ubuntu does not work with the x264 codec, but directly with the libx264.so.123 encoding library, which is located in the directory with architecture-dependent libraries. Firstly, for a normal x264 configuration to work in conjunction with ffmpeg (receiving a video stream for encoding from ffmpeg), before starting the x264 configuration you need to install the following packages: libavformat-dev, libffms2-dev, libgpac-dev, libswscale-dev. After installing these packages by running ./configure we will see the following:

/scr/x264$ ./configure

platform: X86_64
system: LINUX
cli: yes
libx264: internal internal libx264 encoding library
shared: no — the libx264.so.*** system library will not be built. namely, it is used by ffmpeg for video encoding and processing.
static: no
asm: yes — assembly optimized for the processor installed on the computer
interlaced: yes — support for working with interlaced video is included
avs: no — support for working with avisync is disabled on Linux
lavf: yes - enabled support for input files of all formats that ffmpeg understands
ffms: yes — also enabling ffmpeg support, I don’t know what exactly. It seems to support formats that ffmpeg may not process correctly or something like that.
gpac: yes
gpl: yes
thread: posix

debug: no
gprof: no
strip: no
PIC: no
visualize: no
bit depth: 8 encoding into video files with only 8-bit color depth
chroma format: all

And so we see that x264 will be built with support for everything possible, but ffmpeg will not work with it. Now what needs to be done to ensure that ffmpeg works directly with the codec we have assembled. To do this, you need to configure x264 with the following keys:

Prefix=/usr — all compiled files will be located in the /usr program directory
- bindir=/usr/bin — will place the x264 codec in the program folder /usr/bin and not in the folder of locally compiled programs /usr/local/bin installed by default.
- libdir=/usr/lib/x86_64-linux-gnu — will place the encoding library libx264.so.*** in the directory of architecture-dependent libraries (please note that I have 64 bit system and accordingly the “x86_64-linux-gnu” directory is used; for other architectures, a different directory should be used)
- enable-shared - includes creation dynamic library encoding libx264.so.*** which ffmpeg will look for when configured with x264 codec support enabled (as far as I know, it must be enabled with the configuration key, but who knows, I haven’t tried to compile ffmpeg itself yet, perhaps to link ffmpeg with libx264.so. *** you will have to include some other configuration keys)
-enable-static - includes the creation of static libraries libx264.so (note ffmpeg works with a dynamic library and not a static library. A dynamic library also has a version number at the end of the file name. That is why after installation new version x264 codec to ensure ffmpeg works with it, it has to be rebuilt every time.
— bit-depth=10 — the codec configuration is enabled for assembling only 10-bit video (including libraries. Both 8-bit and 10-bit video will be played, but only 10-bit video will be created by this codec. If this option is not needed, then do not install it and a codec will be assembled that will create only 8-bit video.

This is what we get when configuring the codec with these keys:

/scr/x264$ ./configure --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib/x86_64-linux-gnu --enable-shared --enable-static --bit- depth=10
fatal: Not a git repository (or any of the parent directories): .git
platform: X86_64
system: LINUX
cli: yes - work on the command line
libx264: internal — creation of internal libraries
shared: yes — creation of dynamic libraries
static: yes - creation of static libraries
asm: yes - optimization for the processor (you need to install yasm before building
interlaced: yes — working with interlaced video
avs: no - avisync on the side
lavf: yes - support for ffmpeg formats
ffms: yes — support for other formats
gpac: yes — optimization of work with OpenSourse Multimedia
gpl: yes
thread: posix
filters: resize crop select_every
debug: no
gprof: no
strip: no
PIC: yes
visualize: no
bit depth: 10 — Create only 10-bit video (encoding profiles High10, High422 and High444
chroma format: all

More detailed information about x264 codec configuration keys can be viewed by typing the command ./configure -h in the directory with x264 source codes

Basically, here is its content:

/scr/x264$ ./configure -h
Usage: ./configure
Help:
- h, --help print this message
Standard options:
— prefix=PREFIX install architecture-independent files in PREFIX
— exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
— bindir=DIR install binaries in DIR
— libdir=DIR install libs in DIR
— includedir=DIR install includes in DIR
— extra-asflags=EASFLAGS add EASFLAGS to ASFLAGS
— extra-cflags=ECFLAGS add ECFLAGS to CFLAGS
— extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS
Configuration options:
- disable-cli disable cli
— system-libx264 use system libx264 instead of internal
- enable-shared build shared library
- enable-static build static library
- disable-gpl disable GPL-only features
- disable-thread disable multithreaded encoding
- enable-win32thread use win32threads (windows only)
— disable-interlaced disable interlaced encoding support
- enable-visualize enable visualization (X11 only)
— bit-depth=BIT_DEPTH set output bit depth (8-10)
— chroma-format=FORMAT output chroma format (420, 422, 444, all)
Advanced options:
- disable-asm disable platform-specific assembly optimizations
— enable-debug add -g
— enable-gprof add -pg
- enable-strip add -s
- enable-pic build position-independent code
Cross-compilation:
— host=HOST build programs to run on HOST
— cross-prefix=PREFIX use PREFIX for compilation tools
— sysroot=SYSROOT root of cross-build tree
External library support:
— disable-avs disable avisynth support (windows only)
- disable-swscale disable swscale support
- disable-lavf disable libavformat support
- disable-ffms disable ffmpegsource support
- disable-gpac disable gpac support



2024 wisemotors.ru. How it works. Iron. Mining. Cryptocurrency.