master-of-zen / Av1an

Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding
GNU General Public License v3.0
1.4k stars 147 forks source link

Add DGDecNV and BestSource chunk method #776

Closed Simulping closed 7 months ago

Simulping commented 11 months ago

As the title suggests, adds two new chunking methods to Av1an.

The docs is a bit general and could be worked on a bit since I don't really want to say anything that could be misinformation about the technical details. The current chunk method order now is: DGDecNV > lsmash > ffms2 > bestsource > hybrid

DGDecNV requires an external program called "dgindexnv" to index the video first, though its already bundled with the binaries and plugins itself provided, and as the name suggests, it requires an NVIDIA GPU. Which also requires PureVideo, but that's ancient technology so everyone should have it anyway. And only decodes AVC/HEVC/MPG/VC-1.

BestSource is similar to select, its slow but should decode everything

and from my observation and testing, both methods successfully "resolve" #745 here's a test clip where gray frames keep appearing: https://cdn.discordapp.com/attachments/587033245061873759/1126937326333997076/CutJJBA1-7.mkv

shssoichiro commented 11 months ago

Could you please run cargo fmt on your changes? The CI is complaining about the formatting, it seems.

shssoichiro commented 11 months ago

My biggest concern is that I've heard in the past there have been issues where hardware decoding of various codecs is not accurate. Is this something that should be taken into account?

Quackdoc commented 11 months ago

hwdec on a lot of devices is for sure not accurate a lot of times, that being said, having a super slim colorshift is probably a lot better then massive gray squares. IMO any hwdec should never be considered "accurate"

shssoichiro commented 11 months ago

I don't love having that as the default... but I'm not sure if there's a better option since lsmash kind of fails on VC1 and certain other codecs, and bestsource is really, really slow... I may brainstorm or google a bit when I have time.

Bl4cKn1gh7 commented 11 months ago

I also don't think that having DGDecNV as the default makes that much sense, as it's not like everyone has an Nvidia GPU on their system. That being said, I think it doesn't hurt to add it as long as any concerns are included in the help page of Av1an, e.g. not mathematically lossless, requires nvidia purevideo, etc.

I think it would be a good addition to help solve the grey frame problem, and if someone has hardware that they want to use, as long as they're aware of what the nuances are, they should be able to use it. As long as it doesn't create problems for the rest of the program of course.

Simulping commented 11 months ago

@shssoichiro @Bl4cKn1gh7 I'll restore the original order and edit the PR then, later

master-of-zen commented 7 months ago

we have a certified tabulation moment