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. |
2nd December 2009, 20:14 | #1 | Link |
Registered User
Join Date: Mar 2007
Posts: 5
|
Cropping a 1080p YV12 source to mod8 height
I have a 1920x1080 blu-ray source which has black borders top and bottom:
137px at the top and -139px at the bottom. I wanted to crop both values with Crop(0,137,-0,-139) and then use AddBorders(0,2,0,2) to add 2px at the top and bottom to end up with a mod8 compatible height of 808px. This is was not possible. AviSynth told me it's only possible to crop even numbers. I tried cropping 136px top and -138px bottom. This would result in 806px including a 1px border top and bottom. To achieve 808px I tried AddBorders(0,1,0,1) to get a resolution of 1920x808 including a 2px border top and bottom. There was no AviSynth error but I ended up with an image of 1920x808 which had 1px black at top and 3px black at the bottom. I'm sure the AddBorders syntax is correct. What's wrong then? |
2nd December 2009, 20:35 | #2 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Adding an odd-sized border to a YV12 clip would require resampling the chroma, so Avisynth doesn't do it. It silently rounds the borders to even numbers, rounding down for the top and left, and up for the bottom and right. So 1 and 1 become 0 and 2.
Maybe it would be better for it to report an error instead (as in Crop)? Last edited by Gavino; 2nd December 2009 at 21:22. Reason: perhaps report error? |
2nd December 2009, 23:12 | #4 | Link | |
契約者
Join Date: Jun 2008
Posts: 1,576
|
Quote:
EDIT: In this case (if resizing is OK) its better to do Spline36Resize(1920,808,0,137,0,-139) without any borders... Last edited by Keiyakusha; 2nd December 2009 at 23:18. |
|
2nd December 2009, 23:41 | #7 | Link | |
Registered User
Join Date: May 2008
Posts: 1,618
|
Quote:
FWIW, a lot of Blu-ray discs have sharpening artifacts near the picture edges...if me mentioning this curses you with noticing them now (haha), maybe you want to crop those out too and you may end up with a mod8 resolution with no "good" areas thrown away. |
|
2nd December 2009, 23:51 | #9 | Link | |
Registered User
Join Date: Mar 2007
Posts: 5
|
Quote:
|
|
|
|