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 26th September 2005, 11:33   #1  |  Link
amango
Registered User
 
Join Date: Oct 2002
Posts: 92
Correct Aspect-Ratio in x264?

I used XVID all the time to encode PAL DVB-streams - now I want to test x264.

Most streams I encode are in 720x576. In XVID I selected the 4:3-PAL setting for the Aspect-Ratio, so the video will be stretched correctly during playback.

In x264 I have the option "Sample AR".

I would like to know what settings I need to type in for correct 4:3-PAL and 16:9-PAL in x264.
amango is offline   Reply With Quote
Old 26th September 2005, 11:37   #2  |  Link
stephanV
gone
 
Join Date: Apr 2004
Posts: 1,709
4:3 PAL = 12:11
16:9 PAL = 16:11

If you use these settings you are doing it the same way in x264 and XviD.
stephanV is offline   Reply With Quote
Old 26th September 2005, 11:39   #3  |  Link
amango
Registered User
 
Join Date: Oct 2002
Posts: 92
Thank you!
amango is offline   Reply With Quote
Old 26th September 2005, 11:53   #4  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,216
Or......

PAL 4:3 DAR = 16:15
PAL 16:9 DAR = 64:45

NTSC 4:3 DAR = 8:9
NTSC 16:9 DAR = 32:27

EDIT: In February 2006 I conceived a tool called ARS Calculator to help people work out Aspect Ratio Signalling (ARS) ratios (ie: PAR, SAR, DAR) for use with encoders such x264 and XviD


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 2nd October 2006 at 16:10.
SeeMoreDigital is offline   Reply With Quote
Old 26th September 2005, 12:13   #5  |  Link
amango
Registered User
 
Join Date: Oct 2002
Posts: 92
What's the formula...?

Sometimes I have DVB-streams in 480x576 or 704x576 PAL. Can I also set the correct AR in x264 for this resolutions...?
amango is offline   Reply With Quote
Old 26th September 2005, 12:51   #6  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,216
Personally speaking I prefer to use the (4:3 or) 16:9 DAR calculations because they will always output an (4:3 or) 16:9 shaped image, regardless of the sources pixel size/ratio.


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 26th September 2005, 16:52   #7  |  Link
stephanV
gone
 
Join Date: Apr 2004
Posts: 1,709
Quote:
Originally Posted by amango
What's the formula...?

Sometimes I have DVB-streams in 480x576 or 704x576 PAL. Can I also set the correct AR in x264 for this resolutions...?
PAR (or SAR) = DAR*height/width
stephanV is offline   Reply With Quote
Old 29th September 2005, 14:34   #8  |  Link
fatxy
Registered User
 
Join Date: May 2003
Posts: 63
which player besides vlc can handle that properly?

tested zoomplayer with ffdshow without success

Last edited by fatxy; 29th September 2005 at 14:36.
fatxy is offline   Reply With Quote
Old 29th September 2005, 14:39   #9  |  Link
stephanV
gone
 
Join Date: Apr 2004
Posts: 1,709
enable overlay mixer in ffdshow
stephanV is offline   Reply With Quote
Old 29th September 2005, 15:08   #10  |  Link
fatxy
Registered User
 
Join Date: May 2003
Posts: 63
thanks i changed the output to overlay mixer for both ffdshow and zplayer
i only get a black screen :/
fatxy is offline   Reply With Quote
Old 29th September 2005, 15:17   #11  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
Added more info on SAR in the daily builds FAQs.
Sharktooth is offline   Reply With Quote
Old 29th September 2005, 15:37   #12  |  Link
stephanV
gone
 
Join Date: Apr 2004
Posts: 1,709
Quote:
Originally Posted by fatxy
thanks i changed the output to overlay mixer for both ffdshow and zplayer
i only get a black screen :/
Thats sucks... have you tried MPC?
stephanV is offline   Reply With Quote
Old 29th September 2005, 17:21   #13  |  Link
JoeBG
stupid
 
JoeBG's Avatar
 
Join Date: Sep 2004
Location: Cologne
Posts: 638
Quote:
Originally Posted by fatxy
thanks i changed the output to overlay mixer for both ffdshow and zplayer
i only get a black screen :/
overlay mixer and ffdshow work perfect in zplayer. You can also take Video Mixing Renderer 7 and ffdshow. Looks great
__________________
cu

Joe
------------------------
freedom is just another word for nothing left to loose
JoeBG is offline   Reply With Quote
Old 29th September 2005, 18:46   #14  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,216
Just in-case anybody needs to know, here are the FFdshow "overlay settings" I use in-conjunction with MediaPlayer Classic: -



Encodes with AR signalling in AVI, MP4, MKV and OGM work perfectly....


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 29th September 2005, 21:13   #15  |  Link
fatxy
Registered User
 
Join Date: May 2003
Posts: 63
ok thanks a lot

zplayer vmr and ffdshow overlay mixer works (thought i have to use it for both), not as smooth as vcl but its workin (i have to click on fit source one time)

besides i dont really know what to do with those crappy 480x576 streams

480x576 autozoom to 768x576

or somethin like

480x576 encode to 640x480 or even 768x576

Last edited by fatxy; 29th September 2005 at 21:27.
fatxy is offline   Reply With Quote
Old 29th September 2005, 21:48   #16  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
Quote:
Originally Posted by stephanV
PAR (or SAR) = DAR*height/width
In case of respecting the actual "real" DAR of your source then it makes sense.

Good Example a 52.000Ás capture:
DAR = 1,3333 * 576 / 702 = almost 1,094:1 = PAR 128:117
Here a 702x576 is truely DAR 4:3 @ PAR 1,094

Bad example, a fullscreen 720x576 DVD as source:
DAR = 1,3333 * 576/720 = 1,06664 = the common error of generic par happens here

720 * (128/117) / 576 = DAR 1,3675:1 equals not 4:3 (1,3333)

DAR = 1,3675 * 576 / 720 = PAR 1,094:1 = ok





Quote:
480x576 autozoom to 768x576

or somethin like

480x576 encode to 640x480 or even 768x576


480x576 px sources do have 53,3333us (same as 720x576).
768x576 do have 52,0000us

53,3333/52,0000 = 1,02564 <--- our diff. factor!

So do resize 480 x 576 to 768*(1,02564) x 576 = 788x576

or do crop 480 x 576 to 480/1,02564 x 576 = 468x576 and resize to 768x576



If you do respect these your eyes when watching mpeg4s via HTPC will kiss you.

Last edited by Inc; 29th September 2005 at 21:54.
Inc is offline   Reply With Quote
Old 29th September 2005, 22:16   #17  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,216
Lookie here... I've made some Anamorphic Test Files for you guys to try!

Provided you have the correct decoder filters installed they should all open up at 16:9...


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 19th January 2006 at 17:49.
SeeMoreDigital is offline   Reply With Quote
Old 19th January 2006, 16:56   #18  |  Link
Piper
Registered User
 
Piper's Avatar
 
Join Date: Jul 2002
Location: Canada
Posts: 196
@Incredible:

Quote:
Good Example a 52.000Ás capture:
DAR = 1,3333 * 576 / 702 = almost 1,094:1 = PAR 128:117
Here a 702x576 is truely DAR 4:3 @ PAR 1,094
The only part I don't follow is how you derive PAR 128:117 from 1,094:1. What's the calculation being used here?

Thanks
Piper is offline   Reply With Quote
Old 19th January 2006, 17:12   #19  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
Full TV PAL is 768x576 @ 52.000Ás @ 14,7692307Mhz (= quadra pixels)
ITU samplingrate is 13,5 Mhz (= squarepixels)

14,7692307/13,5 = 1,094017 = TV PAR @ 13.5Mhz used by a SAP

or ...
52.000Ás * 13.5Mhz = 702 active pixels at square pixels
52.000Ás * 14,7692307Mhz = 768 active pixels at quadra pixels

768/702 equals 128/117 equals 1,094017


Last edited by Inc; 19th January 2006 at 17:15.
Inc is offline   Reply With Quote
Old 19th January 2006, 18:26   #20  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,216
That's fine for anamorphic encodes with pixel frame width of 702....

However, if you want to generate spec PAL video files with a target aspect ratio of 4:3 based on a pixel frame width of 720, I would recommend you use the following calculation: -

768/720 = Lowest fraction = 16/15 (Decimal = 1.094017)


However, if you want to generate spec PAL video files with a target aspect ratio of 16:9 based on a pixel frame width of 720, I would recommend you use the following calculation: -

1024/720 = Lowest fraction = 64/45 (Decimal = 1.422222)


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Reply

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:23.


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