Log in

View Full Version : Sar usage


juGGaKNot
8th June 2009, 18:49
Hi

Right now i have sar 1/1 in my cfg and i do not know what it does, the wiki entry says "not set" is better but i have to ask

What does it do ? where does it help ?

I have just added a 3D bat to my encoding bats

echo VideoLeft = AVIsource("%mypath%\eyeleft.avi", audio=false) >> "%mypath%\@temp3D\%mymovie%.avs"
echo VideoRight = AVIsource("%mypath%\eyeright.avi", audio=false) >> "%mypath%\@temp3D\%mymovie%.avs"
echo VideoStacked = StackHorizontal(VideoRight,VideoLeft) >> "%mypath%\@temp3D\%mymovie%.avs"
echo ConvertToYV12(VideoStacked, matrix="pc.601") >> "%mypath%\@temp3D\%mymovie%.avs"

And the general resolutions here are 1920x600, 2560x1080 etc etc

What sar should i use ? should i set it to weight:height ?

THNX, cheers.

TinTime
8th June 2009, 20:28
I assume this is for x264? Anyway, the sar is the aspect ratio of the pixels that will result in the desired display aspect ratio. So, for example...

1920x1080 source, displayed at 16/9 (1920x1080): SAR 1:1
704x576 source, displayed at 16/9 (1024x576) : SAR 16:11
704x576 source, displayed at 4/3 (768x576) : SAR 12:11

To calculate SAR X:Y for a clip sx by sy resolution and a display aspect ratio of dx by dy:

X/Y = (sy*dx/dy)/sx

For the second example above (704x576, 16/9) that gives...

sx = 704
sy = 576
dx = 16
dy = 9

(sy*dx/dy)/sx = (576*16/9)/704 = 1024/704 = 16/11 (i.e. SAR 16:11)

In fact I think you can just set SAR to 1024:704 and x264 will automatically calculate the highest common factor for you and simplify it to 16:11.

This helps because the encode knows its aspect ratio and then anything that subsequently accesses it knows what the aspect ratio is. It doesn't need to be set again in mkvmerge for example.

juGGaKNot
8th June 2009, 20:33
I assume this is for x264? Anyway, the sar is the aspect ratio of the pixels that will result in the desired display aspect ratio. So, for example...

1920x1080 source, displayed at 16/9 (1920x1080): SAR 1:1
704x576 source, displayed at 16/9 (1024x576) : SAR 16:11
704x576 source, displayed at 4/3 (768x576) : SAR 12:11

To calculate SAR X:Y for a clip sx by sy resolution and a display aspect ratio of dx by dy:

X/Y = (sy*dx/dy)/sx

For the second example above (704x576, 16/9) that gives...

sx = 704
sy = 576
dx = 16
dy = 9

(sy*dx/dy)/sx = (576*16/9)/704 = 1024/704 = 16/11 (i.e. SAR 16:11)

In fact I think you can just set SAR to 1024:704 and x264 will automatically calculate the highest common factor for you and simplify it to 16:11.

This helps because the encode knows its aspect ratio and then anything that subsequently accesses it knows what the aspect ratio is. It doesn't need to be set again in mkvmerge for example.

I do not want to change the display mode so the SAR 1:1 i'm using is good.

thnx for the post.

cheers.