Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th September 2009, 20:35   #1  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Flickering Problems with DVD

Hello,

I've been trying to re-encode a DVD of mine and a couple scenes throughout the movie have this weird "flickering" present (to be honest, I'm not even sure if that's the actual name of it, but it sure looks like flickering). I've run Deflicker() on the 3 scenes and it seems to have helped a little bit, but the flickering isn't completely gone. I also tried wdeflicker() and it seems to give superior results on the 1st scene but leaves behind "horizontal lines" as artifacts. And on the 2nd and 3rd scene its debatable which one gives better results. I was wondering if you guys had any ideas on how to tackle this sort of thing? Any advice is appreciated.

Here are the 3 (untouched) scenes:

http://www.sendspace.com/file/hlohzl (2MB)
http://www.sendspace.com/file/rpk9mj (8MB)
http://www.sendspace.com/file/nfm08c (16MB)

Thanks.
canuckerfan is offline   Reply With Quote
Old 12th September 2009, 20:06   #2  |  Link
EuropeanMan
Registered User
 
Join Date: Nov 2006
Posts: 660
Can someone please advise as I'm having the same issues...thank you.
EuropeanMan is offline   Reply With Quote
Old 14th September 2009, 15:05   #3  |  Link
Who Am I ?
x264 Fanatic !
 
Who Am I ?'s Avatar
 
Join Date: Mar 2009
Location: Earth I guess ?
Posts: 36
Well its too ugly , it actually makes me doesnt even want to touch it .

FFT3D / removegrain / mvtools2() / cpu=6 are too brutal and hardcore on this as it is already bitrate starved and they kill the details for my liking , i ran a simple degrainmedian . I've also overcropped by 2 pixels on each side .

For the cleaning all i did was MSU Deblocking 2.2 (http://compression.ru/video/deblocking/index_en.html) and stab() (http://avisynth.org/mediawiki/Stab) and its doing a better job then depanestimate().despot() or dejitter() imho .

( let me know if you need help loading the vdub filters into avisynth )

The deinterlacing is screwed as well as it is seemingly double hard telecine ( i just ran what megui suggested even though i know its screwed ) (
tfm(order=1).tdecimate(hybrid=1).vinverse() ) , it gives ghosting and what not , i cannot be bothered to annoy myself on that. Probably deint masking + nnedi or something like that would be better + a stablizer .

Frame 3 :



Frame 95 :



Frame 94 .. ( Scary ) :




I actually like my beaches a bit more greener ..





dil chahta hai actually made me a bit nostalgic

Last edited by Who Am I ?; 14th September 2009 at 15:11.
Who Am I ? is offline   Reply With Quote
Old 14th September 2009, 17:21   #4  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
^I already got the the deinterlacing part down packed. TIVTC+yadifmod+nnedi2 was able to handle the movie pretty well. it's just these 3 scenes that have this "flickering" problem that I'm having trouble controlling. Thanks for the suggestions.
canuckerfan is offline   Reply With Quote
Old 14th September 2009, 20:24   #5  |  Link
Who Am I ?
x264 Fanatic !
 
Who Am I ?'s Avatar
 
Join Date: Mar 2009
Location: Earth I guess ?
Posts: 36
Quote:
Originally Posted by canuckerfan View Post
^I already got the the deinterlacing part down packed. TIVTC+yadifmod+nnedi2 was able to handle the movie pretty well. it's just these 3 scenes that have this "flickering" problem that I'm having trouble controlling. Thanks for the suggestions.
Well the flicker is more evident due too the pixelation/bitrate starvation .. i'd be more interested in denoising this properly as that seems pretty tough for such a long movie on an xvid/x264/dvdr encode , how long was it ? 3 hours + yes ?

good luck with the compressibility
Who Am I ? is offline   Reply With Quote
Old 14th September 2009, 23:26   #6  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Quote:
Originally Posted by Who Am I ? View Post
Well the flicker is more evident due too the pixelation/bitrate starvation .. i'd be more interested in denoising this properly as that seems pretty tough for such a long movie on an xvid/x264/dvdr encode , how long was it ? 3 hours + yes ?

good luck with the compressibility
I don't think that's the case. There are other scenes in the movie which have been even more deprived of a good bitrate and they don't exhibit the same flickering that these scenes do. This isn't your typical overly-compressed scene. If you look at them frame-by-frame the brightness (luma?) fluctuates a good amount. I think this is what's causing the flickering.
canuckerfan is offline   Reply With Quote
Old 15th September 2009, 21:23   #7  |  Link
Who Am I ?
x264 Fanatic !
 
Who Am I ?'s Avatar
 
Join Date: Mar 2009
Location: Earth I guess ?
Posts: 36
Quote:
Originally Posted by canuckerfan View Post
I don't think that's the case. There are other scenes in the movie which have been even more deprived of a good bitrate and they don't exhibit the same flickering that these scenes do. This isn't your typical overly-compressed scene. If you look at them frame-by-frame the brightness (luma?) fluctuates a good amount. I think this is what's causing the flickering.
It indeed does , why not try a frequency controlling filter on different planes ? its a vague idea which just popped up , who knows might be worth it
Who Am I ? is offline   Reply With Quote
Old 16th September 2009, 19:00   #8  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
^I tried looking into what you suggested but I'm not sure exactly what you mean by "frequency controlling filter"... I also found msu_deflicker which is supposed to work very well but I believe it only takes in RGB colour space and I'd rather not change colour spaces. Looks like I'm kind of stuck

Although DeFlicker(scene=18) gives moderately good results that certainly helps the scenes. If I don't find anything else to alleviate the problem, I'm gonna go with this.
canuckerfan is offline   Reply With Quote
Old 18th September 2009, 09:39   #9  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
Okay, I toyed a bit with this one.

Shortly summed-up: using Deflicker is fine, but it benefits from a lil'bit of additional assistance.


First of, just for fun I made a small deflicker function. It is pretty simple, read "dumb", in that it just gathers the average luma of frames, smoothens that with temporalsoften, and applies the obtained difference to the original input:

Code:
o = last
screen   = mt_lutf(o,o,mode="average",yexpr="x",U=1,V=1) #.greyscale
screenTS = screen.temporalsoften(1,9,0,9,2).merge(screen,0.249).temporalsoften(2,5,0,5,2)
calmed   = o.mt_makediff(mt_makediff(screen,screenTS),U=2,V=2)
This worked reasonably. Compairing it to Deflicker() on this source, both results are very similar - couldn't spot obvious differences with the naked eye. (There's one minor issue with deflicker's result, read on.)

Then I noticed that some parts - especially the sky in scene1 - had *more* flicker after this processing than before. Examining the histograms, it can be seen that it's not the whole range of levels that flickers up-and-down. In fact, it's only the vast midrange that flickers, with the blacklevel and whitelevel keep being fixed.

So, the obvious thing to do was to make a simple brightness mask for the range that actually is concerned, and merge-in the deflickered result by that mask:

Code:
masky = o.mt_lut("x 32 < x 16 - 16 * x 204 > 255 204 x - abs 255 30 / * - 255 ? ?").removegrain(11,-1) #.greyscale
final = o.mt_merge(calmed,masky,U=2,V=2)
Now the result was better. The overall flicker is nicely reduced, and the dark&bright regions being without flicker from the start stay calm, too.

And, as far as "frame-wide" flicker is concerned, the story ends here. The remaining flicker can not be catched by such simple means, it's mostly a form of encoding artifacts, or something. To get that remaining flicker out, the way probably is to use a temporal denoiser. (MDegrain2 did a reasonable job, especially when the search clip is preprocessed by fft3dfilter with bt>=3.)

*****

The little thing that stroke me about Deflicker() is that it creates a result with spikes in the histogram, which indicates that there's some discontinuities in the output. Honestly, I could not spot anything with the naked eye, so probably it isn't serious. But OTOH, the histogram does not lie, so I thought I should mention it.

Full script for comparison:

Code:
mpeg2source("scene2.d2v")
crop(0,48,-0,-48)
tfm().tdecimate()

o = last
screen   = mt_lutf(o,o,mode="average",yexpr="x",U=1,V=1) #.greyscale
screenTS = screen.temporalsoften(1,9,0,9,2).merge(screen,0.249).temporalsoften(2,5,0,5,2)
calmed   = o.mt_makediff(mt_makediff(screen,screenTS),U=2,V=2)
deflk    = o.Deflicker()
masky    = o.mt_lut("x 32 < x 16 - 16 * x 204 > 255 204 x - abs 255 30 / * - 255 ? ?").removegrain(11,-1)

final_dumb = o.mt_merge(calmed,masky,U=2,V=2)
final_deflk = o.mt_merge(deflk,masky,U=2,V=2)

# comparisons ... arrange clips as you like
stackvertical( final_dumb.histogram("levels"), final_deflk.histogram("levels") )
# stackvertical( deflk.histogram("levels"), o.histogram("levels") )
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 18th September 2009, 15:41   #10  |  Link
rfmmars
Registered User
 
Join Date: Feb 2004
Posts: 743
Also MSU's deflicker will take it all out, tested on sence 3.vob. However this filter has problems with movie film flicker which is my business. Make a test with clip that has sence changes using defualt settings.

Richard
photorecall.net
rfmmars is offline   Reply With Quote
Old 18th September 2009, 15:43   #11  |  Link
Who Am I ?
x264 Fanatic !
 
Who Am I ?'s Avatar
 
Join Date: Mar 2009
Location: Earth I guess ?
Posts: 36
Quote:
Originally Posted by Didée View Post
Okay, I toyed a bit with this one.

Shortly summed-up: using Deflicker is fine, but it benefits from a lil'bit of additional assistance.


First of, just for fun I made a small deflicker function. It is pretty simple, read "dumb", in that it just gathers the average luma of frames, smoothens that with temporalsoften, and applies the obtained difference to the original input:

Code:
o = last
screen   = mt_lutf(o,o,mode="average",yexpr="x",U=1,V=1) #.greyscale
screenTS = screen.temporalsoften(1,9,0,9,2).merge(screen,0.249).temporalsoften(2,5,0,5,2)
calmed   = o.mt_makediff(mt_makediff(screen,screenTS),U=2,V=2)
This worked reasonably. Compairing it to Deflicker() on this source, both results are very similar - couldn't spot obvious differences with the naked eye. (There's one minor issue with deflicker's result, read on.)

Then I noticed that some parts - especially the sky in scene1 - had *more* flicker after this processing than before. Examining the histograms, it can be seen that it's not the whole range of levels that flickers up-and-down. In fact, it's only the vast midrange that flickers, with the blacklevel and whitelevel keep being fixed.

So, the obvious thing to do was to make a simple brightness mask for the range that actually is concerned, and merge-in the deflickered result by that mask:

Code:
masky = o.mt_lut("x 32 < x 16 - 16 * x 204 > 255 204 x - abs 255 30 / * - 255 ? ?").removegrain(11,-1) #.greyscale
final = o.mt_merge(calmed,masky,U=2,V=2)
Now the result was better. The overall flicker is nicely reduced, and the dark&bright regions being without flicker from the start stay calm, too.

And, as far as "frame-wide" flicker is concerned, the story ends here. The remaining flicker can not be catched by such simple means, it's mostly a form of encoding artifacts, or something. To get that remaining flicker out, the way probably is to use a temporal denoiser. (MDegrain2 did a reasonable job, especially when the search clip is preprocessed by fft3dfilter with bt>=3.)

*****

The little thing that stroke me about Deflicker() is that it creates a result with spikes in the histogram, which indicates that there's some discontinuities in the output. Honestly, I could not spot anything with the naked eye, so probably it isn't serious. But OTOH, the histogram does not lie, so I thought I should mention it.

Full script for comparison:

Code:
mpeg2source("scene2.d2v")
crop(0,48,-0,-48)
tfm().tdecimate()

o = last
screen   = mt_lutf(o,o,mode="average",yexpr="x",U=1,V=1) #.greyscale
screenTS = screen.temporalsoften(1,9,0,9,2).merge(screen,0.249).temporalsoften(2,5,0,5,2)
calmed   = o.mt_makediff(mt_makediff(screen,screenTS),U=2,V=2)
deflk    = o.Deflicker()
masky    = o.mt_lut("x 32 < x 16 - 16 * x 204 > 255 204 x - abs 255 30 / * - 255 ? ?").removegrain(11,-1)

final_dumb = o.mt_merge(calmed,masky,U=2,V=2)
final_deflk = o.mt_merge(deflk,masky,U=2,V=2)

# comparisons ... arrange clips as you like
stackvertical( final_dumb.histogram("levels"), final_deflk.histogram("levels") )
# stackvertical( deflk.histogram("levels"), o.histogram("levels") )
no one can be better then this

i'd blindly use what you suggest any given day
Who Am I ? is offline   Reply With Quote
Old 18th September 2009, 15:44   #12  |  Link
Who Am I ?
x264 Fanatic !
 
Who Am I ?'s Avatar
 
Join Date: Mar 2009
Location: Earth I guess ?
Posts: 36
Quote:
Originally Posted by rfmmars View Post
Also MSU's deflicker will take it all out, tested on sence 3.vob. However this filter has problems with movie film flicker which is my business. Make a test with clip that has sence changes using defualt settings.

Richard
photorecall.net
hmm it always did a good job for me on that as well , care to elaborate ?
Who Am I ? is offline   Reply With Quote
Old 18th September 2009, 17:07   #13  |  Link
rfmmars
Registered User
 
Join Date: Feb 2004
Posts: 743
Quote:
Originally Posted by Who Am I ? View Post
hmm it always did a good job for me on that as well , care to elaborate ?
The problem I have always had using it on my film capture footage is it would gray out when a change of sence took place. I have seen this on all of my six computer.

Richard
rfmmars is offline   Reply With Quote
Old 18th September 2009, 18:25   #14  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Thank you Didee for your input! It looks much better than deflicker.

rfmmars, I've uploaded the 3 scenes again but i've added a little more on the beginning and end of each so you can see the transitions. I hope this is what you wanted.

test (16MB)
test2 (8MB)
test3 (24MB)

And if it makes any difference I'm going to be using any solutions to theses problems only on those scene with conditional reader. That way only those scenes get processed. The only flickering scene that has flickering during scene changes as well is test.VOB.

Last edited by canuckerfan; 18th September 2009 at 18:28.
canuckerfan is offline   Reply With Quote
Old 18th September 2009, 22:14   #15  |  Link
rfmmars
Registered User
 
Join Date: Feb 2004
Posts: 743
Quote:
Originally Posted by canuckerfan View Post
Thank you Didee for your input! It looks much better than deflicker.

rfmmars, I've uploaded the 3 scenes again but i've added a little more on the beginning and end of each so you can see the transitions. I hope this is what you wanted.

test (16MB)
test2 (8MB)
test3 (24MB)

And if it makes any difference I'm going to be using any solutions to theses problems only on those scene with conditional reader. That way only those scenes get processed. The only flickering scene that has flickering during scene changes as well is test.VOB.
Thanks for the new clips........Yes, you will see this graying effect, though slight, with these clips. I encoded the clips and did a contrast expand as well as increased chroma. It still looks good but you see the problems just before and after scence changes. It seems that almost all MSU's filters need to be use with care, I used MSU Deflicker 1.3. It will be interesting to see how "Didee's" filter compares.

Richard
photorecall.net
rfmmars is offline   Reply With Quote
Old 19th September 2009, 00:11   #16  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Quote:
Originally Posted by rfmmars View Post
Thanks for the new clips........Yes, you will see this graying effect, though slight, with these clips. I encoded the clips and did a contrast expand as well as increased chroma. It still looks good but you see the problems just before and after scence changes. It seems that almost all MSU's filters need to be use with care, I used MSU Deflicker 1.3. It will be interesting to see how "Didee's" filter compares.

Richard
photorecall.net
Well what's keeping me from using MSU_Deflicker is that I'm encoding between lagarith files and converting colourspaces would mess up the colorimetry. And I would have to do this in order to use MSU_Deflicker. So I'd prefer not to use a vdub filter. But it's ok since Didee's function removes alot of the flickering.
canuckerfan is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.