digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Restore, Filter, Improve Quality (https://www.digitalfaq.com/forum/video-restore/)
-   -   Upscaling NTSC VHS to 1080p with Hybrid? (https://www.digitalfaq.com/forum/video-restore/12401-upscaling-ntsc-vhs.html)

113pigeon 01-07-2022 10:01 AM

Upscaling NTSC VHS to 1080p with Hybrid?
 
I've captured and deinterlaced (QTGMC) some NTSC VHS footage (720x480)

Setup is JVC SVHS HR-S2913U > DMR-ES15 > Pinnacle 710 USB > Windows 10 > Virtual Dub 1.9.11 > Lagarith lossless

I've started playing around with Upscaling to 1080p (x264/mp4) with Hybrid + AviSynth (v2021.07.18.1).

When upscale, which resolution is it best to output for playback on various devices (including upload to YouTube)? Options are:
- 1620 x 1080? This maintains the same aspect ratio of 720:480 / 4:3
- 1920 x 1080? This gives the 9:16 ratio.

If it is better to end up with 1920 x 1080 and if I don't want to crop the original video, what approach is best with Hybrid + Avisynth?

I couldn't find anything like AviSynth's "AddBorders" in Hybrid. So I've been using Letterbox to get it to 1920x1080 with the following. but I'm wondering if this is recommended or not (pros/cons,etc)
Crop/Resize:
- Resize = 1620 x 1080
- Letterbox = 1920 x 1080
This adds black borders on the right & left.

Hybrid + VapourSynth seems to be more recommended now, but I'm not very familiar with it. If anyone has links to upscaling with VapourSynth, I'd definitely be interested to know more.

latreche34 01-07-2022 10:36 AM

720x480 --> 704x480 --> 1440x1080 (square pixel).
Keep the master files.

113pigeon 01-07-2022 10:55 AM

Quote:

Originally Posted by latreche34 (Post 81666)
720x480 --> 704x480 --> 1440x1080 (square pixel).
Keep the master files.

Going from 704x480 --> 1440x1080 will require stretching right? Since 1440/704 = 2.04545.. whereas 1080/480 = 2.25

Or are square pixels different somehow?
In Hybrid, I don't see an option for square pixels.

Any additional insight would be appreciated.

latreche34 01-07-2022 02:09 PM

No stretching, that's the right way, Analog video captured into digital has a ratio of 704:480 (4:3 non square pixel) for NTSC by design, The capture card adds 16 padded black pixels to the sides that has to be removed, resizing to 1440x1080 preserves that aspect ratio and converts the shape of each pixel from non square to square with no stretching at all. If in doubt try it.

113pigeon 01-08-2022 07:13 AM

Thank you for putting me on the right path! I've done a lot of reading and will share a summary shortly. As you can tell, I'm a bit of a newbie.

One more question to ensure my understanding is correct:

To share footage, I plan to create an mp4 from my captured & deinterlaced .avi's without upscaling. (The upscaling is mostly for YouTube.)

When I create the mp4s, what is recommended for the crop/resize since it will often be viewed on a computer. Options:
1. Crop 8 lines on both sides and resize to 640x480 to get a DAR of 4:3 and square pixels. On a computer, I think this means it will look like it's true intended shape.

2. Leave at 720 x 480. If I understand correctly, this will display at a DAR of 3:2, so the pixels will be rectangular and not the true shape. Unless there is a way to force a DAR of 4:3 on a computer?

3. Crop 8 lines on both sides and output at 704x480. This will still be rectangular with an odd DAR, so I can't see a reason for this.

latreche34 01-08-2022 07:32 AM

Have you heard of SAR flag? You can have the player display the video at any aspect ratio regardless resolution by assigning a SAR flag (Sample Aspect Ratio a.k.a Pixel Aspect Ratio) during encoding, though there are only few legal resolutions based on the original video format:

Here are some SAR values for the 4:3 frame:

NTSC:
720x480 (DV/DVD, Full frame) -> SAR=8/9
704x480 (Analog Capture, SD Crop) -> SAR=10/11
640x480 (Square pixel, SD Resize) -> SAR=1

PAL/SECAM:
720x576 (DV/DVD, Full frame) -> SAR=16/15
704x576 (Analog Capture, SD Crop) -> SAR=12/11
768x576 (Square pixel, SD Resize) -> SAR=1

Example:
Code:

ffmpeg -i In.avi -vf "scale=w=-1:h=-1:interl=1,format=yuv420p,setsar=SAR=10/11" -flags +ildct+ilme -c:v libx264 -crf 18 -x264opts bff=1:colorprim=smpte170m:transfer=smpte170m:colormatrix=smpte170m:force-cfr -c:a aac -b:a 192k Out.mp4

113pigeon 01-08-2022 08:10 AM

1 Attachment(s)
Quote:

Originally Posted by latreche34 (Post 81696)
Have you heard of SAR flag? You can have the player display the video at any aspect ratio regardless resolution by assigning a SAR flag (Sample Aspect Ratio a.k.a Pixel Aspect Ratio) during encoding, though there are only few legal resolutions based on the original video format:

Here are some SAR values for the 4:3 frame:

NTSC:
720x480 (DV/DVD, Full frame) -> SAR=8/9
704x480 (Analog Capture, SD Crop) -> SAR=10/11
640x480 (Square pixel, SD Resize) -> SAR=1

Example:
Code:

ffmpeg -i In.avi -vf "scale=w=-1:h=-1:interl=1,format=yuv420p,setsar=SAR=10/11" -flags +ildct+ilme -c:v libx264 -crf 18 -x264opts bff=1:colorprim=smpte170m:transfer=smpte170m:colormatrix=smpte170m:force-cfr -c:a aac -b:a 192k Out.mp4

Yes. I have, but wasn't sure of the best approach.

In Hybrid, I've left the resolution as 720x480 and set the output PAR to "MP4 NTSC 4:3 (10/11)". I've attached a screenshot.
Now MediaInfo for the mp4 says the DAR is 4:3, whereas before it was 3:2. And it looks correct.
So this sounds correct, right?

Thanks so much for putting me on the right track!

latreche34 01-08-2022 08:19 AM

Post a screenshot from the captured 720x480 video using snapshot option of VLC or MPC-HC or a short clip so I can take a look.

113pigeon 01-08-2022 08:31 AM

3 Attachment(s)
Here are 3 snapshots from the 3 approaches I took:
1. Original conversion with 720x480, no PAR specified so DAR defaulted to 3:2: 1-vlc-720x480-PAR-3-2.png
2. Second attempt where I chose 640x480. DAR shows as 4:3. 2-vlc-640x480.png
3. Final attempt. 720x480 with PAR of 8/9. DAR shows as 4:3. 3-vlc-720x480-PAR-4-3

latreche34 01-08-2022 08:43 AM

VLC is resizing the snapshots, the last one came out 720x528, And those are not the native frames I see black borders all around. Anyway if resizing to HD for youtube you can crop down to the bare active area in a 704:480 ratio or close enough and resize to 1440x1080.

113pigeon 01-08-2022 09:00 AM

1 Attachment(s)
Quote:

Originally Posted by latreche34 (Post 81706)
VLC is resizing the snapshots, the last one came out 720x528, And those are not the native frames I see black borders all around. Anyway if resizing to HD for youtube you can crop down to the bare active area in a 704:480 ratio or close enough and resize to 1440x1080.

The top/bottom black borders are because I cropped the overscan and added borders after deinterlacing in previous steps. (Not as part of this conversion). As per VirtualDub border masking
Crop (0,0,0,-8)
AddBorders (0,4,0,4)

I can't figure out why VirtualDub is displaying the 720x480 (at DAR 4:3) MP4 as 720x528. Attached is the MediaInfo for the file. Does anything pop out as being wrong?

I played the MP4 in virtualDub2, but virtualDub2 doesn't take the DAR setting into account.

Otherwise, would a better approach be to resize to 640x480 since players seem to have issues with the PAR/DAR setting?

thestarswitcher 01-08-2022 12:50 PM

2 Attachment(s)
I can be of assistance here.

When you capture lossless AVI, everything is displayed in Square Pixels (1:1). So the reason NTSC looks "stretched", this is the cause, as literal 720 pixels wide and 480 pixels high.

Now when you pop in an NTSC DVD file, do you notice that the resolution is 720x480, but it's being displayed as 640x480? This is because the pixels are being assigned a flag to display in 4:3, adhering to the laws of NTSC video standard without resizing.

To do this in Hybrid, go to Cropping and tick both boxes "Force Input PAR" and "Force Output PAR"- type in 8x9, this is MPEG-2 NTSC DVD ratio, but it's also appropriate for SD AVC files. When you do this, you retain the resolution but you change the "shape" of the pixels- so they're no longer square, but a ratio that matches with what we see as 4:3. Make sure your resolution is 720x480 all the way through.

In terms of YouTube, you want to have the size as 1440x1080, 1:1. The reason for this being is that if you have it any lower, your video quality will suffer worse from the compression compared to how it was. Make sure you deinterlace properly as well.

Important; for YouTube, follow this encoding specs guide provided by the site- all settings configurable in Hybrid. Hope this helps!
https://support.google.com/youtube/answer/1722171?hl=en

113pigeon 01-08-2022 03:10 PM

2 Attachment(s)
Quote:

Originally Posted by thestarswitcher (Post 81724)
To do this in Hybrid, go to Cropping and tick both boxes "Force Input PAR" and "Force Output PAR"- type in 8x9, this is MPEG-2 NTSC DVD ratio, but it's also appropriate for SD AVC files. When you do this, you retain the resolution but you change the "shape" of the pixels- so they're no longer square, but a ratio that matches with what we see as 4:3. Make sure your resolution is 720x480 all the way through.

Thank you for this reply. This put me on the right path. My Hybrid settings I previously shared were incorrect - I was mixing 720x480 with 10:11, which was wrong. It should have been pretty clear from the details latreche34 previously provided, but I was tired & missed it.

Quote:

Originally Posted by latreche34 (Post 81696)
SAR is also known as PAR
NTSC:
720x480 (DV/DVD, Full frame) -> SAR=8/9
704x480 (Analog Capture, SD Crop) -> SAR=10/11
640x480 (Square pixel, SD Resize) -> SAR=1

So, there are 2 approaches that can be taken when using Hybrid to convert a 720x480 NTSC VHS avi to mp4. I've included screenshots of the settings in Hybrid.

1. Crop to 704x480 and set the output PAR to "MP4 NTSC 4:3 (10/11)". This will eliminate the black on the left & right side. VLC displays this as 704x528 (4:3). Since this is analog video, I believe this is the recommended approach. But please correct me if I'm wrong...

2. Leave at 720x480 and set the output PAR to "MPEG-2 NTSC 4:3 (8/9)". This leaves the black on the left & right side. VLC displays this as 720x540 (4:3).

I am curious as to what setting the "Input PAR" does? I found I didn't need to set it.

latreche34 01-08-2022 04:33 PM

Forget about what VLC outputs, If your playback method is always computer you don't need to set anything just playback the videos as they are, those programs have the capability to display the video in any shape or form you want including de-interlacing, If for TV viewing or uploading to online platforms then you need to set the aspect ratio flag otherwise just resize to square pixel and don't have to worry about the AR flag at all. 1440x1080 suggested so that youtube won't hit you with a lower tier compression since it sees it as HD not SD.

As to 704 vs 720, it's up to you, The correct canvas is 704x480 for analog capturing, So setting 704 with 10/11 SAR gives you a perfect geometry while setting 720 with 8/9 SAR squeezes the active video area by about 3% since its keeping the black pillars, not noticeable by most people. I've done the circle test before at videohelp if you want to find that post.

Closecall 04-28-2022 04:53 PM

This thread was exactly what I was looking for but had a couple questions to add to it.

1. Every change made (resizing or other video edits) should be done on separate passes when using hybrid correct?

2. Do you deinterlace before or after the resizing and just being curious what settings have you been using?

3. If I plan on using the video on a Flash Drive to show relatives on either their computers or plugged into a TV do you recommend either way? going the 704-->1440.1080?

Thank you

latreche34 04-28-2022 10:44 PM

Always de-interlace before you crop or resize otherwise you risk messing the field order. I don't use hybrid, I use AVSPmod that works with QTGMC and vdub2 and all the steps are done at once but in the sequence I set which is: de-interlacing, crop and resize. AVSPmod allows me to visualize every step in the preview window of the program before launching the entire process.

Selur 05-01-2022 11:46 AM

Quote:

2. Do you deinterlace before or after the resizing and just being curious what settings have you been using?
By default Hybrid, assuming the output is set to be progressive, Hybrid does deinterlace before resizing.
I would stick with that.
Quote:

Every change made (resizing or other video edits) should be done on separate passes when using hybrid correct
I see no real need or gain from that. (Vapoursynth/Avisynth Preview allows to see the output of the script)

Quote:

I am curious as to what setting the "Input PAR" does? I found I didn't need to set it.
'Input PAR' allows to overwrite the PAR signaled by the input.

Closecall 05-04-2022 09:37 PM

Quote:

Originally Posted by latreche34 (Post 84430)
Always de-interlace before you crop or resize otherwise you risk messing the field order. I don't use hybrid, I use AVSPmod that works with QTGMC and vdub2 and all the steps are done at once but in the sequence I set which is: de-interlacing, crop and resize. AVSPmod allows me to visualize every step in the preview window of the program before launching the entire process.

Do you ever do any post work on your videos? If so do you do it before deinterlacing/upscaling?
And also do you have a program of choice for it?

I am very used to using Adobe Premiere but adobe outputs garbage quality interlace video and ruins the quality of my capture before i even get to deinterlace it. Am testing doing post work on the final upscaled videos soon to see what it would look like so i can export from adobe as a H.264 Mp4. Might as well try right?

Closecall 05-04-2022 09:59 PM

To do this in Hybrid, go to Cropping and tick both boxes "Force Input PAR" and "Force Output PAR"- type in 8x9, this is MPEG-2 NTSC DVD ratio, but it's also appropriate for SD AVC files. When you do this, you retain the resolution but you change the "shape" of the pixels- so they're no longer square, but a ratio that matches with what we see as 4:3. Make sure your resolution is 720x480 all the way through.

So do you set this when you deinterlace then? Can it be done on a seperate pass?
If the video is already deinterlaced can you do that and upscale at the same time?

latreche34 05-05-2022 01:19 AM

Quote:

Originally Posted by Closecall (Post 84605)
Do you ever do any post work on your videos? If so do you do it before deinterlacing/upscaling?
And also do you have a program of choice for it?

I am very used to using Adobe Premiere but adobe outputs garbage quality interlace video and ruins the quality of my capture before i even get to deinterlace it. Am testing doing post work on the final upscaled videos soon to see what it would look like so i can export from adobe as a H.264 Mp4. Might as well try right?

I hardly do any post work beyond de-interlacing, cropping and upscaling to 1440x1080, Though I make sure if necessary to correct the luma levels, chroma setting and audio level in the proc amp setting to make sure everything is legal, as well as some other advanced timing parameters if needed, There is like 4 pages of menu that I have to go through for every tape so I don't have to do any work later.

Closecall 05-05-2022 02:11 AM

Thank you for the reply so fast.

I am assuming the settings you're using are the ones for your program and not Hybrid correct?

latreche34 05-05-2022 02:49 AM

It's actually built in the capture device and are part of the proc amp after the video has been converted to digital, A link to those menu pages.

Closecall 05-09-2022 11:16 AM

Interesting.

Also I wanted to ask when you do your video conversion down and then up for 720x480 --> 704x480 --> 1440x1080
Are you just using the normal resize or are you using the resize tool inside of AVIsynth or Vapoursynth? Could you possibly post your settings so I could see exactly what you're doing?

Thank you!

latreche34 05-09-2022 12:04 PM

720x480 -> De-interlace -> Crop to active video area -> Upscale to 1440x1080 all in one step using multiscript avspmod frame visualizer.

Code:

AviSource("C:\Users\User\Desktop\graduation.avi")
AssumeTFF()
QTGMC(Preset="Fast")
Crop(X1, Y1, X2, Y2)
LanczosResize(1440, 1080)


Closecall 05-09-2022 06:42 PM

Quote:

Originally Posted by latreche34 (Post 84675)
720x480 -> De-interlace -> Crop to active video area -> Upscale to 1440x1080 all in one step using multiscript avspmod frame visualizer.

Code:

AviSource("C:\Users\User\Desktop\graduation.avi")
AssumeTFF()
QTGMC(Preset="Fast")
Crop(X1, Y1, X2, Y2)
LanczosResize(1440, 1080)


So that would bring it down to 704x528 and upscale to 1440, 1080 all at once?

latreche34 05-09-2022 07:52 PM

No, Where did you come up with 528?

Closecall 05-11-2022 02:47 PM

My mistake. I meant 704x480. As you mentioned in a past post on this thread bringing it down to 704 before upscaling to 1440.

latreche34 05-11-2022 04:18 PM

You can bring it down to any resolution as long as you crop in a 704:480 ratio so you don't alter the frame's geometry, Meaning if you have to crop to 698 horizontally, 698x480/704 = 476, the new resolution will be 698x476, resize this to 1440x1080.

dudebuddy 06-28-2022 08:24 AM

Quote:

Originally Posted by latreche34 (Post 84675)
720x480 -> De-interlace -> Crop to active video area -> Upscale to 1440x1080 all in one step using multiscript avspmod frame visualizer.

Code:

AviSource("C:\Users\User\Desktop\graduation.avi")
AssumeTFF()
QTGMC(Preset="Fast")
Crop(X1, Y1, X2, Y2)
LanczosResize(1440, 1080)


I also found this thread super helpful. Just had one question about cropping the video.

Example:
I need to crop all sides to get rid of the overscan...
Right: 8
Left: 8
Bottom: 8
Top: 2

This would bring the resolution to 704x470

Do you take any additional steps if you need to crop the overscan on the top and/or bottom?

latreche34 06-28-2022 09:30 AM

704x470 is a wrong aspect ratio, I don't understand your question, you've already cropped the image.

dudebuddy 06-28-2022 09:36 AM

How do you get rid of the overscan on the top and bottom while keeping the correct aspect ratio??

traal 06-28-2022 09:51 AM

Code:

AviSource("C:\Users\User\Desktop\graduation.avi")
AssumeTFF()
QTGMC(Preset="Fast")

# Crop Right=8, Top=2, Left=8, Bottom=8; result=704x470
Crop(8, 2, -8, -8)

# Center the 704x470 video in a 704x480 frame to restore the 10:11 PAR
AddBorders(0,5,0,5)


# Upscale to square pixels
LanczosResize(1440, 1080)

This adds black borders at the top and bottom in order to keep the correct PAR.

latreche34 06-28-2022 10:15 AM

Quote:

Originally Posted by dudebuddy (Post 85481)
How do you get rid of the overscan on the top and bottom while keeping the correct aspect ratio??

By cropping proportionally or masking off.

dudebuddy 06-29-2022 10:03 AM

What codec/file format do you export to?

Thanks for the info!

latreche34 06-29-2022 10:49 AM

Lossless HuffYUV.

dudebuddy 06-29-2022 09:40 PM

Quote:

Originally Posted by latreche34 (Post 85507)
Lossless HuffYUV.

Once you have the upscaled lossless avi, what application or script do you use to encode to MP4? And would you mind sharing your settings/script?

I’m using hybrid, but don’t like the results using the settings I’ve seen on this forum and others. After doing some digging, I figured out settings in hybrid that make the MP4 look pretty much identical to the lossless avi, but the encoding is taking way to long. So I’m searching and hoping I can find a way to encode a little faster while keeping the same quality.

latreche34 06-30-2022 12:15 AM

My encoding is about 5-10 frames a second, not what you are looking for.


All times are GMT -5. The time now is 01:05 PM

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