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 > VirtualDub, VDubMod & AviDemux

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th October 2018, 17:41   #701  |  Link
Morku
Registered User
 
Join Date: Jul 2012
Posts: 208
Quote:
Originally Posted by shekh View Post
And when you open cropping dialog, it is normal (not strange)? Btw how it is in strange way, may a screenshot show this?
I also received a somehow related ticket https://sourceforge.net/p/vdfiltermod/tickets/186/
Do you have Nvidia drivers?
Hi,
to describe the distortions, I think it's the best to show as a video. Depending where the window of VirtualDub is, the preview 'moves' and you can create that "winning solitair" effect (or crashing IE on windows95, you know...).
Check the video: https://www.dropbox.com/s/ri897y11tf...aldub.mp4?dl=0

What me also wonder, when I start the recoding, the distortions stops and the preview is fine. No matter which position of VirtualDub.

Yes, the Cropping windows is always fine. I can move around the window without issues.

Yes, I use NVIDIA GTX 980 Ti with 416.34
Morku is offline   Reply With Quote
Old 18th October 2018, 18:55   #702  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Quote:
Originally Posted by Morku View Post
Yes, I use NVIDIA GTX 980 Ti with 416.34
So maybe it is the same Nvidia issue and you can try older drivers?

The distortion looks really weird. You can also try display preferences (enable/disable "use directx" etc) to see if it has effect on this.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 19th October 2018, 17:12   #703  |  Link
Morku
Registered User
 
Join Date: Jul 2012
Posts: 208
I can confirm the reporting on sourceforge. I uninstalled the driver (Microsoft basic driver) and have Overlay Preview without issue. Also Preview (system) works fine.

I installed for testing 399.07 -> same issue like current driver
I tried 388.31 -> no issues anymore

Which display prefences do you mean? Nvidia settings? in VirtualDub? Windows?
Morku is offline   Reply With Quote
Old 19th October 2018, 17:22   #704  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
I meant VirtualDub preferences.

P.S.
Although it is not an issue, I find it still confusing how capture preview modes are organized, after inspecting again:
"Overlay" tries to render "videoPort" pin first, then "preview", then "capture"
"Preview" only renders "capture" pin but in the middle there is also "Sample Grabber"

I see no evidence that in either case any video overlay is expected.
And the fact that "Preview" mode never connects to "preview" pin does not help to understand.
So these are quite meaningless choices.

Last edited by shekh; 19th October 2018 at 17:54.
shekh is offline   Reply With Quote
Old 19th October 2018, 18:11   #705  |  Link
Morku
Registered User
 
Join Date: Jul 2012
Posts: 208
Okay, I played around a little in the setting.
Not matter which setting I change it doesn't effekt the Overlay, Preview (system). There is no preview.

But it does effect the "Display with Filters" setting:

uncheck "Use DirectX for display panes" fix the glitchy moving VirtualDub preview
It is also fixed when Direct3D 9, or OpenGL or Direct3D 11 is checked.
Any other optioncombination you would like to know?
Morku is offline   Reply With Quote
Old 19th October 2018, 18:51   #706  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Thanks, nothing left to check and it seems the problem cannot be solved (very unlikely).
shekh is offline   Reply With Quote
Old 19th October 2018, 18:57   #707  |  Link
Morku
Registered User
 
Join Date: Jul 2012
Posts: 208
Haha, okay. But at least we found some workarounds.
Morku is offline   Reply With Quote
Old 22nd October 2018, 03:47   #708  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
@Shekh,
Sorry, but I'd appreciate further clarification on this:

Quote:
Originally Posted by shekh View Post
Checked what is going on with chroma,
444 -> 422: each pixel is convolved with kernel 0.25, 0.5, 0.25
As I understand this creates some blurring.

422 -> 444: odd pixel is copied as is, even pixel is blended from two neighbor source pixels
This is simple.

Quote:
Originally Posted by shekh View Post
From the screenshot it seems Sony is using bilinear downsampling for 444->422, this blends max 2 neighbor pixels as opposed to summed area.
I changed various interpolation options until I got very similar picture.
For 442->444 it is still bilinear upsampling, no changes.
You said there that VDub2 sub-samples 444 > 422 using this "each pixel convolved with kernel 0.25, 0.5, 0.25" modality, whereas Vegas is using bilinear re-sampling which "blends max 2 neighbor pixels as opposed to summed area".

As it turns out, both Resolve (15.1.2) and Premiere Pro produce exactly the same results as VDub2 when the Checkers-444 (ProRes_4444) clip is 'pass through' exported to v210, giving the same pattern, as per the image in your first post:



Whereas Resolve 15.1 behaves in the same way as Vegas Pro, giving the same pattern as the one in your second post:



Which is also the same as the 'Checkers-422' clip (ProRes_HQ 10bit 422) that was exported from the original image created in Natron. So Natron must use the same sub-sampling modality too:



What's confusing me is that when I use AVISynth+ to do the 444 > 422 conversion with 'bilinear' chroma-resampling and then encode to v210 with VDub2, the pattern of results is exactly the same as when the conversion is done in VDub2 (i.e. importing the original Checkers-444 clip).



Code:
FFVideoSource("{Path}:\checkers-444.mov", fpsnum=25, fpsden=1, threads=1)
Converttoyuv422(interlaced=false, chromaresample="bilinear") # which VDub2 decodes to p210
So I'm left wondering, if your interpretation of the 'Vegas' pattern is 'Bilinear' (by definition) then why is the AVISynth 'Bilinear' re-sampler giving this other pattern that results from "each pixel being convolved with kernel 0.25, 0.5, 0.25 "(summed area) ?

Had a look at the AVISynth 'Resampling' docs to see what I could glean, but I'm none the wiser:

http://avisynth.nl/index.php/Resampl...-_downsampling

Is this other 'summed area' modality a variant of Bilinear or something different altogether ? I've seen mention of a so called 'area averaging' method of sampling (as distinct from 'Bilinear') but only in the context of image scaling algorithms.

https://superuser.com/questions/3757...ose-for-videos

Could you point me to any references that explain, and ideally illustrate this more fully ?

Edit: Here also, but again in relation to resolution scaling:

http://www.enfocus.com/manuals/UserG...ml#c_aa1135518

FFMPEG also:

https://ffmpeg.org/ffmpeg-scaler.htm...Scaler-Options

But nothing I can find relating to 444 > 422 sub-sampling specifically.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 22nd October 2018 at 04:53.
WorBry is offline   Reply With Quote
Old 22nd October 2018, 05:48   #709  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
@WorBry - The vegas/natron/resolve15.1 histogram pattern in your screenshot looks very close to the "box" kernel using fmtc in vapoursynth



Code:
clip = core.lsmas.LibavSMASHSource(r'F:\checkers-444.mov')
clip = core.fmtc.resample(clip, css="422", kernel="box")
clip = core.fmtc.bitdepth(clip, bits=10, dmode=1)
clip.set_output()
1 frame video sample (zipped) for non vpy users
https://www.mediafire.com/file/td58t...e%3D1.zip/file

Not sure what the equivalent is in avisynth. I thought maybe avisynth dither tools (same author) could do it , but I can't get it to do it properly, it's csp for dither_resize16 only does 8bit formats like "YV16", not YUV422P10

Last edited by poisondeathray; 22nd October 2018 at 06:38.
poisondeathray is offline   Reply With Quote
Old 22nd October 2018, 06:47   #710  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
I wondered about Box also, but it's not one of the chromaresample options given for AVISynth Convert and I'm not set up for VapourSynth.

Reassuring at least to find that Resolve now behaves in the same manner as Premiere Pro, as it makes for consistent 422 sampling outcomes on export from 444 and 422 inputs. I don't how, but that's the observation from these 'pass-through' tests.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 22nd October 2018 at 06:52.
WorBry is offline   Reply With Quote
Old 22nd October 2018, 06:50   #711  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
Actually you can do it with avs+ using dither tools, if you use the stacked format

I think Firesledge (aka Cretindesalpes) retired from avisynth stuff before avs+ became more stable (where you can use native formats now), so you can use the hacked 8bit MSB/LSB stack format (which was used for higher bit depth formats when he was active) ; I don't think dither tools was updated for the native pixel formats

Code:
LsmashVideoSource("checkers-444.mov", format="YUV444P10", stacked=true)
Dither_resize16(1920,1080, kernel="box", csp="YV16")
ConvertFromStacked(bits=10)
There are some slight histogram differences, but it's quite close. Might be some minor dithering or rounding differences

Last edited by poisondeathray; 22nd October 2018 at 06:56.
poisondeathray is offline   Reply With Quote
Old 22nd October 2018, 06:58   #712  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by poisondeathray View Post
@WorBry - The vegas/natron/resolve15.1 histogram pattern in your screenshot looks very close to the "box" kernel using fmtc in vapoursynth

It does doesn't it. I'll look at this some more tomorrow.
__________________
Nostalgia's not what it used to be
WorBry is offline   Reply With Quote
Old 22nd October 2018, 10:52   #713  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Sorry for confusion, here is illustration



I did not write the original algorithm in VD, only filled missing parts to communicate with higher precision formats. Overall it is the same in 8-bit, I don't think you have to stick to high bit depth to experiment with resampling.
By nature downsampling and upsampling are resizing of image applied to chroma planes. The differences are in small detail what filters are selected, subpixel offsets etc.

It seems I used wrong terms in wrong places.
All chroma resampling in VD is called "linear" and applied independently in with/height. Also there is "interpolation only". It seems Avisynth bilinear is exactly the same as VD "linear".
The second picture ("sony") should be called "bilinear interpolation" (not same as "bilinear resampling"). Or is it plain averaging?

This definition sounds correct: "Bilinear interpolation uses a 2x2 environment of a pixel and then takes the average of these pixels to interpolate the new value. It's not the best algorithm, but rather fast." = "sony".

Bilinear resampling averages more pixels by applying weights which fall off in linear law. By coincidence, in this example 0.5, 1, 0.5 are exactly pixel areas if you draw a box around them. Thus you could call it "Area averaging" but it behaves differently with other scales.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 22nd October 2018, 22:01   #714  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Thanks Shekh,

So if I understand correctly, your interpretation of the 'Sony Vegas' (Resolve 15.1, Natron) Checkers-444 > v210 pattern holds - "blends max 2 neighbor pixels as opposed to summed area" - and that is what the lower diagram illustrates:



That also fits with a definition of Bilinear Interpolation - "....uses a 2x2 environment of a pixel and then takes the average of these pixels to interpolate the new value. It's not the best algorithm, but rather fast." Did that definition come from Sony btw ?

The other pattern observed with VDub2 represents Bilinear Resampling where "each pixel convolved with kernel 0.25, 0.5, 0.25" (corresponding to the top diagram), which is consistent with the 444 > 422 results obtained with AVISynth using the 'Bilinear' re-sampler, along with Resolve 15.1.2 and Premiere Pro.

@PDR. Many thanks also. I think you've clinched it.

Quote:
Originally Posted by WorBry View Post
Quote:
Originally Posted by poisondeathray View Post
The vegas/natron/resolve15.1 histogram pattern in your screenshot looks very close to the "box" kernel using fmtc in vapoursynth

It does doesn't it. I'll look at this some more tomorrow.
I ran the AVISynth scipt you posted:

Code:
LsmashVideoSource("checkers-444.mov", format="YUV444P10", stacked=true)
Dither_resize16(1920,1080, kernel="box", csp="YV16")
ConvertFromStacked(bits=10)
Here's the scope profile and checker pattern of the resulting v210 encode compared to your VapourSynth 'v210_fmtc_box_dmode=1' clip, the Resolve 15.1 export and original 'Checkers-422' (ProRes_HQ) clip. They match up very well don't they.



I also compared the AVISynth 'Box Kernel' v210 vs Resolve 15.1 v210 export with quality metrics and the SSIM and PSNR scores are not too shabby either:



That's the one - it's 'Box Kernel' resampling.

So does that tally with '"blends max 2 neighbor pixels as opposed to summed area" ?

If so I think we can marked this up as "solved".

Edit: I'm also able to replicate the behavior observed when the Checkers-422 clip is 'pass-through' exported to v210 in Resolve 15.1

Code:
LSMASHVideoSource("{Path}:\checkers-422.mov", format="YUV422P10", stacked=true)
Dither_resize16(1920,1080, kernel="bilinear", csp="YV24")
Dither_resize16(1920,1080, kernel="box", csp="YV16")
ConvertFromStacked(bits=10)


Which confirms Bilinear up-sampling to 444 on import and Box sub-sampling to 422 on export.

It was that behavior which sparked this study in the first place as it was deemed to reflect sub-optimal 422 chroma sub-sampling.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 23rd October 2018 at 06:03.
WorBry is offline   Reply With Quote
Old 22nd October 2018, 22:31   #715  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
@WorBry
Yes, you understood me right.
"Did that definition come from Sony btw" - it is from answers from stackexchange link you gave above, from explanation of ffdshow filters.

When just 2 pixels are averaged there is not enough information to guess original intent. Both the results can be from box filter but with different chroma location.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 23rd October 2018, 02:06   #716  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by shekh View Post
@WorBry
"Did that definition come from Sony btw" - it is from answers from stackexchange link you gave above, from explanation of ffdshow filters.
So it is

Thanks again.
__________________
Nostalgia's not what it used to be
WorBry is offline   Reply With Quote
Old 24th October 2018, 06:40   #717  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
@ poisondeathray. Here's another eye-opener:

https://forum.blackmagicdesign.com/v...rt=100#p448972
__________________
Nostalgia's not what it used to be
WorBry is offline   Reply With Quote
Old 7th November 2018, 08:44   #718  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Quote:
Originally Posted by Morku View Post
to describe the distortions, I think it's the best to show as a video. Depending where the window of VirtualDub is, the preview 'moves' and you can create that "winning solitair" effect (or crashing IE on windows95, you know...).
Check the video: https://www.dropbox.com/s/ri897y11tf...aldub.mp4?dl=0
Just noticed same issue. DirectDraw display + vsync = wrong window offset.
For some reason vsync is enabled in capture preview, disabled otherwise.
Turns out this is bug in code, not hardware/drivers related.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 16th November 2018, 17:20   #719  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Reporting a few bugs.

In capture mode, the video levels window can be opened infinite instance instead of just one.

And when I changed the exposure value in the levels setting and start capturing, the exposure value was reset back to the previous value from the "capture filter" instead.

Also, when capture is running, clicking "file->exit capture mode" did not work.
lansing is offline   Reply With Quote
Old 19th November 2018, 22:07   #720  |  Link
Morku
Registered User
 
Join Date: Jul 2012
Posts: 208
Quote:
Originally Posted by shekh View Post
Just noticed same issue. DirectDraw display + vsync = wrong window offset.
For some reason vsync is enabled in capture preview, disabled otherwise.
Turns out this is bug in code, not hardware/drivers related.
Did you change anything related between 42699 and 42711 with Capture AVI...?

Because with the recent version, no matter what I try, I don't get a preview image at all anymore, not even the distorted "Display with Filters" works. I tried all the tricks with disable audio record and back, but no luck. Only the Cropping window shows a preview, which is sadly usless for me.

Revert back to 42699 works and I get my preview. So currently I will keep the older version for capturing avi.

What's also weird, when "Display with Filters" is enabled in current version, moving the VirtualDub2 window around is choppy (like 30fps). When Overlay, the window moves smoothly with my 60Hz monitor refresh rate.
The 42699 does not show that issue. It shows the distorted preview (which is always fixed, when starting capturing), but the VirtualDub2 windows moves with 60Hz.
Morku 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 12:35.


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