Log in

View Full Version : How to deal with pixel aspect ratio


qwerty1983
7th July 2013, 17:27
I have some dvb-t recordings (720x576, interlaced)

I do some editing with avisynth+vdub (deinterlacing, denoising, cropping) and i create an intermediate file with a lossless codec (huffyuv). I then use avidemux to encode the file with x264.

My avisynth script looks something like this :
.....
QTGMC(Preset="slow",TR2=2,Sharpness=0.5)
MCTemporalDenoise(settings="low",twopass=true,chroma=true)
crop (a1,a2,-a3,-a4)

The pixel aspect ratio for a 4:3 DAR is 12:11 and for a 16:9 DAR is 16:11 (PAL).

Should i add a final line on my script that will go something like this? :
Lanczos4Resize(720-(a1+a3)*12/11,576-(a2+a4)) -- square pixels

or should i keep the rectangular pixels telling my encoder(x264) what's the appropriate pixel aspect ratio (12:11 or 16:11)


Does it make any difference?

Asmodian
8th July 2013, 21:35
It is higher quality to leave the pixels as is and tell x264 to flag the aspect ratio.

Overdrive80
11th July 2013, 00:43
@qwerty1983 Like you know, DAR=PARxSAR. You can use option of x264, --sar width:height

In your case, if source´s DAR is 4:3, and DVD is PAL:

4/3=(720/576) x (width/height)

720/576=5/4

width/height= (4/3)/(5/4)= 16/15 (without crooping)

In x264 would be --sar 16:15

-----------------------------------------------------

4/3= [(720-(a1+a3))/(576-(a2+a4))] x (width/height) (with crooping)

Regards.

qwerty1983
11th July 2013, 14:02
In your case, if source´s DAR is 4:3, and DVD is PAL:

4/3=(720/576) x (width/height)

720/576=5/4

width/height= (4/3)/(5/4)= 16/15 (without crooping)

In x264 would be --sar 16:15


Thank you for your answer.
My dvb-t recordings have a par/sar(= pixel/sample aspect ratio) of 12:11 (for a 4:3 dar) and not 16:15 because not all of the 720 pixels are used for the active picture (there are black bars).
This is what avidemux tells me when it reads the metadata(??) of the video. And also VLC uses a sar of 12:11 when it plays the (unedited) videos.
http://img182.imagevenue.com/loc239/th_540065261_avidemux2_122_239lo.jpg (http://img182.imagevenue.com/img.php?image=540065261_avidemux2_122_239lo.jpg)


It is higher quality to leave the pixels as is and tell x264 to flag the aspect ratio.
Thank you for your response.

Overdrive80
11th July 2013, 15:14
Thank you for your answer.
My dvb-t recordings have a par/sar(= pixel/sample aspect ratio) of 12:11 (for a 4:3 dar) and not 16:15 because not all of the 720 pixels are used for the active picture (there are black bars).
This is what avidemux tells me when it reads the metadata(??) of the video. And also VLC uses a sar of 12:11 when it plays the (unedited) videos.
http://img182.imagevenue.com/loc239/th_540065261_avidemux2_122_239lo.jpg (http://img182.imagevenue.com/img.php?image=540065261_avidemux2_122_239lo.jpg)



The value that you is a ratio fit (reason of proporcionality, Im not sure if it say in english):

4/3= [(720-(a1+a3))/(576-(a2+a4))] x (width/height)

Of this way, you let to your player resize with properly resolution.

Also, avidemux info you that is "unknow (12:11)". I think that is a estimaded value by avidemux, maybe is value calculate on based active line but I dont know.

You can try method, and will see that resize is fine o not.