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 18th April 2018, 11:50   #121  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
Quote:
Originally Posted by lansing View Post
Oh gosh, please just simply number your test scripts, no one cares about what they call.

For the ringing problem, you'll need to go with some higher end resizer like nnedi3.

And it's pretty clear now that adding a shader on top gives the best visual effect for these retro games. As the main problems with these low resolution images are the pixelated diagonal lines and the lack of texture when upscaled, so you can't blur them because that will turn them into ugly color blocks. The vertical and gird shader looks like the answer here, as they both added fake details to "smooth" out the diagonal lines and added fake "textures" into the color blocks.
Oh gosh, please be nice and maybe a little more fun ! It's not more complicated with names than with numbers, because it follows a logic order. Besides, I think it's easier to recognize a script with a name

But thanks for the advice of the nnedi3 !

But I already used it, and it's not really an anti-ringing filter like MadVR uses The other problem is to begin a script with nnedi3. I never begin a script with this filter because the straight lines become distored. But it's true that it's good to clean the image

Otherwise, I just want to remind that I don't want scanlines or grids. Il will tell you why. It's because in the old times, even if we have these kinds of picture with the CRT display, it was always when we were close to the screen, but never at a certain distance. And personnally, I never glued my nose to the screen

So I think, this passion for the scanlines and grids are a bit too exagerated. To a certain distance, the old CRT displays delivered a normal and clean picture I think. I never had the souvenirs of having seen scanlines at this time.

But you can post your experimentations here. It's always interesting and I think it's the good subject for this Long live diversity !


Quote:
Originally Posted by raffriff42 View Post
Very clear description of why the shader effect looks good!

Which gives me an idea! Suppose we emulate the shader by
  1. smoothly sizing to 1/4 or 1/2 of the final size, then pixel sizing the rest of the way (to retain some jagginess);
  2. de-registering the RGB colors slightly (to imitate the phosphor arrangement); and
  3. superimposing a black grid pattern?
I already have a grid pattern generator function, made years ago (part of an attempt to recreate NTSC dot crawl artifacts). The grids are not exactly like the shader grids, but they might be close "enough."





Code:
LoadPlugin("<path>\PointSize_x64.dll")

## (source RGB32)

xBRZ(2) 
Org = Last

Org
GaussResize(1408, 1080, p=70)
ConvertToYV24
gridmask_square(2)
ConvertToRGB32
Trim(0, length=1)
Loop(Org.FrameCount)
Dots = Last

Org
GaussResize(1408/4, 1080/4, p=70)
PointResize(1408, 1080)
ShiftRedBlue(rx = -2, bx = +2)
Overlay(Dots, mode="darken", opacity=0.25)
Levels(0, 1.0, 255-64, 0, 255, coring=false)

ConvertToYV12(matrix="Rec709")
return Last

# https://forum.doom9.org/showthread.php?p=1803247#post1803247
##################################
### shift and/or resize Red and Blue relative to Green
##
## @ rx, ry, bx, by     - "shift" red & blue position
## @ rxd, ryd, bxd, byd - "delta" width & height
##
function ShiftRedBlue(clip C, 
\           float "rx", float "ry", 
\           float "bx", float "by",
\           float "rxd", float "ryd", 
\           float "bxd", float "byd")
{
    Assert(C.IsRGB, 
    \   "ShiftRedBlue: source must be RGB")
    rx  = Float(Default(rx,  0))
    ry  = Float(Default(ry,  0))
    bx  = Float(Default(bx,  0))
    by  = Float(Default(by,  0))
    rxd = Float(Default(rxd, 0))
    ryd = Float(Default(ryd, 0))
    bxd = Float(Default(bxd, 0))
    byd = Float(Default(byd, 0))
    C
    return (C.IsRGB24)
    \ ? MergeRGB(
    \     ShowRed.Spline64Resize(Width, Height, -rx, -ry, Width-rxd, Height-ryd)
    \   , ShowGreen
    \   , ShowBlue.Spline64Resize(Width, Height, -bx, -by, Width-bxd, Height-byd)
    \   )
    \ : MergeARGB(
    \     ShowAlpha
    \   , ShowRed.Spline64Resize(Width, Height, -rx, -ry, Width-rxd, Height-ryd)
    \   , ShowGreen
    \   , ShowBlue.Spline64Resize(Width, Height, -bx, -by, Width-bxd, Height-byd)
    \   )
}

## http://forum.doom9.org/showthread.php?t=170433
#######################################
### create a fixed pattern of dots.
function gridmask_square(clip C, int size)
{
    C
    return mt_logic(
    \   mt_lutspa(mode="absolute", chroma="-128",
    \             expr="x "+String(size)+" / pi * cos 108 * 126 + "),
    \   mt_lutspa(mode="absolute", chroma="-128",
    \             expr="y "+String(size)+" / pi * cos 108 * 126 + "),
    \  "andn")
}

Thanks to share your ideas and your experimentations ! It's always very (very very) interesting and enriching !

But as I said to lansing, I don't want scanlines or grids, but I love to see the knowledge you share

Let's say that my idea is rather to rethink the original picture, imitate a kind of old feeling, but keep a maximum quality.

It's like a remastering the idea !

Last edited by SuperLumberjack; 18th April 2018 at 12:03.
SuperLumberjack is offline   Reply With Quote
Old 18th April 2018, 12:14   #122  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
I'm just posting ideas that interest me. You can use them, or not use them, or take parts of them and leave other parts out! It's your video!

Last edited by raffriff42; 18th April 2018 at 13:28. Reason: :)
raffriff42 is offline   Reply With Quote
Old 18th April 2018, 12:34   #123  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
Quote:
Originally Posted by raffriff42 View Post
I'm just posting ideas that interest me. You can use them, or not use them, or take parts of them and leave other parts out! It's your video!
Yes, I have no problem with this ! As I said, it's always interesting and inspiring !
SuperLumberjack is offline   Reply With Quote
Old 18th April 2018, 13:54   #124  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 6,674
Quote:
So I think, this passion for the scanlines and grids are a bit too exagerated. To a certain distance, the old CRT displays delivered a normal and clean picture I think. I never had the souvenirs of having seen scanlines at this time.
No They don't! You clearly forgot about color bleeding effect (bloom). Games on CRT have never been pixel perfect even from distance.
Atak_Snajpera is offline   Reply With Quote
Old 18th April 2018, 17:09   #125  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
You didn't understand me. I never said it was pixel perfect. I only said that from a certain distance, we didn't notice the scanlines. It looked almost clean, not like some filters with scanlines or grids
SuperLumberjack is offline   Reply With Quote
Old 18th April 2018, 17:35   #126  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
I still did just one last script, but I start from a new beginning, with another logic : just remaster the image !

It was just for the fun ! This time, I didn't care about old feeling ! I just remastered !

I compared the image of my script with a screenshot from an emulator called Higan (one of the most precise) to see if what I did was what I want :


https://media.joomeo.com/original/5adbc4752e8da.png

And I compare with a video which shows different versions of the game "Mr. Nutz", but played on a CRT display : https://www.youtube.com/watch?v=mh3KWHrwvhE


https://media.joomeo.com/original/5adbc4bc33ef2.png

In any case, I find that it's magic ! So I called it "Magic" !


Script for magic style with 8:7 aspect ratio :

Quote:
AviSource()
Spline16Resize(5120, 1920)
GaussResize(2560, 1920, p=50)
nnedi3_rpow2(rfactor=2, nsize=0, nns=4, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=0)
BicubicResize(2468, 2160)

https://media.joomeo.com/original/5adbc52d1fb13.png


Script for magic style with 4:3 aspect ratio :

Quote:
AviSource()
Spline16Resize(5120, 1920)
GaussResize(2560, 1920, p=50)
nnedi3_rpow2(rfactor=2, nsize=0, nns=4, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=0)
BicubicResize(2820, 2160)

https://media.joomeo.com/original/5adbc589dda6b.png


raffriff42 inspired me with his script and the GaussResize !

Thanks !

Last edited by SuperLumberjack; 22nd April 2018 at 00:17. Reason: I replaced the "remastering" script by the "magic" script
SuperLumberjack is offline   Reply With Quote
Old 18th April 2018, 19:07   #127  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,001
Quote:
Originally Posted by SuperLumberjack View Post
Oh gosh, please be nice and maybe a little more fun ! It's not more complicated with names than with numbers, because it follows a logic order. Besides, I think it's easier to recognize a script with a name
You're just confusing everybody with those names. And I found no logic between "ultimate style - clean version" and "ultimate style - new vintage" whatsoever, what do they even mean?

Quote:
Originally Posted by SuperLumberjack View Post
But thanks for the advice of the nnedi3 !

But I already used it, and it's not really an anti-ringing filter like MadVR uses The other problem is to begin a script with nnedi3. I never begin a script with this filter because the straight lines become distored. But it's true that it's good to clean the image
I read your earlier posts, those are not straight lines, those are just single-pixels. And you don't need deringing filter because nnedi3 doesn't produces ringing. The ringing problem you have on your images came from the low quality resizers you used.

Quote:
Originally Posted by SuperLumberjack View Post
Otherwise, I just want to remind that I don't want scanlines or grids. Il will tell you why. It's because in the old times, even if we have these kinds of picture with the CRT display, it was always when we were close to the screen, but never at a certain distance. And personnally, I never glued my nose to the screen

So I think, this passion for the scanlines and grids are a bit too exagerated. To a certain distance, the old CRT displays delivered a normal and clean picture I think. I never had the souvenirs of having seen scanlines at this time.
The scanlines had always been there in the old CRT TV, you just don't see them because of the low resolution.

Quote:
Originally Posted by SuperLumberjack View Post
Let's say that my idea is rather to rethink the original picture, imitate a kind of old feeling, but keep a maximum quality.

It's like a remastering the idea !
If that is your goal then I think you can just simply achieved that by changing your window resolution to 640 x 480.
lansing is offline   Reply With Quote
Old 18th April 2018, 19:37   #128  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
Quote:
Originally Posted by lansing View Post
You're just confusing everybody with those names. And I found no logic between "ultimate style - clean version" and "ultimate style - new vintage" whatsoever, what do they even mean?
Why am I confusing you with these names, while in any case you don't like my scripts, because there are nos scanlines ?

Besides, I shared a playlist with the videos of all my scripts and wrote them in their description : https://www.youtube.com/playlist?lis...W3G7DVYqx9NhoT


Quote:
Originally Posted by lansing View Post
I read your earlier posts, those are not straight lines, those are just single-pixels. And you don't need deringing filter because nnedi3 doesn't produces ringing. The ringing problem you have on your images came from the low quality resizers you used.
On this picture, you can see the problem of the Nnedi3 filter with straight lines (in red) :



These distorsions aren't in the original picture. They disappear if I put the Nnedi3 filter after another one.


Quote:
Originally Posted by lansing View Post
The scanlines had always been there in the old CRT TV, you just don't see them because of the low resolution.
Yes, the scanlines had always been there, but from a certain distance, we can't see them. It's what I said

It's why I don't want them in my upscaling. Only if it's very very subtle... eventually !


Quote:
Originally Posted by lansing View Post
If that is your goal then I think you can just simply achieved that by changing your window resolution to 640 x 480.
This is not my idea of a remastering ! It means to be adapted to a modern HD display I think, not an old CRT display. Open your mind lansing !

I already played all this old games on a CRT display and I will keep excellent souvenirs from them. But now, it's another time
SuperLumberjack is offline   Reply With Quote
Old 18th April 2018, 21:11   #129  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,001
Quote:
Originally Posted by SuperLumberjack View Post
Why am I confusing you with these names, while in any case you don't like my scripts, because there are nos scanlines ?

Besides, I shared a playlist with the videos of all my scripts and wrote them in their description :
https://www.youtube.com/playlist?lis...W3G7DVYqx9NhoT
There're no meaning in those names and they doesn't follow logical orders. Numbering them makes logical order because it tells people what came first.

Quote:
Originally Posted by SuperLumberjack View Post
On this picture, you can see the problem of the Nnedi3 filter with straight lines (in red) :

These distorsions aren't in the original picture. They disappear if I put the Nnedi3 filter after another one.
In the original image, those areas were just single-dot pixels, they were not a representation of straight lines. They were pixels that were connected to form a shape, in this case, a curve. Nnedi3 connected these pixels by smoothing them so you don't see jagged diagonal lines.

Quote:
Originally Posted by SuperLumberjack View Post
Yes, the scanlines had always been there, but from a certain distance, we can't see them. It's what I said

It's why I don't want them in my upscaling. Only if it's very very subtle... eventually !
I have never said to use a scanline shader either because it looks bad on motion.

Quote:
Originally Posted by SuperLumberjack View Post

This is not my idea of a remastering ! It means to be adapted to a modern HD display I think, not an old CRT display. Open your mind lansing !

I already played all this old games on a CRT display and I will keep excellent souvenirs from them. But now, it's another time
You're not going to get a HD remastering out of a 300 x 200 source. If you're to upscale it 6x, you're going to have to deal with chunks of ugly color blocks and jagged diagonal lines. The only reasonable way to do is to hide them with shaders.
lansing is offline   Reply With Quote
Old 18th April 2018, 21:53   #130  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
Quote:
Originally Posted by lansing View Post
There're no meaning in those names and they doesn't follow logical orders. Numbering them makes logical order because it tells people what came first.
I remember that you said that you don't see any difference between all my screenshots. And here, I give you a playlist with all the videos of my scripts, which are in order and where you can see (maybe) the differences, but you are still not satisfied...


Quote:
Originally Posted by lansing View Post
In the original image, those areas were just single-dot pixels, they were not a representation of straight lines. They were pixels that were connected to form a shape, in this case, a curve. Nnedi3 connected these pixels by smoothing them so you don't see jagged diagonal lines.
I'm ok with what you say, but in the original picture, it was straight !

PointResize X4



Nnedi3 X4




Quote:
Originally Posted by lansing View Post
I have never said to use a scanline shader either because it looks bad on motion.
Ok. We agree !


Quote:
Originally Posted by lansing View Post
You're not going to get a HD remastering out of a 300 x 200 source. If you're to upscale it 6x, you're going to have to deal with chunks of ugly color blocks and jagged diagonal lines. The only reasonable way to do is to hide them with shaders.
I know. It's just a word that I used to make you understand what is my goal. I don't expect miracles !

Last edited by SuperLumberjack; 22nd April 2018 at 00:19.
SuperLumberjack is offline   Reply With Quote
Old 19th April 2018, 00:24   #131  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
Here is the video of my last script that I called "Magic style" : https://youtu.be/CHXsyhBZJ5g

In fact, I love my new script !

It's close to what I wanted !

I remind you that I shared some of the original videos, if you want to test with you own scripts : https://mega.nz/#!K5FRlJhb!pKqQ06WOn...yGiozQuikkk77A

Last edited by SuperLumberjack; 25th April 2018 at 20:30. Reason: I replaced the "remastering" script by the "magic" script
SuperLumberjack is offline   Reply With Quote
Old 19th April 2018, 00:33   #132  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
Just a question ! Does anybody know how to circumvent this error please ?



I got this with a script with high resolutions, but think it's just a limitation of AviSynth, not a material limitation, so there must be a way !

Thanks for you help !

Last edited by SuperLumberjack; 22nd April 2018 at 00:23.
SuperLumberjack is offline   Reply With Quote
Old 19th April 2018, 02:18   #133  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,001
Quote:
Originally Posted by SuperLumberjack View Post
Here is the video of my last script that I called "Remastering style" : https://youtu.be/Mb0YFEbf_7g

In fact, I love my new script !

It's close to what I wanted !

I remind you that I shared some of the original videos, if you want to test with you own scripts : https://mega.nz/#!X59ijIKR!QwVlLwNnQ...QovwFhZP2ErqhU
Your script is wrong. The power of nnedi3 on upscale is its quality, so it is pointless to use it on a 2560x1920 clip. It has to be the first in your filter chain if you are to use it.

And the purpose of the upscale-then-downscale process is for the anti-aliasing effect, but since your videos are pixelated stuffs, it pretty much did nothing to the images.

Code:
AviSource()
Spline16Resize(5120, 1920)
GaussResize(2560, 1920, p=50)
nnedi3_rpow2(rfactor=2, nsize=0, nns=4, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=0)
BicubicResize(2468, 2160)
BicubicResize(2820, 2160)
lansing is offline   Reply With Quote
Old 19th April 2018, 02:30   #134  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,584
Quote:
Originally Posted by SuperLumberjack View Post
Just a question ! Does anybody know how to circumvent this error please ?
<snip>

I got this with a script with high resolutions, but think it's just a limitation of AviSynth, not a material limitation, so there must be a way !

Thanks for you help !

Are you using avisynth x86 ? If yes, then use x64
poisondeathray is offline   Reply With Quote
Old 19th April 2018, 06:39   #135  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
Maybe. In fact, I don't find the information

But I will try the x64 version if I have not Thanks for your help !
SuperLumberjack is offline   Reply With Quote
Old 19th April 2018, 11:00   #136  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
Quote:
Originally Posted by lansing View Post
Your script is wrong. The power of nnedi3 on upscale is its quality, so it is pointless to use it on a 2560x1920 clip. It has to be the first in your filter chain if you are to use it.

And the purpose of the upscale-then-downscale process is for the anti-aliasing effect, but since your videos are pixelated stuffs, it pretty much did nothing to the images.

Code:
AviSource()
Spline16Resize(5120, 1920)
GaussResize(2560, 1920, p=50)
nnedi3_rpow2(rfactor=2, nsize=0, nns=4, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=0)
BicubicResize(2468, 2160)
BicubicResize(2820, 2160)
The screenshots that I posted about the effect of the Nnedi3 on straight lines was quite telling.

I just used that :

Quote:
AviSource()
nnedi3_rpow2(rfactor=4, nsize=0, nns=4, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=0)
SuperLumberjack is offline   Reply With Quote
Old 19th April 2018, 16:08   #137  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
Quote:
Originally Posted by poisondeathray View Post
Are you using avisynth x86 ? If yes, then use x64
I was looking for AviSynth 64 bits, but the only version that I found is the 2.5.8

Is there a more recent version ?

If not, what version have I to take please ?

Thanks for your help !
SuperLumberjack is offline   Reply With Quote
Old 19th April 2018, 17:20   #138  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 93
Here!

https://github.com/pinterf/AviSynthPlus/releases

It will only work with the x64 versions of AvsPmod / VirtualDub:

AvsPmod: https://forum.doom9.org/showpost.php...postcount=1202
VirtualDub: https://sourceforge.net/projects/vdfiltermod/

Last edited by magiblot; 19th April 2018 at 17:23.
magiblot is offline   Reply With Quote
Old 19th April 2018, 17:44   #139  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
OK. Thank you very much !

I just tried and I got a similar error :

"VirtualDub Error

Avisynth read error:
Could not allocate video frame. Out of memory. memory_max = 1073741824, memory_used = 495732537 Request=235929663"

But I will try with AvsPmod or the x64 version of AviSynth
SuperLumberjack is offline   Reply With Quote
Old 19th April 2018, 18:07   #140  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 223
It works with VirtualDub2 ! x64 You're the boss man !

Thank you so much magiblot !

I just had to copy the x64 version of the Nnedi3 plugin in the "plugins64+" folder of AviSynth, and it ran like a war machine !

You gave me hope ! I was effraid that I could never use this script. It's for another video with a resolution of 640x480

Original


https://media.joomeo.com/original/5adbc8270a2f0.png

Upscaled to 2160p


https://media.joomeo.com/original/5adbc8742f01c.png


Thanks to poisondeathray too !

Last edited by SuperLumberjack; 22nd April 2018 at 00:26.
SuperLumberjack is offline   Reply With Quote
Reply

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 05:07.


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