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.org/en/vvceasy
MIT License
145 stars 15 forks source link

[[BUG]]Your recent builds of FFmpeg VVCEasy have bug #49

Closed jiangzemin-xudamin closed 2 weeks ago

jiangzemin-xudamin commented 3 weeks ago

Describe the bug

05/06/2024: Updated FFmpeg with latest nightly, vvenc, vvdec and others.

Encoding vvenc does not work properly, it will abort and jump to the next line of command.

To Reproduce .\ffmpeg_vvceasy -i 1.mp4 -threads 32 -c:v libvvenc -preset 4 -b:v 0 -qp 35 -an -sn 2.mp4

Expected behavior Generates 1KB file and cannot be used

Screenshots

屏幕截图 2024-06-06 024455

Desktop (please complete the following information):

MartinEesmaa commented 3 weeks ago

Hello, @jiangzemin-xudamin. Thank you for sharing screenshot! :)

Encoding vvenc does not work properly, it will abort and jump to the next line of command. Generates 1KB file and cannot be used

Hmm, that's weird... :/. My current system works fine to encode of my latest FFmpeg custom build without issue for anything. It is kinda bug of every my FFmpeg custom builds when encoding VVC, but your previous was fine.

I think you cancelled the process encoding by hitting CTRL + C or the unexpected crash?

If you can share your H.264 video file of 2 seconds (1.mp4) over to this issue on GitHub or you can send an email to me at martin.eesmaa@protonmail.com

It takes bit encoding time normally, but it starts current showing 0kib from beginning until approximately 10 seconds encoded will show 256kib result and so on until hits EOF (end of file) and process is completed.

When you encode to VVC, the vvenc encoding will start but it won't report KiB until every approximately 10 seconds encoded will show a bitrate KiB numbers without 0 KiB standing stuck.

Feel free to reply or ask question to me. Thanks! :)

Regards

jiangzemin-xudamin commented 3 weeks ago

@MartinEesmaa I know the reason. The new version does not support 32 threads. It can only be used normally after changing to 16 threads.

MartinEesmaa commented 3 weeks ago

Hi, @jiangzemin-xudamin. Thank you for knowing the reason! :)

I found the solution, the problem was multi threading profile was added recently to vvenc: https://github.com/fraunhoferhhi/vvenc/commit/77574c7a60f8dc2ecd9e92eb7fdae271718a8e50#diff-eeeda5c283ddd8c9998302e0601cee097a07327291af00636295f6415d38e7d2

--mtprofile [auto] enable automatic multi-threading setting (enables tiles, IFP and WPP automatically depending on the number of threads)

When you're using 32 threads without customizing mtprofile, it crashes with automatic mtprofile is on. However to solve the problem, you need to add on FFmpeg:

-vvenc-params mtprofile=0

Complete example usage:

ffmpeg_vvceasy -i 1.mp4 -threads 32 -c:v libvvenc -preset 4 -vvenc-params mtprofile=0 -b:v 0 -qp 35 2.mp4

Any question or issue, feel free to let me know. Thanks! :)

Sincerely, Martin Eesmaa

jiangzemin-xudamin commented 2 weeks ago

Thanks! :) U R very good!!