NLMeans question

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
OstinatoFreak
Posts: 23
Joined: Tue Dec 13, 2016 2:38 pm

NLMeans question

Post by OstinatoFreak » Sat Oct 13, 2018 2:48 am

I am in the process of converting Walking Dead Blu-Ray rips to smaller sized backups. For those who don't remember or who haven't seen the show, I'd have to say Walking Dead is the GRAINIEST show I've ever seen. Various directors add film grain under the stupid illusion that their viewers actually like it, but in reality it's analogous to taking a perfectly clean audio recording and adding hiss all over the place to make people think the recording is somehow more authentic... ironically this is a very non-authentic, non-genuine thing to do to perfectly good film. When I watch Walking Dead in its original 1080p form, all I see are dancing pixels all over the screen. I can hardly even concentrate on the images sometimes because the dancing pixels are so absurd.

I've traditionally used hqdn3d smoothing filters to get rid of graininess, and it typically works. I'll use 2:2:3:4 with quality 21, 3:3:4:5 quality 22, 4:4:5:6 quality 23 and so on - this pattern usually works pretty well for keeping file sizes down. In fact, in my opinion, removing grain this way often makes the resulting picture look even better than the original.

But with Walking Dead, the graininess is just too much. I experimented with NLMeans (slows encoding down drastically, so I've been reluctant to use it), and it really surprised me that the setting that worked best wasn't "Grain," but instead "Film." (And I had to bump it all the way up to "strong" to actually make a real difference - you can still see graininess, but any stronger and I imagine it will start to remove some of the imagery along with the grain.)

I am hoping someone out there who intimately understands how the NLMeans filter settings work can explain to me why film works better than grain... and given this reality, what is the "grain" setting actually for?

To be clear, this is not a "support" issue - this is not a "trouble ticket." There is nothing wrong with Handbrake. I just want to understand it better in general terms, that's all.

Thanks!

mduell
Veteran User
Posts: 6191
Joined: Sat Apr 21, 2007 8:54 pm

Re: NLMeans question

Post by mduell » Sat Oct 13, 2018 4:14 am

So you were encoding a... specific... source and you ran into some... trouble... with a filter not working the way you expected, so you'd like some... support... to better understand why you got the result you did. But the encode logs showing what you used and what you did are a Big Secret, so you've made a general question unrelated to any specific trouble that needs support. I'll have to think through that one. :idea:
Last edited by mduell on Sat Oct 13, 2018 1:47 pm, edited 2 times in total.

User avatar
BradleyS
Moderator
Posts: 1427
Joined: Thu Aug 09, 2007 12:16 pm

Re: NLMeans question

Post by BradleyS » Sat Oct 13, 2018 5:01 am

Grain is for preserving grain, similar to how the x264 and x265 grain tunes work. Film or high motion are best for your situation.

To help further we'll need that activity log.

OstinatoFreak
Posts: 23
Joined: Tue Dec 13, 2016 2:38 pm

Re: NLMeans question

Post by OstinatoFreak » Sat Oct 13, 2018 7:36 am

Thanks so much Bradley, that was very helpful and all I needed to know. It's for *preserving* grain, not getting rid of it! Kind of funny how my distaste for grain tainted my understanding of the Handbrake setting without my even realizing: I went into it assuming that anyone selecting "grain" as a filtering setting would surely want to get rid of it, not preserve it!

I had already googled "Handbrake NLMeans" and found pages such as https://dirk-farin.net/projects/nlmeans/index.html, but couldn't find anything that discussed the filter settings.

User avatar
BradleyS
Moderator
Posts: 1427
Joined: Thu Aug 09, 2007 12:16 pm

Re: NLMeans question

Post by BradleyS » Sat Oct 13, 2018 8:39 am

I've not had sufficient time to flesh out the planned restoration and filtering section in the documentation. In the meantime, the original forum thread, while a bit dated now, is still available: viewtopic.php?f=4&t=30135

mduell
Veteran User
Posts: 6191
Joined: Sat Apr 21, 2007 8:54 pm

Re: NLMeans question

Post by mduell » Sat Oct 13, 2018 1:46 pm

OstinatoFreak wrote:
Sat Oct 13, 2018 2:48 am
To be clear, this is not a "support" issue - this is not a "trouble ticket." There is nothing wrong with Handbrake.
Problems with HB are rare among support threads.

OstinatoFreak
Posts: 23
Joined: Tue Dec 13, 2016 2:38 pm

Re: NLMeans question

Post by OstinatoFreak » Sun Oct 14, 2018 3:05 am

BradleyS wrote:
Sat Oct 13, 2018 8:39 am
I've not had sufficient time to flesh out the planned restoration and filtering section in the documentation. In the meantime, the original forum thread, while a bit dated now, is still available: viewtopic.php?f=4&t=30135
Holy cow! That's some good information. I think a whole week could be spent on this in a classroom setting. :o How wonderful it would be if there were Khan Academy videos on Handbrake going into maximum possible detail of what everything does, giving visual examples of everything. In my dreams...

I understand hqdn3d intimately, to the point where I can usually fabricate effective numbers myself on the first try. But I think it's going to be quite a while before I know NLMeans that well. Looks like it's going to be presets for me, at least for a while. I absorbed some of the information in the 15 minutes I spent reading it, but after a while it was just too much at once. I'll have to keep poking at it every now and then. But again, thanks for clearing up the one point of confusion on my part, misinterpreting what the term "grain" meant. It's kind of hard to experiment with settings when one has such a fundamental misunderstanding of core terminology. [Insert self-deprecating cross-eyed stupid emoji here]

Mduell - I'm a bit confused by both of your replies. The sarcasm of the first message still has me wondering what exactly you think I'm really here for, if you don't believe I'm here to understand Handbrake better. Did I do something wrong? Your second message doesn't seem like it applies, because again this wasn't a problem with Handbrake, and yes, I'd imagine problems with Handbrake are indeed rare in support threads given the extremely high quality of the software.

Post Reply