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.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th December 2011, 00:00   #1  |  Link
mdw
Registered User
 
Join Date: Jul 2006
Location: Czech Republic
Posts: 48
x264 SAR issue

I have a strange issue when encoding DVB-T PAL broadcasts with x264. The broadcasts in question are 720x576 16:9 (ie. anamorphic). When I encode with x264 without specifying SAR, they end up as square pixel videos (ie 4:3 aspect). When I specify --sar 16:9 on the x264 command line, I get videos, that get played at 2.22:1 aspect. I tried mplayer, Windows Media Player, VLC... all play them that -- incorrect -- way. What gives? How do I properly encode 16:9 anamorphic video with x264?
mdw is offline   Reply With Quote
Old 11th December 2011, 00:04   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,229
Quote:
Originally Posted by mdw View Post
I have a strange issue when encoding DVB-T PAL broadcasts with x264. The broadcasts in question are 720x576 16:9 (ie. anamorphic). When I encode with x264 without specifying SAR, they end up as square pixel videos (ie 4:3 aspect). When I specify --sar 16:9 on the x264 command line, I get videos, that get played at 2.22:1 aspect. I tried mplayer, Windows Media Player, VLC... all play them that -- incorrect -- way. What gives? How do I properly encode 16:9 anamorphic video with x264?
First of all, 720x576 with "square pixles" (i.e. SAR=1:1) does not give 4:3, but 5:4. You get proper 4:3 with a SAR of 16:15.

Secondly, in order to get a DAR (Display Aspect Ratio) of 16:9 for 720x576 footage, you need a SAR of 64:45.

DAR = (width_in_pixles / height_in_pixels) * (sar_nominator / sar_denominator) = (720 / 576) * (64 / 45) = 16/9
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 11th December 2011 at 00:08.
LoRd_MuldeR is offline   Reply With Quote
Old 11th December 2011, 00:21   #3  |  Link
mdw
Registered User
 
Join Date: Jul 2006
Location: Czech Republic
Posts: 48
Quote:
Originally Posted by LoRd_MuldeR View Post
First of all, 720x576 with "square pixles" (i.e. SAR=1:1) does not give 4:3, but 5:4. You get proper 4:3 with a SAR of 16:15.
It sounds so obvious when you point that out... I feel stupid ;-)

Quote:
Secondly, in order to get a DAR (Display Aspect Ratio) of 16:9 for 720x576 footage, you need a SAR of 64:45.

DAR = (width_in_pixles / height_in_pixels) * (sar_nominator / sar_denominator) = (720 / 576) * (64 / 45) = 16/9
Thanks, that's exactly what I needed to know.
mdw is offline   Reply With Quote
Old 11th December 2011, 11:40   #4  |  Link
infoeater
Registered User
 
Join Date: May 2007
Posts: 53
Take a look at:
http://lipas.uwasa.fi/~f76998/video/conversion/

Exactly correct SAR for 4:3 video is 128/117 (approximately 12:11). For 16:9 it is 512:351 (approximately 48:33). It is because in "PAL" (625 line analog system after digitalization, PAL is in fact name of analog color encoding) 4:3 or 16:9 refer to center 702x576 area, not full 720x576. Full 720x576 is usually wider then 16:9/4:3.

DAR = (width_in_pixles / height_in_pixels) * (sar_nominator / sar_denominator) = (702 / 576) * (512 / 351) = 16/9

Sometimes (but less than more often) it is not true if original video have incorrect aspect ratio. So it's always good to find something in shape of circle or square to check this.

Last edited by infoeater; 11th December 2011 at 12:13.
infoeater is offline   Reply With Quote
Old 15th December 2011, 03:43   #5  |  Link
henryho_hk
Registered User
 
Join Date: Mar 2004
Posts: 889
The SAR parameter of x264 is indeed the pixel "shape" (pixel aspect ratio) but not the image shape (display aspect ratio).
henryho_hk is offline   Reply With Quote
Reply

Tags
anamorphic, sar, x264

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.