Go Back    Forum > Digital Video > Video Project Help > Restore, Filter, Improve Quality

Reply
 
LinkBack Thread Tools
  #41  
07-28-2017, 04:44 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
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?
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #42  
07-29-2017, 12:31 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 453
Thanked 3 Times in 2 Posts
...not a clue.


Attached Files
File Type: avsi sd2hd.avsi (11.7 KB, 8 downloads)
Reply With Quote
  #43  
07-29-2017, 04:52 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
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?
Reply With Quote
  #44  
07-29-2017, 11:42 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 453
Thanked 3 Times in 2 Posts
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'....
Reply With Quote
  #45  
07-29-2017, 06:38 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
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.
Reply With Quote
  #46  
07-29-2017, 08:33 PM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 453
Thanked 3 Times in 2 Posts
...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.
Reply With Quote
  #47  
07-29-2017, 09:12 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
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?
Reply With Quote
  #48  
07-29-2017, 10:43 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,508
Thanked 2,449 Times in 2,081 Posts
Quote:
Originally Posted by sanlyn View Post
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 View Post
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.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
  #49  
07-30-2017, 01:34 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
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.

Last edited by sanlyn; 07-30-2017 at 02:19 AM.
Reply With Quote
  #50  
07-30-2017, 02:44 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 453
Thanked 3 Times in 2 Posts
Quote:
Originally Posted by sanlyn View Post
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:
Screenshot 2017-07-30 15.38.57.jpg

Quote:
Originally Posted by sanlyn View Post
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.


Attached Files
File Type: zip hd2sd_sd2hd.zip (3.34 MB, 13 downloads)
Reply With Quote
  #51  
08-01-2017, 03:29 PM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 453
Thanked 3 Times in 2 Posts
Still not sure where the extra width is coming from.
Reply With Quote
  #52  
08-01-2017, 05:57 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
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.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Cine film conversion, interlaced vs. progressive? Sparx Capture, Record, Transfer 3 08-28-2016 04:28 PM
Capture interlaced, but how to to keep video interlaced when making DVDs? premiumcapture Encode, Convert for discs 11 12-21-2013 03:40 PM
Interlaced video to progressive (double frame rate) metaleonid Edit Video, Audio 23 09-29-2013 09:51 PM
Interlacing on HD progressive displays? admin Capture, Record, Transfer 2 12-02-2009 12:42 PM
Interlaced vs. non-interlaced artifacts? via Email or PM Capture, Record, Transfer 1 04-16-2009 05:37 PM

Thread Tools



 
All times are GMT -5. The time now is 12:41 AM