View Full Version : Video have double edges and is too bright
kostek00
24th August 2013, 21:10
Hello, i have problem with one video. It has doubles edges and is too bright. Can you suggest what filters i can use to fix it even a little? If you can, please, write how to use those filters.
Screens:
http://oi43.tinypic.com/207xsw3.jpg
http://oi42.tinypic.com/14ybbs0.jpg
http://oi41.tinypic.com/1zp5tar.jpg
Guest
24th August 2013, 22:21
Looks like someone already goofed it up. What is the source material and where did you get it?
kostek00
24th August 2013, 22:59
It's my DVD and it's untouched. Well, at least untouched by me.
LoRd_MuldeR
24th August 2013, 23:47
Please provide a short clip of the original unprocessed DVD source. You can use DGIndex (http://neuron2.net/dgmpgdec/dgmpgdec.html) for that purpose.
kostek00
25th August 2013, 00:11
Here you have, 1 uncompressed sample (http://www.mediafire.com/download/2y6wt2452d8q98e/clip.m2v).
creaothceann
25th August 2013, 11:14
You could maybe use a strong dehaloing filter to reduce the artifacts a bit, but that could do only so much...
Apart from that there's the usual IVTC (I'm assuming you have a NTSC DVD):
FFVideoSource("00.m2v", fpsnum=30000, fpsden=1001)
DeDot(luma2d=20, lumaT=20, chromaT1=0, chromaT2=255)
AnimeIVTC(mode=1, ifade=true, killcomb=2)
DeRainbow
TemporalDegrain
kostek00
25th August 2013, 12:13
You could maybe use a strong dehaloing filter to reduce the artifacts a bit, but that could do only so much...
Apart from that there's the usual IVTC (I'm assuming you have a NTSC DVD):
FFVideoSource("00.m2v", fpsnum=30000, fpsden=1001)
DeDot(luma2d=20, lumaT=20, chromaT1=0, chromaT2=255)
AnimeIVTC(mode=1, ifade=true, killcomb=2)
DeRainbow
TemporalDegrain
Can you pack and send me every plugins needed for this script? Because my versions apparently are wrong.
creaothceann
25th August 2013, 13:03
Almost all should be available from External Filters (http://avisynth.org/mediawiki/External_filters) / Warp Enterprises (http://avisynth.org/warpenterprises/).
FFmpegSource (http://avisynth.org/mediawiki/FFmpegSource)
DeDot (http://nullinfo.s21.xrea.com/#DeDot_YV12) / manual (http://forum.doom9.org/showthread.php?t=84967) / info (http://www.aquilinestudios.org/avsfilters/dotcrawl.html#dedot)
AnimeIVTC (http://forum.doom9.org/showthread.php?t=138305)
DeRainbow (http://www.animemusicvideos.org/forum/viewtopic.php?p=1264945)
TemporalDegrain (http://avisynth.org/mediawiki/Temporal_Degrain)
cretindesalpes
25th August 2013, 15:40
For the double edges and the brightness, add this:
smo = mt_convolution (horizontal="1 2 1", vertical="1", u=2, v=2)
dha = dehalo_alpha (ry=1)
sp1 = dha.PointResize (Width (), Height (), +1)
sm1 = dha.PointResize (Width (), Height (), -1)
shrp = mt_logic (sp1, sm1, "max").MergeChroma (last)
Merge (shrp, smo)
SmoothLevels (0, 1, 255, 16, 235) # Or encode it with PC-range flag
SeeSaw ()
kostek00
25th August 2013, 16:41
Thank you guys for help, especially you cretindesalpes, your script worked like a charm. Can you tell me one more thing? Which part is responsible for brightness? Because i don't want blindly mess with it. Is it only "SmoothLevels (0, 1, 255, 16, 235)"?
qwerty1983
25th August 2013, 19:16
For the double edges and the brightness, add this:
If you have some free time could you please analyse(explain) your scrip line by line? Thank you.
cretindesalpes
25th August 2013, 21:13
smo = mt_convolution (horizontal="1 2 1", vertical="1", u=2, v=2)
It was my first attempt. It’s just a horizontal blur. The sharp vertical double lines white/black/white/black/white become something like light grey/grey/grey/grey/light grey. It hides the “double” artefact but now it looks quite blurry, the lines are thick and flat. I tried some other coefficient combinations but this one gave the most pleasing result.
dha = dehalo_alpha (ry=1)
sp1 = dha.PointResize (Width (), Height (), +1)
sm1 = dha.PointResize (Width (), Height (), -1)
shrp = mt_logic (sp1, sm1, "max").MergeChroma (last)
Second attempt. I tried to do something for the blurriness. Intuitively, you could think that overlaying two copies of the pictures, one shifted by two pixels, you could make the two replicas of the doubled lines overlap and create a stronger version of this line. This is true for the parts that overlap, but unfortunately there are also the parts that don’t overlap, and we now have a triple line! The middle line being stronger than the others. Actually this is what you obtain by replacing "1 2 1" with "1 0 1" in the first attempt.
Anyway we can notice that most of these sharp double lines are dark on a light background. We can take an advantage of this by changing the combination mode: instead of just averaging the tho pictures, we’re going to keep the lighter of them, pixel by pixel. So when both parts of the line overlap, we keep the line, and when a line overlap with a background, we keep the background.
The goal of the PointResize is to create the replicas, each shifted from one pixel to the left and to the right (so we keep the result centered). There is no actual resize, just a pixel shift. Then we combine both with mt_logic "max". But first, we try to reduce the horrible halos with dehalo_alpha(). This has a positive impact on this processing path. With the first attempt, it was not necessary, because dehalo_alpha() somewhat blurs the edges and we don’t want to go too far.
The result is still not very satisfactory, now our lines are too thin and the assumption we made caused lots of artefacts in places where it is not verified.
Merge (shrp, smo)
But when averaged, our smooth and sharp results hide each other their artefacts.
SmoothLevels (0, 1, 255, 16, 235) # Or encode it with PC-range flag
This is the code adjusting the brightness. It’s not clear if the source was PC-levels or not (probably not actually), but a Histogram() shows a large amount of pixels out of the TV-range (16–235 for the conventional black and white). Converting from PC to TV range looks much better anyway. You can probably increase the “0” of the source range to make sure the black stays black.
SeeSaw ()
Finally, we sharpen to compensate the overall blurriness. Again, you can tweak the settings to your taste.
kostek00
25th August 2013, 23:48
Thanks for explanation.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.