[RESOLVED] CLIP + cropping

Support forum for DGDecNV
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Thanks, that's really strange. I did establish that the AVC display_area is 638 x 398, so it is in fact mod 2. I'll investigate why I cannot get 0 2 0 2. But it's moot if I get rid of all the CLIP stuff. Still, I like to know what is going on.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Ah, it's CLI! Now it all makes sense.
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

Re: CLIP + cropping

Post by Zathor »

Sorry for not writing that sooner. MeGUI is always about CLI :oops:
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Yes, but I should have realized that too. :oops:
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Zathor wrote:

"Why is DGSource() without crop values able to crop something that crop cannot do?"

Ah, this is the key question. When you have no cropping specified by parameters, then the decoder honors the stream's configured VUI display_area, even when the area is mod 2. However, when you set up a crop with parameters then the create decoder call is passed a user-configured display_area structure. Now, when this is configured identically to the stream's display_area structure, it works only for mod 4. So this appears to be an NVDec limitation. I will confirm it with nVidia, but this appears to be what is happening and why we must enforce mod 4 for configured cropping.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

nVidia replies "There indeed used to be a mod4 restriction, but I believe recent drivers should have eliminated this restriction. Which driver version were you using ? (if it's still there, it should be considered a bug)"

It's still there in 417.01, so it will be treated as a bug. I will probably allow mod 2 with a warning that it may work properly only after a future driver revision.
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

Re: CLIP + cropping

Post by Zathor »

Thank you very much for your work!
So I will force mod4 for the moment as well.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

It turns out that mod 2 is broken only for top and left cropping. It works fine for right and bottom. nVidia says it is on the TO DO list to fix top and left. So my plan is to allow mod 2 cropping but with a warning that top and left mod 2 crops may not work until fixed in a future driver version.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Watch me pull a rabbit out of my hat!

Here is a 64-bit test version for the cropping redesign. You should be able to figure things out from the revised documents. Note the renaming of the DGSource() cropping and resize parameters. Less typing is a good thing, am I wrong? Feedback from any interested users on the binaries and docs will be gratefully received so I can shake this out before slipstreaming it. This test version also includes the fix for the FPS detection for MKV/MP4 streams.

http://rationalqm.us/misc/CropRedesign.rar

@Zathor

If possible, please enforce (or warn) mod-4 only for top and left crops. I will inform you if and when that gets fixed. Thank you for your support of DGDecNV in MeGUI.
User avatar
DJATOM
Posts: 176
Joined: Fri Oct 16, 2015 6:14 pm

Re: CLIP + cropping

Post by DJATOM »

DGSource("project.dgi", resize_w=1280, resize_h=720) <-- leftovers in the examples part of manual.
PC: RTX 2070 | Ryzen R9 5950X (no OC) | 64 GB RAM
Notebook: RTX 4060 | Ryzen R9 7945HX | 32 GB RAM
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Good eyes, thanks DJ.
DAE avatar
Guest

Re: CLIP + cropping

Post by Guest »

Changed avatar again?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Bullwinkle was feeling left out.
DAE avatar
Guest

Re: CLIP + cropping

Post by Guest »

Yogi felt left out too, he is smarter than the average bear after all

Did you mean to remove "Always Crop 1088 -> 1080"?
Edit, it still seems to crop to 1080
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

That option never made any sense so you can pretend that it is always on. There's no reason not to always honor the stream's coded display area.
DAE avatar
Guest

Re: CLIP + cropping

Post by Guest »

Seems to be working fine
Please note that the mod 2 crop worked on this sample
mediainfo report and script

Code: Select all

General
Unique ID                                : 43861704572585296599800650762977012602 (0x20FF74FF94230A62181AE663D95FEB7A)
Complete name                            : W:\TEMP\FANBOYS.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 5.36 GiB
Duration                                 : 1 h 29 min
Overall bit rate                         : 8 557 kb/s
Encoded date                             : UTC 2018-12-07 23:46:33
Writing application                      : mkvmerge v28.2.0 ('The Awakening') 64-bit
Writing library                          : libebml v1.3.6 + libmatroska v1.4.9

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L4.1@Main
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 1 h 29 min
Bit rate                                 : 7 915 kb/s
Width                                    : [color=#FF0000]1 918[/color] pixels
Height                                   : [color=#FF0000]1 078[/color] pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.160
Stream size                              : 4.96 GiB (92%)
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Code: Select all

import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin("C:/Users/LUIS/Desktop/CropRedesign/DGDecodeNV.dll")
clip = core.dgdecodenv.DGSource(r'I:\FANBOYS.dgi', ct=2, cl=2, fieldop=0)
clip.set_output()
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Can I have that sample, please?
DAE avatar
Guest

Re: CLIP + cropping

Post by Guest »

I'll cut a clip and upload it

Edit
Have a 5 minute clip from sample.
I'll upload it in a couple of hours.
Do you want it on your FTP server
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Sure, FTP server is fine. Thanks.
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

Re: CLIP + cropping

Post by Zathor »

Thanks, Don, I am currently testing.
It seems that I can enforce mod2 incl. top and left already right now. In my tests with the value 2 for ct and cl it simply did not crop. From the user perspective this is not what would be expected, however it is better than to force mod4 and then at some point depending on the driver version to remove that restriction. And of corse it would be worse if mod2 would crash it or would detroy the video, but that does not seem to be the case.
Any additional thoughts?

OT: I do not get anymore mail messages for topics I have subscribed to. The mail adress I use here is ok as I receive other mails (and no, they are not in my spam folder). Is that only me or a general issue?
DAE avatar
Guest

Re: CLIP + cropping

Post by Guest »

Let me know if you have the file
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

Zathor wrote:
Sat Dec 08, 2018 7:37 am
Thanks, Don, I am currently testing.
It seems that I can enforce mod2 incl. top and left already right now. In my tests with the value 2 for ct and cl it simply did not crop.
Yes, that is what I expect. But gonca reported otherwise so I asked for the stream to check that.
From the user perspective this is not what would be expected, however it is better than to force mod4 and then at some point depending on the driver version to remove that restriction. And of course it would be worse if mod2 would crash it or would destroy the video, but that does not seem to be the case.
Any additional thoughts?
I agree. We can go with a warning in the manual and hope for a timely fix from nVidia.
OT: I do not get anymore mail messages for topics I have subscribed to. The mail address I use here is ok as I receive other mails (and no, they are not in my spam folder). Is that only me or a general issue?
I'll check into it and report back. I wasn't aware of any issues.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

gonca wrote:
Sat Dec 08, 2018 8:23 am
Let me know if you have the file
I've got it, thank you. Investigating...
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: CLIP + cropping

Post by admin »

For gonca's stream, it behaves as I expected: cl=2 does not crop anything from the left, but due to the reduction in width by 2, it effectively crops the right by 2.
DAE avatar
Guest

Re: CLIP + cropping

Post by Guest »

Okay, so the crop is actually being shifted to the other side?
My eyesight ain't what it used to be, oy vey.
Post Reply