MartinEesmaa / VVCEasy

VVCEasy is that you don't have to compile or/and coding to encode VVC (known as Versatile Video Codec). Simple. Easy. Encode. Decode
https://martineesmaa.github.io/en/vvceasy
MIT License
157 stars 15 forks source link

My vision for the future of H.266 (VVC) #53

Closed jiangzemin-xudamin closed 4 weeks ago

jiangzemin-xudamin commented 1 month ago
PixPin_2024-07-20_13-53-42

Hello Martin. First of all, I have some bad news for you., since FFMPEG added support for VVC encoding, I deleted your modified FFMPEG from my hard disk. because the relatively newest version of FFMPEG compiled by gyan has libvvenc enabled by default, and it works well and with fewer bugs.

Unfortunately, the xHE-AAC encoder is still not implemented in official FFMPEG, except for Mainconcept FFmpeg (--enable-omx_enc_xheaac), and I have to keep using exhale.

I think the biggest problem with vvc right now is getting support from hardware vendors, maybe in the future there will be hardware encoders like "vvc_nvenc" or "vvc_qsv", Or someone will make a vvc codec program that uses OpenCL or CUDA graphics card acceleration. In another decade or so, H.267 may appear, but I don't think its efficiency will be too much higher than H.266, information entropy has its limits. As for the AV2 encoder, it is currently under development. I'm guessing it might be formalized in 2026-2028. As for the technology of using A.I. to compress videos, I am not very optimistic. The same video file compressed by A.I. may be played inconsistently on different devices, with different software, or even on the same hardware and software using different learning models.

Here's the batchfile I've written:

md output
for %%a in (*.mp3 *.flac *.m4a) do ( 
.\ffmpeg -i "%%~sa" -vn -c:a pcm_s32le -strict -2 -f wav -ac 2 - | .\exhale a ".\output\%%~na.m4a"
)
for %%a in (*.png *.jpg *.jpeg *.heif *.avif *.jxl *.gif) do ( 
.\ffmpeg -i "%%~sa" -c:v libvvenc -vvenc-params mtprofile=0 -threads 32 -preset 4 -b:v 0 -qp 35 ".\output\%%~na.h266" 
) 
for %%a in (*.webm *.mkv *.mov *.avi *.rm *.rmvb *.flv) do ( 
.\ffmpeg -i "%%~sa" -sn -c copy -strict -2 "%%~na.mp4"
)
for %%a in (*.mp4) do ( 
.\ffmpeg -i "%%~sa" -vn -sn -c:a pcm_s32le -strict -2 -f wav -ac 2 - | .\exhale a ".\output\%%~na.m4a"
)
for %%a in (*.mp4) do ( 
.\ffmpeg -i "%%~sa" -an -sn -c:v libvvenc -vvenc-params mtprofile=0 -threads 32 -preset 4 -b:v 0 -qp 35 ".\output\%%~na.mp4"
)
for %%a in (.\output\*.mp4) do ( 
.\ffmpeg -i "%%~sa" -c:v copy ".\output\%%~na.vvc"
)
cd .\output\
echo ???Is the conversion normal???
pause
del *.mp4
for %%a in (*.vvc) do (
mp4box -add "%%a" -add "%%~na.m4a" -new "%%~na.mp4"
)
pause
del *.m4a
del *.vvc
echo !!!Conversion completed!!!
pause
jiangzemin-xudamin commented 1 month ago

Even so, I still want to thank you, after all, you have helped me solve many problems.

jiangzemin-xudamin commented 1 month ago

I'm now skeptical that official FFMPEG will update the VVENC version in time. Maybe I can download your compiled VVENCAPP and call it with "pipe". .\ffmpeg -i 1.mp4 -an -pix_fmt yuv420p10le -strict -2 -f yuv4mpegpipe - | .\vvencapp -i - --y4m --preset 4 -t 32 --qp 35 -c yuv420_10 -o 1.vvc

MartinEesmaa commented 1 month ago

Hi, @jiangzemin-xudamin! Thank you for more details information! :)

First of all, I have some bad news for you., since FFMPEG added support for VVC encoding, I deleted your modified FFMPEG from my hard disk. because the relatively newest version of FFMPEG compiled by gyan has libvvenc enabled by default, and it works well and with fewer bugs.

Yes, FFmpeg added libvvenc support and Gyan enabled feature on July 1st 2024, so you're welcome to delete my modified FFmpeg at any time. Also me and BtBn added support of libvvenc encoding too: https://github.com/BtbN/FFmpeg-Builds/commit/9b364761580b399266172956eed9778211b094a8

Remember... for using official FFmpeg still has experimental VVC decoding, so you have to pass it to add argument -strict -2, so my modified FFmpeg build has external VVC decoder available still. That's your choice.

Unfortunately, the xHE-AAC encoder is still not implemented in official FFMPEG, except for Mainconcept FFmpeg (--enable-omx_enc_xheaac), and I have to keep using exhale.

Well, yeah but only xHE-AAC native decoder has implemented to official FFmpeg, but no native encoder added it yet either Fraunhofer FDK-AAC too. Mainconcept FFmpeg plug in is still available to use in FFmpeg, meanwhile you can still use exhale which is free and open source.

I think the biggest problem with vvc right now is getting support from hardware vendors, maybe in the future there will be hardware encoders like "vvc_nvenc" or "vvc_qsv", Or someone will make a vvc codec program that uses OpenCL or CUDA graphics card acceleration.

Intel QSV VVC is now supported to official FFmpeg: https://github.com/FFmpeg/FFmpeg/commit/d30a9fdc809c90fa39549e7dc9f040824488999a

Only acceleration we got available is Intel... NVIDIA and AMD may come later soon...

In another decade or so, H.267 may appear, but I don't think its efficiency will be too much higher than H.266, information entropy has its limits.

I may don't know, but it's not gonna make much higher which may be develop for future next years or decade... I think they will be fine without making another again H.267 or could be possible...

Just for your claim about AV2 encoder might come later too for next two to four years... but libavif has experimental AV2 support...

See the information: https://www.phoronix.com/news/AVIF-Experimental-AV2

And commit merged: https://github.com/AOMediaCodec/libavif/commit/a900b0c053828f5918924b2e6f7267ec7e0631e3

If you have any question, feedback or issue, let me know! :) Thanks!

Sincerely, Martin Eesmaa

jiangzemin-xudamin commented 4 weeks ago

Hi,@MartinEesmaa ! Thank you for responding to my insights.

Intel QSV VVC is now supported to official FFmpeg

Yeah, I didn't think intel would supported to ffmpeg so soon, but only for Intel Xe² display units.

Just for your claim about AV2 encoder might come later too for next two to four years... but libavif has experimental AV2 support...

Having said that, the "Experimental. The AV2 specification is not finalized." and we need AV2 to handle video, not just single-frame images. . vp9 competes with H.264, AV1 competes with H.265, and AV2 will compete with H.266. I think AV2 may outperform or equal H.266 (after all, AV1 outperforms H.265 at 1080p resolution or low bitrates, but at 4K8K resolution, AV1 is even worse than H.265 in some scenes).