Page 1 of 3

Re: CLIP + cropping

Posted: Mon Dec 03, 2018 12:18 pm
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.

Re: CLIP + cropping

Posted: Mon Dec 03, 2018 12:19 pm
by admin
Ah, it's CLI! Now it all makes sense.

Re: CLIP + cropping

Posted: Mon Dec 03, 2018 12:24 pm
by Zathor
Sorry for not writing that sooner. MeGUI is always about CLI :oops:

Re: CLIP + cropping

Posted: Mon Dec 03, 2018 12:52 pm
by admin
Yes, but I should have realized that too. :oops:

Re: CLIP + cropping

Posted: Tue Dec 04, 2018 9:59 am
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.

Re: CLIP + cropping

Posted: Tue Dec 04, 2018 11:09 am
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.

Re: CLIP + cropping

Posted: Tue Dec 04, 2018 12:15 pm
by Zathor
Thank you very much for your work!
So I will force mod4 for the moment as well.

Re: CLIP + cropping

Posted: Thu Dec 06, 2018 4:30 pm
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.

Re: CLIP + cropping

Posted: Fri Dec 07, 2018 10:42 am
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.

Re: CLIP + cropping

Posted: Fri Dec 07, 2018 2:15 pm
by DJATOM
DGSource("project.dgi", resize_w=1280, resize_h=720) <-- leftovers in the examples part of manual.

Re: CLIP + cropping

Posted: Fri Dec 07, 2018 3:35 pm
by admin
Good eyes, thanks DJ.

Re: CLIP + cropping

Posted: Fri Dec 07, 2018 4:05 pm
by Guest
Changed avatar again?

Re: CLIP + cropping

Posted: Fri Dec 07, 2018 4:08 pm
by admin
Bullwinkle was feeling left out.

Re: CLIP + cropping

Posted: Fri Dec 07, 2018 5:27 pm
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

Re: CLIP + cropping

Posted: Fri Dec 07, 2018 5:50 pm
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.

Re: CLIP + cropping

Posted: Fri Dec 07, 2018 6:01 pm
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()

Re: CLIP + cropping

Posted: Fri Dec 07, 2018 7:43 pm
by admin
Can I have that sample, please?

Re: CLIP + cropping

Posted: Sat Dec 08, 2018 5:47 am
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

Re: CLIP + cropping

Posted: Sat Dec 08, 2018 6:16 am
by admin
Sure, FTP server is fine. Thanks.

Re: CLIP + cropping

Posted: Sat Dec 08, 2018 7:37 am
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?

Re: CLIP + cropping

Posted: Sat Dec 08, 2018 8:23 am
by Guest
Let me know if you have the file

Re: CLIP + cropping

Posted: Sat Dec 08, 2018 10:33 am
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.

Re: CLIP + cropping

Posted: Sat Dec 08, 2018 10:35 am
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...

Re: CLIP + cropping

Posted: Sat Dec 08, 2018 11:04 am
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.

Re: CLIP + cropping

Posted: Sat Dec 08, 2018 11:16 am
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.