📜  FFMPEG for linux (1)

📅  最后修改于: 2023-12-03 15:00:44.796000             🧑  作者: Mango

FFMPEG for Linux

FFMPEG is a powerful and open-source multimedia framework that is widely used for video and audio processing. It is available for Linux, Windows, and Mac operating systems, but in this article, we will focus on the Linux version.

Installation

To install FFMPEG on Linux, follow these simple steps:

  1. Open a terminal window.
  2. Update the system packages: sudo apt-get update
  3. Install FFMPEG: sudo apt-get install ffmpeg

Alternatively, you can download the latest package from the official website and install it manually. Make sure to check the system requirements and dependencies before installation.

Usage

FFMPEG provides a wide range of features for media processing, including encoding, decoding, muxing, demuxing, filtering, and streaming. Here are some examples of how to use FFMPEG on Linux:

Convert a video file to a different format

To convert a video file from one format to another, use the following command:

ffmpeg -i input.mp4 -c:v libx264 -c:a aac -strict -2 output.flv

This command will convert the input file input.mp4 to the output file output.flv, using the H.264 video codec (libx264) and the AAC audio codec.

Extract audio from a video file

To extract the audio stream from a video file, use the following command:

ffmpeg -i input.mp4 -vn -c:a copy output.mp3

This command will extract the audio from the input file input.mp4 and save it to the output file output.mp3, using the original audio codec (-c:a copy).

Apply a filter to a video file

To apply a filter to a video file, use the following command:

ffmpeg -i input.mp4 -vf "scale=640:360" output.mp4

This command will resize the input file input.mp4 to a resolution of 640x360 pixels using the scale filter and save it to the output file output.mp4.

Conclusion

FFMPEG is a powerful multimedia framework that offers a wide range of features for video and audio processing. Its open-source nature and availability on multiple platforms make it an ideal choice for developers and hobbyists alike. With the help of the commands and examples provided in this article, you should be able to get started with FFMPEG on Linux and explore its many capabilities.