Go Back    Forum > Digital Video > Video Project Help > Encode, Convert for streaming

Reply
 
LinkBack Thread Tools
  #1  
07-17-2019, 08:14 PM
Ryelzz Ryelzz is offline
Free Member
 
Join Date: Jul 2019
Posts: 2
Thanked 0 Times in 0 Posts
Hi All,

I have captured some VHS tapes at a resolution of 720x576 using the Hauppauge, which enables me to capture and compress to mp4 in real time, which is fine, as I do not wish to perform any restoration, just very simple capture, compress, and share with the family.

I have also captured some 8mm tapes using DV, which are captured at 720x576 but these are saved as an AVI, which is also fine. However, these files are large and I am wanting to compress them to mp4 for upload etc.

The problem/misunderstanding I have is the AVI when compressed to mp4 are now 768x576, even though I am "maintaining" the same output size. I have done some research online and believe this is due to the AVI using rectangular pixels while the mp4 uses square pixels, but I don't understand the implications of this.

What I am wanting to know is if a 720x576 AVI is the equivalent to a 768x576 mp4, or should I be capturing my AVI at a different resolution?

I am PAL by the way.

Apologies if I have any of the terminology incorrect or have used poor choice of words in describing my situation.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
07-24-2019, 07:11 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,510
Thanked 2,449 Times in 2,081 Posts
Quote:
Originally Posted by Ryelzz View Post
and believe this is due to the AVI using rectangular pixels while the mp4 uses square pixels
That's it.

The video is displayed (DAR) as 4x3.
The video is stored (SAR) as 5x4.
Files can have two AR (aspect ratios).

Analog is ideally captured max SD PAL of 720x576, and DVD/BD requires it. But it displays 5x4 if rectangle viewed square, usually due to no AR flags, of which lossless AVI does not have. MPEG/H.264 has AR flags, so you can make it any size, display any different size. But online streaming sites like Youtube are strictly 1x1 AR. Lots of my local videos are MKV flagged to different AR in the container, and watchable just fine on local LAN using BD player or WDTV or computer. But for Youtube, I'd have to reencode compliant to their 1x1 requirements.

768x576 is just 4x3 square pixels.
720x576 is rectangle.

I know, lots of jargon and terms, but that's video. Understand all that?

- 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
The following users thank lordsmurf for this useful post: jacobmervyn (04-16-2020)
  #3  
02-04-2021, 03:36 AM
latreche34 latreche34 is offline
Free Member
 
Join Date: Dec 2015
Location: USA
Posts: 3,257
Thanked 537 Times in 497 Posts
Quote:
Originally Posted by Ryelzz View Post
I have done some research online and believe this is due to the AVI using rectangular pixels while the mp4 uses square pixels, but I don't understand the implications of this.
It's the other way around, AVI assumes every pixel is square therefore you get a weird aspect ratio (NTSC stretched horizontally and PAL/SECAM stretched vertically), Encoded video is smarter than AVI, it can display a rectangular pixel or a square pixel and the shape of the pixel PAR (pixel aspect ratio) can be assigned via an SAR flag, The SAR flag value (or PAR shape) depends on the initial resolution and the format of the video. If the SAR equals 1 it's a square pixel, if it's a fraction it's a rectangular pixel, Whatever SAR you choose the final goal is to have a perfect 4:3 aspect ratio of the frame.

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

The general formula is: SAR = 4:3 x (V resolution : H resolution)

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
Reply With Quote
The following users thank latreche34 for this useful post: keaton (02-17-2021), lordsmurf (02-04-2021)
  #4  
02-10-2021, 09:19 PM
cygnals cygnals is offline
Free Member
 
Join Date: Aug 2019
Location: London, Ontario Canada
Posts: 20
Thanked 3 Times in 3 Posts
Thanks for this. I've been battling with this off and on for a while, and have now printed off your handy reference chart to keep at the computer. Cheers.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
SR-W7U tape counter not working, picture breaks into pixels? Cingular Video Hardware Repair 3 04-19-2016 11:52 PM
Images scan with orange pixels? Allison19 Photo Processing, Scanning & Printing 4 01-15-2016 01:40 PM
Super black and white pixels / lines in lower field (only) of VHS capture ctrl-z Restore, Filter, Improve Quality 11 07-26-2015 03:23 PM
Video shifting several pixels while capturing? thefan007 Capture, Record, Transfer 9 11-16-2014 02:36 PM
Symbols on DC power supplies? Square inside a square? Jurgeaustin Digital Devices 4 07-03-2012 05:59 PM

Thread Tools



 
All times are GMT -5. The time now is 10:24 AM