30
July
2024
17:42

Compilation of the DAV1D Video Decoder

30 July 2024 17:42

D.av1d - самый быстрый декодер видео формата AV1 для Windows, Linux и MaCOS.

Introduction

On the ASUS "Eee PC" non-card leading Linux Lxle, with the AMD E-350 processor and the RU video card Radeon HD 6250 у меня видео воспроизводится с проблемами: в браузере Google Chrome видео прерывается. Решение - сначала скачать видео и затем воспроизвести его с жесткого диска, при помощи проигрывателя видео mpv. Конечно, для многих задач достаточно и mpv, но более совершенным является dav1d - written in C. Comparison with other players Here.
For those who do not want to compile, there is a ready -made solution cm. End of the article - section "Использование dav1d".

The ability to install DAV1D from the Linux repository

Coder / Decoder is present in the Ubuntu repository

sudo apt update
sudo apt install daV1D

Version from the repository:

dav1d --verSion

1.2.1

Looking ahead, the version after the compilation turned out to be much newer:

dav1d --verSion

1.4.2-15-g23555EEB

DAV1D home page and source code repository

DAV1D home page находится на сайте VideoLAN.org

There is no binary file and you need to create it independently, by compilation of the source texts.
The source code repository is located on GitHub. To clone the repository to your disc:

git clone https://github.com/videolan/daV1D

Requirements for compilation

The following packages are needed:

  • Build -essential
  • clang
  • Meson
  • ninja

The first three conditions are satisfied with the installation of packages from the command line:

sudo apt install build-essentiaL.
sudo apt-get install claNG
sudo apt-get install mEson

As for Ninja, there are two ways - to install from the repository or download the latest version.

sudo apt-get install ninja-Build

Or you can download a binary file for Linux-64BIT from the Ninja project page:
*https://github.com/ninja-build/ninja/releaSES.
I chose the second method - a binary file.

DAV1D assembly official

*Videlan - DAV1D

Unofficial compilation procedure DAV1D

1) After cloning from the repository, a folder appeared in the home catalog ~/dav1d/. We go into it.
2) Open from the page https://github.com/ninja-build/ninja/releases и открываем в архиваторе файл ninja-linux.zip и извлекаем бинарный файл nonja в директорию ~/dav1d/.
3) select the default compiler G+

sudo update-alternaTIVES --config CC # Selection G+
sudo update-alternaTIVES --config C ++ # choice G+

4) In the DAV1D folder we create the Build directory

mkdir build

5) compilation

meson setup build

6) Assembly from object files in the Build folder

cd build
../ninja

Result - the output file after compilation is in the directory "~/dav1d/build/tools", executed file "DAV1D".

7) installing a binary file in system catalogs

../ninja -C build instaLL

The program will ask for the privileges of a super -user for installing a binary file. After entering the password, the executed file Dav1d будет записан в директорию /usr/local/Bin:

Installing tools/dav1d to /usr/local/bin

Other compilation instructions

On the site christian Külker

Using DAV1D

The decoder is built into the player VLs starting with version 3.0.5 и используется для воспроизведения фильмов в AV1 по умолчанию. Текущая версия VLC - 3.0.16.

sudo apt instaLL VLC

And in the command line Launch VLC to play video

vlc video.mp4

Additional VLC keys can improve the performance and quality of playback (lower the percentage of the processor, reduce the number of personnel loss), as it is written Here.

DAV1D does not directly play the video. It is used in external programs to play video, such as VLC and MPV.

Use in the MPV player

According to MPV documentation за вывод видео отвечают ключи

--vo =
Specify the video output backend to be used. See VIDEO OUTPUT DRIVERS for details and descriptions of available driverS.
--VD = <...>

  • Video drivers through a comma.

The latest version of MPV with support Dav1d нужно ставить не из репозитория Linux, а из Flatpak!

Installation of a player mpv с помощью Flatpak:

sudo add-apt-repository ppa:flatpak/staBle

sudo apt update

sudo apt install flatpak

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrEPO

flatpak install flathub io.mPV.mpv

flatpak run io.mPV.mpv

Source:Reddit - AV1 Videosare lagging like crazy(frame drops)

Либо можно скачать со страницы FlatHub файл FLatpakref для mPV или установить его командами терминала:

wget https://dl.flathub.org/repo/appstream/io.mpv.Mpv.flatpakrEF
sudo flatpak install io.mpv.Mpv.flatpakrEF
flatpak run io.mPV.mpv

Launching a file playing in MPV

flatpak run io.mpv.Mpv video.mP4

How to download a file with YouTube.

For the web browser Mozilla Firefox is an extension "E.asy YouTube Video Downloader", which adds a button for downloading a video. Video stored from Mozilla Firefox можно посмотреть в любом проигрывателе после скачивания, в том числе при отсутствии Интернета, например, в командировке.



Related publications