[RESOLVED] CLIP + cropping
Re: CLIP + cropping
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
Ah, it's CLI! Now it all makes sense.
Re: CLIP + cropping
Sorry for not writing that sooner. MeGUI is always about CLI
Re: CLIP + cropping
Yes, but I should have realized that too.
Re: CLIP + cropping
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.
"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
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.
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
Thank you very much for your work!
So I will force mod4 for the moment as well.
So I will force mod4 for the moment as well.
Re: CLIP + cropping
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
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.
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
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
Notebook: RTX 4060 | Ryzen R9 7945HX | 32 GB RAM
Re: CLIP + cropping
Good eyes, thanks DJ.
Re: CLIP + cropping
Changed avatar again?
Re: CLIP + cropping
Bullwinkle was feeling left out.
Re: CLIP + cropping
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
Did you mean to remove "Always Crop 1088 -> 1080"?
Edit, it still seems to crop to 1080
Re: CLIP + cropping
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
Seems to be working fine
Please note that the mod 2 crop worked on this sample
mediainfo report and script
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
Can I have that sample, please?
Re: CLIP + cropping
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
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
Sure, FTP server is fine. Thanks.
Re: CLIP + cropping
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?
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
Let me know if you have the file
Re: CLIP + cropping
Yes, that is what I expect. But gonca reported otherwise so I asked for the stream to check that.
I agree. We can go with a warning in the manual and hope for a timely fix from nVidia.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'll check into it and report back. I wasn't aware of any issues.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?
Re: CLIP + cropping
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
Okay, so the crop is actually being shifted to the other side?
My eyesight ain't what it used to be, oy vey.
My eyesight ain't what it used to be, oy vey.