2022-09-07 12:49:20 +02:00
# FFmpeg VVC En/decoder & xHE-AAC installation (Windows, Mac OS and Linux)
2022-05-18 12:37:27 +02:00
2022-05-22 14:21:44 +02:00
Windows, Mac and Linux (Preview of vvc video in ffplay):
2022-05-18 12:37:27 +02:00
![ffmpegplaypreview ](https://user-images.githubusercontent.com/88035011/169019033-bcb7fcc7-a196-4436-a396-61db3071280c.png )
2022-05-22 14:21:44 +02:00
![macos_vvceasy_ff ](https://user-images.githubusercontent.com/88035011/169693891-52271091-eb92-4198-82eb-2ad38296a917.png )
![linux_vvceasy_ff ](https://user-images.githubusercontent.com/88035011/169693886-3f8e97da-ad57-46ab-b3eb-45e5ff4e687d.png )
2022-05-18 12:37:27 +02:00
2022-06-22 19:42:25 +02:00
# Play video file
2022-05-18 12:37:27 +02:00
2022-06-22 19:42:25 +02:00
You can play VVC video codec with .h266, .vvc, .266 and anything or .mp4 muxed with VVC codec:
2022-05-18 12:37:27 +02:00
```
2022-08-29 10:29:04 +02:00
ffplay_vvceasy versatile.266
2022-05-18 12:37:27 +02:00
```
2022-08-29 10:29:04 +02: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-22 19:42:25 +02:00
Before encode to VVC video codec, see the limitations below.
libvvenc (FFmpeg vvc version) works for:
2023-01-10 11:43:17 +01:00
- Pixel format ⚠️ (only pixel format 10 bit)
- 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)
2022-06-22 19:42:25 +02:00
- 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 ✅
2023-01-10 11:45:53 +01:00
- Passes ⚠️ (you may need get passes using vvenc params on FFmpeg VVCEasy or use vvencapp)
2023-01-10 11:43:17 +01:00
- Presets ✅
2023-01-10 11:45:53 +01:00
- QP ✅
2023-01-10 11:43:17 +01:00
- HDR ✅
2022-06-22 19:42:25 +02:00
Built in libvvenc for FFmpeg command:
```
2023-01-10 11:43:17 +01:00
ffmpeg -i example.mp4 -c:v libvvenc -qp 37 -preset slow example.266
2022-06-22 19:42:25 +02:00
```
2023-01-10 11:43:17 +01:00
For more options for libvvenc in FFmpeg VVCEasy version, type `ffmpeg_vvceasy -h encoder=libvvenc` for available commands.
2022-06-22 19:42:25 +02:00
Additional command: You can convert to vvc video without taking a much space for vvencapp, example:
2022-05-21 07:44:06 +02:00
```
2022-10-07 08:19:51 +02:00
ffmpeg -i example.mp4 -pix_fmt yuv420p -f yuv4mpegpipe - | vvencapp --y4m -i - --preset medium --qp 35 -o converted.266
2022-05-21 07:44:06 +02:00
```
2022-08-29 10:29:04 +02: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-22 19:42:25 +02:00
Replace video size for `-s` and frame rate for `-r` .
2022-05-21 07:44:06 +02: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-17 16:10:56 +02: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 07:44:06 +02:00
2022-06-22 19:42:25 +02: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 07:44:06 +02:00
```
2022-09-05 09:39:12 +02:00
mp4box -add video.266 -add audio.m4a -new convertedvvc.mp4
2022-05-21 07:44:06 +02:00
```
2022-05-22 14:21:44 +02:00
Containers are also acceptable video containers of .mkv, .mp4, .mov and more.
2022-05-21 07:44:06 +02:00
For Linux and Mac OS users: Replace **mp4box** by **gpac**
2022-05-18 12:37:27 +02:00
2022-08-29 10:29:04 +02:00
# FFmpeg Downloads (xHE-AAC & VVC en/decoder plugin compiled by Martin Eesmaa)
2022-05-21 15:41:35 +02:00
2023-04-18 16:20:07 +02:00
[Windows ](https://mega.nz/file/b5EQzbwA#9Qaz_hjbW3EkD1tmAxUfomrHjUrHUzgdxZjz3cjQcJA )
2022-05-21 15:41:35 +02:00
2022-08-27 07:52:56 +02:00
[Mac OS ](https://mega.nz/file/3xtTAIiQ#MPsPcz-QlSquqahmEx8ANpqleiVm2Y3L1o3R6vy7qY8 )
2022-05-21 15:41:35 +02:00
2023-01-10 11:43:17 +01:00
[Linux ](https://mega.nz/file/XxkwjLpC#Q8iqsjAI3wx3Uf_P9c22hkL2TaEonN3r4_m6FQfgfRY ) (Only FFplay static won't work)
2022-05-21 15:41:35 +02:00
2023-03-03 13:11:05 +01:00
[FFmpeg-FixVVC archived old source code ](https://mega.nz/file/G81QyT5S#jcbE1sYPEy1OMIDPCF8BPeAK-3KAGF50u23MVJzmBgw ) (old)
2022-10-10 13:35:14 +02:00
### Note about downloads
2023-01-10 11:43:17 +01:00
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.
2022-10-10 13:35:14 +02:00
### Changelog
```
2023-04-18 16:20:07 +02:00
19/04/2023: Updated of vvenc, vvdec, FFmpeg commits and others.
2023-04-03 03:58:46 +02:00
03/04/2023: New FFmpeg master latest VVCEasy builds with updated vvenc, vvdec and added libvmaf & libjxl. Removed AC4 for compilation/decoder errors for new AC4 audio files.
2023-02-03 11:45:24 +01:00
03/02/2023: Updated vvenc library on Windows FFmpeg VVCEasy build.
2023-02-02 12:56:28 +01:00
02/02/2023: Updated vvenc library and others on Windows FFmpeg VVCEasy build.
2023-01-29 12:23:39 +01:00
29/01/2023: Updated vvenc, vvdec and other libraries on Windows FFmpeg VVCEasy build.
2023-01-10 11:43:17 +01:00
10/01/2023: Updated vvenc latest and others.
2023-01-05 02:15:46 +01:00
05/01/2023: Update Linux FFmpeg static builds (still does not work for FFplay static only, others working fine)
2022-12-30 12:40:06 +01:00
30/12/2022: Improved vvenc codes of FFmpeg VVCEasy, thanks Thomas Siedel from Spin Digital! TIP: Type "ffmpeg_vvceasy -h encoder=libvvenc" for FFmpeg vvenc available. See the new vvenc patch: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=7922
2022-12-23 12:49:28 +01:00
23/12/2022: Update all libraries, fix MP4-ALS mono audio & added libcodec2 to FFmpeg.
2022-12-07 14:02:12 +01:00
07/12/2022: Update vvenc, vvdec and others. Fixed Windows N version. (#22)
2022-10-20 05:56:11 +02:00
20/10/2022: Add Linux static binaries of FFmpeg, but only FFplay does not work only.
2022-10-11 02:10:13 +02:00
11/10/2022: Removed libvorbis + updated SDL2 latest.
2022-10-10 13:35:14 +02: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 12:36:14 +02:00
# Mac OS downloaders (Important note)
2022-08-27 07:52:56 +02: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 12:36:14 +02: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.
![Kuvatõmmis 2022-06-18 103427 ](https://user-images.githubusercontent.com/88035011/174431074-10a867d3-787a-47aa-9910-53fcef89e30e.png )
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.
![Kuvatõmmis 2022-06-18 103518 ](https://user-images.githubusercontent.com/88035011/174431083-1d1d9b2b-5b45-425e-86d1-015e44588b4e.png )
Step 3: Click "Open" button, this does not hurt your computer.
![Kuvatõmmis 2022-06-18 103557 ](https://user-images.githubusercontent.com/88035011/174431086-9eb0df35-2fde-4ca7-99d4-2efa45a0a946.png )
2022-06-22 19:42:25 +02:00
### Build Mac OS for FFmpeg VVC build
2022-06-18 12:36:14 +02:00
Requirements:
Xcode
2022-08-27 05:36:34 +02:00
CMake
2022-06-18 12:36:14 +02:00
NASM
Homebrew
Code to build FFmpeg VVC version:
```
2022-08-27 07:52:56 +02:00
brew install libxml2 ffmpeg fdk-aac nasm
2022-06-18 12:36:14 +02:00
git clone https://github.com/fraunhoferhhi/vvenc
git clone https://github.com/fraunhoferhhi/vvdec
cd vvenc & & mkdir build & & cd build
2022-08-27 05:36:34 +02:00
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
2022-08-27 07:52:56 +02:00
sudo cmake --build . --target install -j $nproc
2022-06-18 12:36:14 +02:00
cd ../../
cd vvdec & & mkdir build & & cd build
2022-08-27 05:36:34 +02:00
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
2022-08-27 07:52:56 +02:00
sudo cmake --build . --target install -j $nproc
2022-06-18 12:36:14 +02:00
cd ../../
2022-08-27 05:36:34 +02: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 12:36:14 +02:00
```
2022-09-23 13:06:33 +02:00
# Linux builders (Important for FFplay)
2022-05-21 15:41:35 +02:00
2023-04-03 03:58:46 +02:00
You can build using [Linux script ](libvvdecffmpeg.sh ).
2022-05-21 15:41:35 +02:00
2022-09-23 13:06:33 +02: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 15:41:35 +02:00
```
2022-08-21 01:26:39 +02:00
mv ffmpeg ffmpeg_vvceasy
mv ffplay ffplay_vvceasy
mv ffprobe ffprobe_vvceasy
2022-09-16 06:29:03 +02:00
sudo cp ffmpeg_vvceasy ffplay_vvceasy ffprobe_vvceasy /usr/local/bin
2022-05-21 15:41:35 +02: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
2023-04-03 03:58:46 +02:00
[@tbiat ](https://github.com/tbiat ) (Thibaud Biatek) Repository: https://github.com/tbiat/FFmpeg
2022-05-18 12:37:27 +02:00
2022-09-05 09:39:12 +02:00
VVC encoder programmer to FFmpeg: [@IsaMorphic ](https://github.com/IsaMorphic ) (Isabelle Santin) Repository: https://github.com/IsaMorphic/FFmpeg-VVC
2022-06-22 19:42:25 +02:00
2023-04-03 03:58:46 +02:00
[@MartinEesmaa ](https://github.com/MartinEesmaa ) (Martin Eesmaa) Repository: https://github.com/MartinEesmaa/FFmpeg-VVC
[@NuoMi ](https://github.com/nuomi2021 ) of some codes and [Thomas Siedel ](https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=8577 ) of new external VVC encoder & decoder.
2022-09-05 09:39:12 +02:00
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 07:52:56 +02:00
2022-05-18 12:37:27 +02:00
- Martin Eesmaa