2022-09-07 20:49:20 +10:00
# FFmpeg VVC En/decoder & xHE-AAC installation (Windows, Mac OS and Linux)
2022-05-18 20:37:27 +10:00
2022-05-22 22:21:44 +10:00
Windows, Mac and Linux (Preview of vvc video in ffplay):
2022-05-18 20:37:27 +10:00

2022-05-22 22:21:44 +10:00


2022-05-18 20:37:27 +10:00
2022-06-23 03:42:25 +10:00
# Play video file
2022-05-18 20:37:27 +10:00
2022-06-23 03:42:25 +10:00
You can play VVC video codec with .h266, .vvc, .266 and anything or .mp4 muxed with VVC codec:
2022-05-18 20:37:27 +10:00
```
2022-08-29 18:29:04 +10:00
ffplay_vvceasy versatile.266
2022-05-18 20:37:27 +10:00
```
2022-08-29 18:29:04 +10:00
Or if you have xHE-AAC audio codec:
```
ffplay_vvceasy -codec:a libfdk_aac -i versatile.m4a
```
# Limitations of FFmpeg VVC encoder
2022-06-23 03:42:25 +10:00
Before encode to VVC video codec, see the limitations below.
libvvenc (FFmpeg vvc version) works for:
- Pixel format ✅ (changeable of 8/10bit)
- Video size (auto detects, but it doesn't detect for SAR and DAR anamorphic is glitch and corrupts the video ) ⚠️ (Better way to use vvencapp without FFmpeg)
- Frame rate ✅ (auto detects)
- MP4 Muxing :x: (does not support, you need MP4BOX after encode.)
- Audio with encode VVC ⚠️ (does not support, because it can corrupt the file) To avoid corrupt file, you need to disable audio using `-an` or you could do output container for .266, .vvc and .h266 too.
- Bitrates ✅
- Passes ⚠️ (only one pass)
- Presets ⚠️ (only medium preset)
- QP/CRF ⚠️ (only you can set -global_quality command only, global_quality equals qp)
2022-08-29 18:29:04 +10:00
- HDR ⚠️ (default SDR, but cannot encode HDR)
2022-06-23 03:42:25 +10:00
Built in libvvenc for FFmpeg command:
```
ffmpeg -i example.mp4 -c:v libvvenc -global_quality 37 -pix_fmt yuv420p10 example.266
```
Additional command: You can convert to vvc video without taking a much space for vvencapp, example:
2022-05-21 05:44:06 +00:00
```
2022-10-07 16:19:51 +10:00
ffmpeg -i example.mp4 -pix_fmt yuv420p -f yuv4mpegpipe - | vvencapp --y4m -i - --preset medium --qp 35 -o converted.266
2022-05-21 05:44:06 +00:00
```
2022-08-29 18:29:04 +10:00
Converting xHE-AAC to AAC audio:
```
ffmpeg -c:a libfdk_aac -i mymusic.m4a -c:a aac -b:a 128k mymusic.aac
```
2022-06-23 03:42:25 +10:00
Replace video size for `-s` and frame rate for `-r` .
2022-05-21 05:44:06 +00:00
### Update 21th May 2022 of FFmpeg vvdec support
Good news, you can play .mp4 file after .h266 and audio format were merged into mp4 playable of VVC.
2022-08-18 00:10:56 +10:00
About [xHE-AAC ](https://www.iis.fraunhofer.de/en/ff/amm/broadcast-streaming/xheaac.html ), now it's available decode support xHE-AAC of FFmpeg. [Exhale ](https://gitlab.com/ecodis/exhale ) (encoder) is free to use and open source, but if you want Fraunhofer IIS xHE-AAC, you can download [EZ CD Audio Converter ](https://www.poikosoft.com/music-converter ) for Windows only. You can also merge your encoded xHE-AAC audio into mp4 too.
2022-05-21 05:44:06 +00:00
2022-06-23 03:42:25 +10:00
To make playable mp4 with audio and video together, you need VVC video encoded, audio file and [GPAC Nightly build ](https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/ ). Code for mp4box/gpac to merge VVC video encoded and audio file:
2022-05-21 05:44:06 +00:00
```
2022-09-05 17:39:12 +10:00
mp4box -add video.266 -add audio.m4a -new convertedvvc.mp4
2022-05-21 05:44:06 +00:00
```
2022-05-22 22:21:44 +10:00
Containers are also acceptable video containers of .mkv, .mp4, .mov and more.
2022-05-21 05:44:06 +00:00
For Linux and Mac OS users: Replace **mp4box** by **gpac**
2022-05-18 20:37:27 +10:00
2022-08-29 18:29:04 +10:00
# FFmpeg Downloads (xHE-AAC & VVC en/decoder plugin compiled by Martin Eesmaa)
2022-05-21 23:41:35 +10:00
2022-10-11 11:10:13 +11:00
[Windows ](https://mega.nz/file/n4d0HLpD#Stu2nWNf4wj-5CPgXFfcM8rfJdMpXm_kSixxweeUJf8 )
2022-05-21 23:41:35 +10:00
2022-08-27 15:52:56 +10:00
[Mac OS ](https://mega.nz/file/3xtTAIiQ#MPsPcz-QlSquqahmEx8ANpqleiVm2Y3L1o3R6vy7qY8 )
2022-05-21 23:41:35 +10:00
2022-10-20 14:56:11 +11:00
[Linux ](https://mega.nz/file/750BlAqC#szh_j2LeVT7F3J6nMiOgGHa8i3QPnYq1INamPtVcCcI ) (Only FFplay static won't work)
2022-05-21 23:41:35 +10:00
2022-10-10 22:35:14 +11:00
### Note about downloads
I use always Windows to compile FFmpeg, so I forgot compile every time for Mac OS and Linux. Also, please check changelog before you download the new version.
### Changelog
```
2022-10-20 14:56:11 +11:00
20/10/2022: Add Linux static binaries of FFmpeg, but only FFplay does not work only.
2022-10-11 11:10:13 +11:00
11/10/2022: Removed libvorbis + updated SDL2 latest.
2022-10-10 22:35:14 +11:00
10/10/2022: Revert from flt to s16 for two decoders of libvorbis & libspeex.
10/10/2022: Removed libvmaf (reason: not working), added libvorbis + libspeex improve decode quality.
30/09/2022: Improved vmaf (float, built models to FFmpeg) & updated sdl2. Update: Fixed libvmaf models
24/09/2022: Improved libvmaf up to date of FFmpeg code + update dav1d & vvenc.
07/09/2022: Added Dolby AC4 decoder + updated vvenc/vvdec.
01/09/2022: Added libopus with latest version for improve decode quality, libdav1d and libvmaf (optional if they want calculate score by vvc video and original video).
29/08/2022: Brought back vvenc.
```
2022-06-18 20:36:14 +10:00
# Mac OS downloaders (Important note)
2022-08-27 15:52:56 +10:00
Please note, this is not a malware of my compiled build, see the three screenshots to make run ffmpeg tools customised version
2022-06-18 20:36:14 +10:00
You need to allow the app on your Mac OS for chmod write access & Security & Privacy:
Step 1: Click cancel button, do not move to bin.

Step 2: Go to Security & Privacy on Mac OS Settings app, then check App Store & identified developers or anywhere is on. Click "Allow anyway" to unblock an application.

Step 3: Click "Open" button, this does not hurt your computer.

2022-06-23 03:42:25 +10:00
### Build Mac OS for FFmpeg VVC build
2022-06-18 20:36:14 +10:00
Requirements:
Xcode
2022-08-27 13:36:34 +10:00
CMake
2022-06-18 20:36:14 +10:00
NASM
Homebrew
Code to build FFmpeg VVC version:
```
2022-08-27 15:52:56 +10:00
brew install libxml2 ffmpeg fdk-aac nasm
2022-06-18 20:36:14 +10:00
git clone https://github.com/fraunhoferhhi/vvenc
git clone https://github.com/fraunhoferhhi/vvdec
cd vvenc & & mkdir build & & cd build
2022-08-27 13:36:34 +10:00
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
2022-08-27 15:52:56 +10:00
sudo cmake --build . --target install -j $nproc
2022-06-18 20:36:14 +10:00
cd ../../
cd vvdec & & mkdir build & & cd build
2022-08-27 13:36:34 +10:00
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
2022-08-27 15:52:56 +10:00
sudo cmake --build . --target install -j $nproc
2022-06-18 20:36:14 +10:00
cd ../../
2022-08-27 13:36:34 +10:00
git clone --depth=1 https://github.com/MartinEesmaa/FFmpeg-FixVVC
cd FFmpeg-FixVVC
./configure --enable-libfdk-aac --enable-libvvenc --enable-libvvdec --enable-static --enable-pic --enable-libxml2 --pkg-config-flags="--static" --enable-sdl2
make -j
2022-06-18 20:36:14 +10:00
```
2022-09-23 21:06:33 +10:00
# Linux builders (Important for FFplay)
2022-05-21 23:41:35 +10:00
2022-09-23 21:06:33 +10:00
You can build using this:
2022-05-21 23:41:35 +10:00
```
2022-09-15 17:47:03 +10:00
sudo apt update & & sudo apt upgrade -y & & \
2022-09-23 21:06:33 +10:00
sudo apt install build-essential cmake nasm autoconf pkg-config \
python3-setuptools ninja-build python3-pip libtool git wget -y & & \
sudo pip3 install meson & & \
2022-08-21 09:26:39 +10:00
git clone --depth=1 https://github.com/fraunhoferhhi/vvenc & & \
2022-08-22 18:53:49 +10:00
git clone --depth=1 https://github.com/fraunhoferhhi/vvdec & & \
2022-08-21 09:26:39 +10:00
git clone --depth=1 https://github.com/mstorsjo/fdk-aac & & \
2022-08-22 18:53:49 +10:00
git clone --depth=1 https://github.com/libsdl-org/SDL & & \
git clone --depth=1 https://github.com/gnome/libxml2 & & \
2022-09-16 14:29:03 +10:00
git clone --depth=1 https://github.com/xiph/opus & & \
2022-09-23 21:06:33 +10:00
git clone --depth=1 https://code.videolan.org/videolan/dav1d & & \
2022-08-21 09:26:39 +10:00
git clone --depth=1 https://github.com/MartinEesmaa/FFmpeg-FixVVC & & \
2022-09-15 16:35:28 +10:00
cd vvenc & & sudo make install-release install-prefix=/usr/local disable-lto=1 & & \
2022-08-22 18:53:49 +10:00
cd .. & & \
2022-09-15 16:35:28 +10:00
cd vvdec & & sudo make install-release install-prefix=/usr/local disable-lto=1 & & \
2022-08-22 18:53:49 +10:00
cd .. & & \
cd fdk-aac & & autoreconf -if & & ./configure --prefix=/usr/local --enable-static --disable-shared & & sudo make install -j $nproc & & \
2022-06-23 03:42:25 +10:00
cd .. & & \
2022-08-22 18:53:49 +10:00
cd libxml2 & & autoreconf -if & & ./configure --prefix=/usr/local --enable-static --disable-shared & & sudo make install -j $nproc & & \
2022-08-21 09:26:39 +10:00
cd .. & & \
2022-09-16 14:29:03 +10:00
cd opus & & autoreconf -if & & ./configure --prefix=/usr/local --enable-static --disable-shared & & sudo make install -j $nproc & & \
cd .. & & \
2022-08-22 18:53:49 +10:00
cd SDL & & ./configure --prefix=/usr/local --enable-static --disable-shared & & sudo make install -j $nproc & & \
2022-09-23 21:06:33 +10:00
cd .. & & \
2022-09-27 15:39:43 +10:00
mkdir dav1d/build & & cd dav1d/build & & meson -Denable_docs=false -Ddefault_library=static -Dprefix=/usr/local .. & & sudo ninja install & & \
2022-09-23 21:06:33 +10:00
cd ../../ & & \
2022-10-20 14:56:11 +11:00
cd FFmpeg-FixVVC & & \
2022-08-27 13:36:34 +10:00
./configure --enable-static --pkg-config-flags="--static" --extra-ldexeflags="-static" \
2022-08-22 18:53:49 +10:00
--enable-libfdk-aac --enable-libvvenc --enable-libvvdec --enable-pic \
2022-10-20 14:56:11 +11:00
--enable-libxml2 --enable-libopus --enable-libdav1d --enable-sdl2 & & \
2022-05-21 23:41:35 +10:00
make -j
```
2022-09-23 21:06:33 +10:00
If you want actually play VVC file with FFplay on your local distro, you need to remove command `--extra-ldexeflags="-static"` , otherwise it might give result segmentation fault for FFplay static only.
If compiling is success and finished, you can install FFmpeg VVC for using the code:
2022-05-21 23:41:35 +10:00
```
2022-08-21 09:26:39 +10:00
mv ffmpeg ffmpeg_vvceasy
mv ffplay ffplay_vvceasy
mv ffprobe ffprobe_vvceasy
2022-09-16 14:29:03 +10:00
sudo cp ffmpeg_vvceasy ffplay_vvceasy ffprobe_vvceasy /usr/local/bin
2022-05-21 23:41:35 +10:00
```
# Special thanks
VVC programmers of FFmpeg:
Original author: [@FFmpeg ](https://github.com/FFmpeg ) Repository: https://github.com/FFmpeg/FFmpeg
[@lehmann-c ](https://github.com/lehmann-c ) (Christian Lehmann) Repository: https://github.com/lehmann-c/FFmpeg
[@tbiat ](https://github.com/tbiat ) Repository: https://github.com/tbiat/FFmpeg
2022-05-18 20:37:27 +10:00
2022-09-05 17:39:12 +10:00
VVC encoder programmer to FFmpeg: [@IsaMorphic ](https://github.com/IsaMorphic ) (Isabelle Santin) Repository: https://github.com/IsaMorphic/FFmpeg-VVC
2022-06-23 03:42:25 +10:00
2022-09-05 17:39:12 +10:00
[@MartinEesmaa ](https://github.com/MartinEesmaa ) (Martin Eesmaa) Repository: https://github.com/MartinEesmaa/FFmpeg-FixVVC
AC4 decoder programmer to FFmpeg: [@richardpl ](https://github.com/richardpl ) (Paul B Mahol) Repository: https://github.com/richardpl/FFmpeg/tree/ac4
AC4 support in mp4 container: [@AUGxhub ](https://github.com/AUGxhub ) Repository: https://github.com/AUGxhub/FFmpeg/tree/patch-1
2022-08-27 15:52:56 +10:00
2022-05-18 20:37:27 +10:00
- Martin Eesmaa