digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Restore, Filter, Improve Quality (https://www.digitalfaq.com/forum/video-restore/)
-   -   Output both progressive and interlaced? (https://www.digitalfaq.com/forum/video-restore/8007-output-both-progressive.html)

sanlyn 07-28-2017 04:44 PM

A 4:3 image at a height of 720 pixels would have a width of 960. The width would be 1.33333333 times the height. The math I used is:
width = 720 x 1.3333333 = 959.9999999976
...or 960 rounded for a mod16 width.

What math is SD2HD using?

koberulz 07-29-2017 12:31 AM

1 Attachment(s)
...not a clue.

sanlyn 07-29-2017 04:52 AM

Didn't your original video have thick side borders? There is a crop routine in SD2HD that uses a complex algorithm based on pixel aspect ratios that makes an educated "guess" about side borders in standard defintion 4:3 source source at 720x480 or 720x576, which is usually a 704 pixels wide, hen rops off supposed edge borders.

If you crop off the edge borders of your typical sample and enlarge the results to 960 width, the image content will be wider than the uncropped image in the lower picture. In the lower picture you posted, the original side borders appear to be uncropped so that the resulting image content minus the borders is not 4:3 (1.3333333:1) but looks to be more narrow at about 1.23:1. If you include space for the original side borders, the lower image content comes out closer to 1.333:1). This would mean that the top picture is slightly stretched horizontally. That's a rather odd and arbitrary routine that uses a "guessing" trick similar to the one used by Autocrop (or did they rename it to RoboCrop?), but it's missing out on the black bottom and top borders in your original clip.

This side cropping business in SD2HD seems a bit iffy to me, because standard definition material doesn't always have equal side borders or a centered image, much less equal bottom borders. However if you like what SD2HD is assuming and can't figure out the math to make an original image the right frame size, use SD2HD and live with what it gives you.

The crop routine also makes some guesses about whether or not the original image is a 16:9 image inside a letterboxed 4:3 frame. However, most Hollywood movies aren't made at 16:9 so there's no telling what the routine would do with a 1.86:1 or 2.3:1 or 1.66:1 letterboxed movie. SD2HD is an avsi script that's a plain text file -- you can read the code if you want to figure out what it's doing, but it does crop off the sides of anything that's 720x480 or 720x576 based on "average" pixel aspect ratios for those formats..

Are you saying you don't know that a 4:3 image is a picture whose width is 1.333333 times its height?

koberulz 07-29-2017 11:42 AM

I'm completely lost.

Borders were cropped off in VDub (8, 4, 16, 12) and the re-added via a resize to reach 720x576. So what SD2HD gets should still be a 4:3 file.

I've read the SD2HD avsi. I wouldn't describe it as 'plain'....

sanlyn 07-29-2017 06:38 PM

Thanks for the description of what you're actually doing instead of letting everyone guess forever. But I figured that SD2HD was working with an image whose side borders had been removed somewhere in the processing. Now I understand what's going on with SD2HD and why it resized the way it did with Spline36Resize (which you could have done yourself). If you cut off side pixels and resized the width to 720 without replacing what you removed from the sides, you stretched the original image horizontally. Let me ask: if you removed side pixels, why didn't you remove bottom and top pixels as well so you could stay closer to the original aspect ratio?

Nut never mind. They're your client's videos, not mine.

koberulz 07-29-2017 08:33 PM

...huh?

Pixels were removed from all four sides, and then VDub's "resize" filter was used to add borders to pad it back out to 720x576. Exactly the same as your usual Crop(x,x,x,x).AddBorders(x,x,x,x) in AviSynth.

"Resize" in VDub can resize by cropping, letterboxing/pillarboxing, or scaling.

sanlyn 07-29-2017 09:12 PM

Sorry, dude, resizing isn't the same thing as adding black border pixels. Arew ypou sure you know what "Resize" means? This code:

Code:

Crop(x,x,x,x).AddBorders(x,x,x,x)
and this code:

Code:

Crop(x,x,x,x).Resize(w,h)
don't work the same way. Not at all.

Don't try to convince me that the two images you posted have no bottom or top borders in the image area. Clearly, they do. You created those images, didn't you even look at them ? Or did you do something other than downsize them and didn't tell us?

lordsmurf 07-29-2017 10:43 PM

Quote:

Originally Posted by sanlyn (Post 50424)
Sorry, dude, resizing isn't the same thing as adding black border

Remember, he's learning, not arguing. He simply stated what he did, be it right or wrong. ;)

Don't jump on him.

Quote:

Originally Posted by koberulz (Post 50414)
I'm completely lost..

Same here.

You shared SD2HD avsi, but where is the documentation for it? I despise Avisynth scripts that do not have usage notes, as its usually a buggy beta-grade filter that doesn't really work that well (or at all).

I did find a "hd2sd_sd2hd.zip" after lots of Googling, but it's from 2009. I'm not sure if that was the final release or an alpha release. Again, no home, no notes, nothing.

sanlyn 07-30-2017 01:34 AM

No, LS, he didn't state what he did until he kept us guessing with those two posted images. He does this all the time, sneaking in important omitted details after days of guessing my me and other responders. It's really annoying. I was guessing that the image in the top photo had been cropped along the side borders and stretched horizontally and blaming it on SD2HD (which I knew shouldn't be correct, but it was the only answer I could see). Then he announces that he did the crop and horizontal resize himself. Every question follows this fitful process. I'm too old and cranky for this and should just stay away from it.

The SD2HD and HD2SD avsi routines are widely touted upscale and downscale routines designed for people who have no basic knowlwedge of what they're doing (and who can't see that well, either), and neither script is very good at what they do. The downscaling is especially poor. There have since been much better plugins including iResize, ResizeX, etc., including those that use 16-bit processing for resampling work which is also something that many users can figure out on their own with the dither package.

koberulz 07-30-2017 02:44 AM

2 Attachment(s)
Quote:

Originally Posted by sanlyn (Post 50424)
Sorry, dude, resizing isn't the same thing as adding black border pixels. Arew ypou sure you know what "Resize" means? This code:

Code:

Crop(x,x,x,x).AddBorders(x,x,x,x)
and this code:

Code:

Crop(x,x,x,x).Resize(w,h)
don't work the same way. Not at all.

They aren't the same in AviSynth, but I didn't use AviSynth. I used VDub.

Here's a screenshot, showing before and after along with the resize settings used. As you can see, the 'resize' filter is used to add black borders, not to scale anything:
Attachment 7768

Quote:

Originally Posted by sanlyn (Post 50436)
I was guessing that the image in the top photo had been cropped along the side borders and stretched horizontally and blaming it on SD2HD (which I knew shouldn't be correct, but it was the only answer I could see). Then he announces that he did the crop and horizontal resize himself.

SD2HD and your Spline36Resize script were fed the exact same footage. Cropping and adding borders was done before that. Here's my script:
Code:

AVISource("Capture3.avi")
Spline36Resize(960,720)
AddBorders(160,0,160,0)
ColorMatrix(mode="rec.601->rec.709", interlaced=false)
#sd2hd(OutputWidth=1280, OutputFieldRate=50, interlaced=false, widescreen=false)
ConvertToYV12(matrix="rec709",interlaced=false)

All I did was comment out the Splie36, AddBorders, and ColorMatrix lines, and uncomment the sd2hd line. That's the only difference.

If you meant your comments about cropping/adding borders/resizing to refer to solely one screenshot or the other, I misunderstood.

I've attached my copy of the hd2sd_sd2hd zip.

koberulz 08-01-2017 03:29 PM

Still not sure where the extra width is coming from.

sanlyn 08-01-2017 05:57 PM

You can get the same effect yourself. Crop 8 pixels off the left side, 8 pixels off the right side, and resize to 960x720. This will slightly stretch the final aspect ratio hoizontally. Your viewers probably can't tell.

You can try the following, as well: Crop 8 pixels off the left side, 8 pixels off the right side, resize to 720x576, and feed it to SD2HD. It will look even wider because they're cropping off the sides. SD2HD sucks, doesn't resize or deinterlace that well, and creates several non-compliant formats (1080p at 25 or 30 fps is not valid for BluiRay). SMPTE standards for PAL 4:3 in a 720-wide frame uses only 704 horizontal pixels for the image area (depending on the tape, and PAL DV is the exception. Avoid this SD2HD automated garbage. It doesn\'t do anything you couldn\'t have done yourself.


All times are GMT -5. The time now is 09:04 PM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.