Ffmpeg для linux mint

Как установить ffmpeg в Ubuntu / Debian

Установка:

Для установки ffmpeg в Ubuntu / Linux Mint / Debian, введите в Терминал :

Подробная информация о пакете:

Инструменты для перекодирования, потоковой передачи и воспроизведения мультимедийных файлов

Зависимости:

Библиотека FFmpeg с de/encoders для аудио / видео кодеков — файлы времени выполнения

Библиотека FFmpeg с дополнительными файлами для аудио / видео кодеков

Библиотека FFmpeg для обработки устройств ввода и вывода — файлы времени выполнения

Библиотека FFmpeg, содержащая медиа-фильтры — файлы времени выполнения

Библиотека FFmpeg с дополнительными медиа-фильтрами — файлы времени выполнения

Библиотека FFmpeg с (de) мультиплеерами для мультимедийных контейнеров — файлы времени выполнения

Библиотека совместимости FFmpeg для повторной выборки — файлы времени выполнения

Библиотека FFmpeg с функциями упрощения программирования — файлы времени выполнения

Библиотека GNU C: общие библиотеки

Библиотека FFmpeg для последующей обработки — файлы времени выполнения

Простой слой DirectMedia

Библиотека FFmpeg для повторной дискретизации аудио, рематрисинга и т.д. — файлы времени выполнения

Библиотека FFmpeg для масштабирования изображений и различных преобразований — файлы времени выполнения

Источник

Как установить FFmpeg на Linux

FFmpeg – это одна из лучших мультимедийных платформ, которая содержит различные инструменты для различных задач.

Например, ffplay – это портативный медиаплеер, который можно использовать для воспроизведения аудио / видео файлов, ffmpeg может конвертировать файлы в разные форматы, ffserver может использоваться для потоковой трансляции в прямом эфире, а ffprobe может анализировать мультимедийный поток.

Этот фреймворк действительно мощный благодаря разнообразию доступных в нем инструментов, которые обеспечивают лучшее техническое решение для пользователя.

Согласно описанию FFmpeg на официальном веб-сайте, причиной наличия такой великолепной мультимедийной среды является сочетание лучших доступных вариантов бесплатного программного обеспечения.

Инфраструктура FFmpeg обеспечивает высокий уровень безопасности, и причиной этого является серьезность того, что разработчики проверяют код, это всегда делается с учетом безопасности.

Я уверен, что вы найдете этот фреймворк очень полезным, когда захотите сделать потоковое аудио или видео или записать видео.

Есть много других практических вещей, которые вы можете сделать с помощью фреймворка FFmpeg, таких как преобразование вашего wav-файла в mp3, кодирование и декодирование ваших видео или даже масштабирование их.

Позвольте мне привести пример, очень простой. Следующая команда преобразует ваш файл mp4 в простой файл avi.

Вышеприведенная команда полезна только для пояснения, ее не рекомендуется использовать на практике, поскольку кодекс, битрейт и другие особенности не объявлены.

В следующей части мы будем практиковаться с некоторыми из инструментов мультимедиа-инфраструктуры FFmpeg, но перед тем, как это сделать, мы должны установить его в нашу коробку Linux.

Как установить FFmpeg Multimedia Framework в Linux

Поскольку пакеты FFmpeg предлагаются для наиболее часто используемых дистрибутивов Linux, установка будет относительно простой. Начнем с установки платформы FFmpeg в дистрибутивы на основе Ubuntu.

Установите FFmpeg в Ubuntu и Linux Mint

Я установлю FFmpeg через PPA, рекомендованный в официальном блоге. Откройте новый терминал (CTRL + ALT + T) и затем выполните следующие команды.

Установите FFmpeg в Debian

Чтобы установить FFmpeg, сначала вам нужно добавить следующую строку в ваш файл /etc/apt/sources.list.

Читайте также:  Creating windows service application

В соответствии с вашим дистрибутивом измените «mydist» на «stretch», «jessie» или «wheezy».

Затем обновите исходные коды системных пакетов и установите FFmpeg с помощью следующих команд.

Установите FFmpeg на CentOS и RHEL

Чтобы установить FFmpeg в дистрибутивах CentOS и RHEL, вам необходимо включить репозиторий EPEL и RPM Fusion в системе, используя следующие команды.

Чтобы установить и включить EPEL, используйте следующую команду.

Чтобы установить и включить RPM Fusion, используйте следующую команду в вашей версии дистрибутива.

После включения репозиториев выполните следующую команду для установки FFmpeg:

Установите FFmpeg на Fedora

В Fedora вам нужно установить и включить RPM Fusion для установки FFmpeg, как показано на рисунке.

Компиляция FFmpeg из исходного кода

Компиляция программного обеспечения из исходного кода – не самая простая вещь в мире, но с правильными инструкциями мы сможем это сделать.

Сначала убедитесь, что ваша система соответствует всем зависимостям. Установка этих зависимостей может быть выполнена с помощью следующих команд.

Во-первых, скажите системе, чтобы она разобрала последние пакеты.

Установите зависимости с помощью следующей команды.

Затем используйте следующую команду, чтобы создать новый каталог для источников FFmpeg. Это каталог, в который будут загружаться исходные файлы.

Теперь скомпилируйте и установите ассемблер yasm, используемый FFmpeg, выполнив следующие команды.

После того, как вы успешно установили ассемблер yasm, пришло время установить несколько различных кодеков, которые будут использоваться с конкретными инструментами FFmpeg. Используйте следующие команды для установки видеокодера H.264.

Другим полезным полезным кодировщиком является аудиокодер libfdk-aac AAC.

Установите libopus аудио декодер и кодировщик.

Теперь пришло время установить ffmpeg из исходного кода.

Примечание. Если вы не установили определенные кодировщики, обязательно удалите ‘–enable-encoder_name‘ из вышеуказанной команды ‘./configure so, чтобы установка прошла без проблем.

Заключение

В этой первой части мы ознакомили наших читателей с последними новостями в соответствии с мультимедийной платформой FFmpeg и показали, как установить ее на своих компьютерах с

Следующая часть будет полностью посвящена изучению того, как использовать удивительные инструменты в этой ведущей мультимедийной среде.

Источник

Compile FFmpeg for Ubuntu, Debian, or Mint

Contents

This guide for standard support releases of Ubuntu, Debian, and Linux Mint and will provide a local, non-system installation of FFmpeg with several external libraries.

You may also refer to the Generic Compilation Guide for additional information about compiling software.

Recent static builds are also available for lazy people or those who are unable to compile. The static builds do not support non-free libraries.

Note: FFmpeg is part of the Ubuntu packages and can be installed via apt-get install ffmpeg . You may still wish to compile if you want the latest version, experience a bug, or want to customize your build, and it will not interfere with the ffmpeg package in the repository.

This guide is designed to be non-intrusive and will create several directories in your home directory:

  • ffmpeg_sources – Where the source files will be downloaded. This can be deleted if desired when finished with the guide.
  • ffmpeg_build – Where the files will be built and libraries installed. This can be deleted if desired when finished with the guide.
  • bin – Where the resulting binaries ( ffmpeg , ffplay , ffprobe , x264 , x265 ) will be installed.

You can easily undo any of this as shown in Reverting Changes Made by This Guide.

Get the Dependencies

These are packages required for compiling, but you can remove them when you are done if you prefer:

On Ubuntu 20.04 you may also need this command: ( ​ note)

Note: Server users can omit the ffplay and x11grab dependencies: libsdl2-dev libva-dev libvdpau-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev .

Читайте также:  Get all process windows c

In your home directory make a new directory to put all of the source code and binaries into:

Compilation & Installation

This guide assumes that you want to install some of the most common third-party libraries. Each section provides you with the commands needed to install that library.

For each section, copy-paste the entire code-block into your shell.

If you do not require certain features, you may skip the relevant section (if it is not required) and then remove the appropriate ./configure option in FFmpeg. For example, if libvpx is not needed, skip that section and then remove —enable-libvpx from the Install FFmpeg section.

Tip: To significantly speed up the compilation process on systems with multiple cores, you can use the -j option with each make command to set the number of compilation jobs allowed to run simultaneously, such as make -j4 . To set this to the number of available logical CPU cores, use make -j$(nproc) . The -j option also works with the ninja build system used to compile some of the libraries in this guide. Using all cores may cause your machine to become slow or unresponsive.

An assembler used by some libraries.

If your repository provides nasm version ≥ 2.13 then you can install that instead of compiling:

Otherwise you can compile:

libx264

H.264 video encoder. See the H.264 Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with —enable-gpl —enable-libx264 .

If your repository provides libx264-dev version ≥ 118 then you can install that instead of compiling:

Otherwise you can compile:

libx265

H.265/HEVC video encoder. See the H.265 Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with —enable-gpl —enable-libx265 .

If your repository provides libx265-dev version ≥ 68 then you can install that instead of compiling:

Otherwise you can compile:

libvpx

VP8/VP9 video encoder/decoder. See the VP9 Video Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with —enable-libvpx .

If your repository provides libvpx-dev version ≥ 1.4.0 then you can install that instead of compiling:

Otherwise you can compile:

libfdk-aac

AAC audio encoder. See the AAC Audio Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with —enable-libfdk-aac (and —enable-nonfree if you also included —enable-gpl ).

If your repository provides libfdk-aac-dev then you can install that instead of compiling:

Otherwise you can compile:

libopus

Opus audio decoder and encoder.

Requires ffmpeg to be configured with —enable-libopus .

If your repository provides libopus-dev version ≥ 1.1 then you can install that instead of compiling:

Otherwise you can compile:

libaom

AV1 video encoder/decoder:

Warning: libaom does not yet appear to have a stable API, so compilation of libavcodec/libaomenc.c may occasionally fail. Just wait a day or two for us to catch up with these annoying changes, re-download ffmpeg-snapshot.tar.bz2 , and try again. Or skip libaom altogether.

libsvtav1

AV1 video encoder/decoder. Only the encoder is supported by FFmpeg, so building of the decoder is disabled.

Requires ffmpeg to be configured with —enable-libsvtav1 .

libdav1d

AV1 decoder, much faster than the one provided by libaom.

Requires ffmpeg to be configured with —enable-libdav1d .

If your repository provides libdav1d-dev , you can install that instead of compiling:

Otherwise you’ll need can build from source. Users whose distributions don’t provide a recent enough version of meson (0.49.0 or newer) will need to install a more up-to-date version. This is easily done via the Python Package Index:

Читайте также:  How to add russian keyboard windows 10

NASM version 2.14 or newer is required for AVX-512 support. See the NASM section for how to install/build. Alternatively, disable AVX-512 in Meson setup with -Denable_avx512=false .

libvmaf

Library for calculating the ​ VMAF video quality metric. Requires ffmpeg to be configured with —enable-libvmaf . Currently ​ an issue in libvmaf also requires FFmpeg to be built with —ld=»g++» for a static build to succeed.

FFmpeg

Now re-login or run the following command for your current shell session to recognize the new ffmpeg location:

Compilation and installation are now complete and ffmpeg (also ffplay , ffprobe , lame , x264 , & x265 ) should now be ready to use. The rest of this guide shows how to update or remove FFmpeg.

Usage

You can now open a terminal, enter the ffmpeg command, and it should execute your new ffmpeg .

If you need multiple users on the same system to have access to your new ffmpeg , and not just the user that compiled it, then move or copy the ffmpeg binary from

/bin to /usr/local/bin .

Documentation

If you want to run man ffmpeg to have local access to the documentation:

You may have to log out and then log in for man ffmpeg to work.

HTML formatted documentation is available in

You can also refer to the online FFmpeg documentation, but remember that it is regenerated daily and is meant to be used with the most current ffmpeg (meaning an old build may not be compatible with the online docs).

Updating FFmpeg

Development of FFmpeg is active and an occasional update can give you new features and bug fixes. First you need to delete (or move) the old files:

Now can just follow the guide from the beginning.

Reverting Changes made by this Guide

Remove the build and source files as well as the binaries:

You may also remove packages that have been installed from this guide:

Why install to

  • Avoids installing files into any system directories.
  • Avoids interfering with the package management system.
  • Avoids conflicts with the ffmpeg package from the repository.
  • Super simple to uninstall.
  • Does not necessarily require sudo or root: useful for shared server users as long as they have the required dependencies available.

/bin is already in the vanilla Ubuntu PATH (see

/.profile ).

  • User is free to move ffmpeg to any other desired location (such as /usr/local/bin ).
  • Why are the commands in this guide so complicated?

    It is to make compiling easy and convenient for the user. This guide:

    • Confines everything to the user’s home directory (see the previous FAQ question above).
    • Is intended to be usable on all currently supported versions of Debian and Ubuntu.
    • Allows the user to choose if they want to compile certain libraries (latest and greatest) or to simply install the version from their repository (fast and easy but older).

    This results in some various additional commands and configurations instead of the typical and simple ./configure , make , make install .

    make[1]: Nothing to be done for ‘all’/’install’

    This is message from libvpx that occasionally makes users think something went wrong. You can ignore this message. It just means make is finished doing its work.

    If You Need Help

    Feel free to ask your questions at the #ffmpeg IRC channel or the ffmpeg-user mailing list.

    Источник

    Оцените статью