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

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th August 2013, 21:10   #1  |  Link
kostek00
Registered User
 
kostek00's Avatar
 
Join Date: Mar 2013
Posts: 18
Video have double edges and is too bright

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
kostek00 is offline   Reply With Quote
Old 24th August 2013, 22:21   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Looks like someone already goofed it up. What is the source material and where did you get it?
Guest is offline   Reply With Quote
Old 24th August 2013, 22:59   #3  |  Link
kostek00
Registered User
 
kostek00's Avatar
 
Join Date: Mar 2013
Posts: 18
It's my DVD and it's untouched. Well, at least untouched by me.
kostek00 is offline   Reply With Quote
Old 24th August 2013, 23:47   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Please provide a short clip of the original unprocessed DVD source. You can use DGIndex for that purpose.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 25th August 2013, 00:11   #5  |  Link
kostek00
Registered User
 
kostek00's Avatar
 
Join Date: Mar 2013
Posts: 18
Here you have, 1 uncompressed sample.
kostek00 is offline   Reply With Quote
Old 25th August 2013, 11:14   #6  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 357
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):

Code:
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
creaothceann is offline   Reply With Quote
Old 25th August 2013, 12:13   #7  |  Link
kostek00
Registered User
 
kostek00's Avatar
 
Join Date: Mar 2013
Posts: 18
Quote:
Originally Posted by creaothceann View Post
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):

Code:
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.
kostek00 is offline   Reply With Quote
Old 25th August 2013, 13:03   #8  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 357
Almost all should be available from External Filters / Warp Enterprises.

FFmpegSource
DeDot / manual / info
AnimeIVTC
DeRainbow
TemporalDegrain

Last edited by creaothceann; 25th August 2013 at 13:10.
creaothceann is offline   Reply With Quote
Old 25th August 2013, 15:40   #9  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
For the double edges and the brightness, add this:
Code:
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 ()
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 25th August 2013, 16:41   #10  |  Link
kostek00
Registered User
 
kostek00's Avatar
 
Join Date: Mar 2013
Posts: 18
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)"?
kostek00 is offline   Reply With Quote
Old 25th August 2013, 19:16   #11  |  Link
qwerty1983
Registered User
 
Join Date: Mar 2013
Posts: 44
Quote:
Originally Posted by cretindesalpes View Post
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.
qwerty1983 is offline   Reply With Quote
Old 25th August 2013, 21:13   #12  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Code:
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.

Code:
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.

Code:
Merge (shrp, smo)
But when averaged, our smooth and sharp results hide each other their artefacts.

Code:
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.

Code:
SeeSaw ()
Finally, we sharpen to compensate the overall blurriness. Again, you can tweak the settings to your taste.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 25th August 2013, 23:48   #13  |  Link
kostek00
Registered User
 
kostek00's Avatar
 
Join Date: Mar 2013
Posts: 18
Thanks for explanation.
kostek00 is offline   Reply With Quote
Reply

Tags
avisynth, double edges, filter, too bright

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 00:35.


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