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

How to compress audio streams and video streams better? #41

Closed jiangzemin-xudamin closed 4 months ago

jiangzemin-xudamin commented 4 months ago

Hello Martin. I've recently planned to compress the 4K version of 《Tears of Steel》,I've programmed some commands,Can you suggest some improvements to these commands?

. \ffmpeg_vvceasy -i tearsofsteel-surround.flac -threads 32 -ac 2 -c:a libfdk_aac -profile:a aac_he_v2 -vbr 1 tos.aac

. \ffmpeg_vvceasy -i tearsofsteel-4k.y4m -threads 32 -c:v libvvenc -preset 4 -b:v 0 -qp 35 tos.vvc

mp4box -add tos.vvc -add tos.aac -new Tears_Of_Steel_4k.mp4

I searched the Internet for relevant information and found that HE-AAC V2 supports a minimum of 32Kbps dual-channel audio, so I had to switch the 5.1 channel to dual-channel and set vbr to 1

https://trac.ffmpeg.org/wiki/Encode/AAC

屏幕截图 2024-02-09 160254 屏幕截图 2024-02-09 160346

屏幕截图 2024-02-09 160450

jiangzemin-xudamin commented 4 months ago

My girlfriend messed with my computer and I had to recompress the video.

I've changed my mind now, and changed the QP value of the video stream to 31, because the 35 effect is a bit blurry, and it might be better to change it to 31.When QP is set to 31, the picture detail is partially blurred but does not disappear; however, when QP is set to 32 and above, the detail partially disappears.

as for the audio stream, it stays the same, and I can't really hear the difference, except when the bitrate is equal to or lower than 12kbps, when I can still hear the difference.

jiangzemin-xudamin commented 4 months ago

New question, how do I mix a VVENC video stream in MKV format? I'm trying to insert a subtitle file, which is known not to be supported by FFMPEG and MKVToolNix.

jiangzemin-xudamin commented 4 months ago

屏幕截图 2024-02-12 174828

屏幕截图 2024-02-12 175138
jiangzemin-xudamin commented 4 months ago

Unfortunately, the FFMPEG you modified doesn't seem to support xHE-AAC encoding, and the "EZ CD Audio Converter" you recommended is a commercial software, which I don't like.

jiangzemin-xudamin commented 4 months ago

xHE-AAC is better than HE-AAC V2

屏幕截图 2024-02-17 084656 屏幕截图 2024-02-17 084827
MartinEesmaa commented 4 months ago

Hi, @jiangzemin-xudamin!

Sorry for my busy hard work outside my home. Anyway...

HE-AACv2 is only supported stereo channel, VBR 1-3 and minimum constant 32kbps, so you are correct. VBR will make good audio quality like you selected VBR 1.

I've programmed some commands,Can you suggest some improvements to these commands?

I can suggest commands for improvement and also changes if possible: 1st command: The afterburner is already on default to improve quality. When selecting HE-AACv2, this can save efficiency for like 5-10% percent than HE-AAC. 2nd command: You can improve using vvenc-params for special options, see the vvencffapp --fullhelp. Example: ffmpeg_vvceasy -i test.mp4 -c:v libvvenc -qp 20 -b:v 0 -vvenc-params "CIIP=1:IntegerET" result.mp4. 3rd command: You can simply for adding +, if you wish like for it. Also you can still add subtitle for mp4box. Example: mp4box -add tos.vvc+tos.aac+subtitle.srt -new Tears_Of_Steel_4k.mp4.

New question, how do I mix a VVENC video stream in MKV format? I'm trying to insert a subtitle file, which is known not to be supported by FFMPEG and MKVToolNix.

I might have a look later for forcing add Matroska support for RIFF C source code of my FFmpeg forked repository.

Unfortunately, the FFMPEG you modified doesn't seem to support xHE-AAC encoding, and the "EZ CD Audio Converter" you recommended is a commercial software, which I don't like.

FFmpeg doesn't have officially xHE-AAC encoding support, but MainConcept FFmpeg xHE-AAC encoder of their modified FFmpeg has available: https://github.com/MainConcept/mc-ffmpeg-omx/tree/omx_6.0_public_3.0. To encode via Mainconcept xHE-AAC plugin via modified FFmpeg, you can try demo (for free) or you can actually pay via MainConcept website to get xHE-AAC encoder license for 79 USD dollars, otherwise it may fail.

I leave here more information for you about MainConcept xHE-AAC encoder via modified FFmpeg. https://www.mainconcept.com/ffmpeg https://www.mainconcept.com/hubfs/PDFs/Datasheets/FFmpeg%20-%20xHE-AAC%20Encoder_2021.pdf

Also EZ CD Audio Converter can encode Fraunhofer IIS Pro (proprietary library) and even Exhale USAC encoder for xHE-AAC, but it is trial period allows 21 days until you can buy the key for 39.95 EUR.

You can use alternatively Exhale xHE-AAC encoder of open source: https://gitlab.com/ecodis/exhale

Feel free to reply or/and questions to me. Thank you! :)

jiangzemin-xudamin commented 4 months ago

To encode via Mainconcept xHE-AAC plugin via modified FFmpeg, you can try demo (for free) or you can actually pay via MainConcept website to get xHE-AAC encoder license for 79 USD dollars, otherwise it may fail.

That's the downside of closed source coding, and I hope that someday a similar EnCodec encoding will beat xHE-AAC in compatibility.

You can use alternatively Exhale xHE-AAC encoder of open source

Hmmm ...... I have no experience compiling software

jiangzemin-xudamin commented 4 months ago

3rd command: You can simply for adding +, if you wish like for it. Also you can still add subtitle for mp4box.

I thought Matroska was the only one that supported subtitles, but I didn't realize that MP4 does too!