PDA

View Full Version : Algorithm to calculate source aspect ratio


Demone
4th June 2002, 10:46
I'm building my own player and I'm tring to resize a form keeping the aspect ratio of the video. No problem for the form resize, but how to calculate the right aspect ratio ?

Thx

Darksoul71
4th June 2002, 11:16
Hi Demone !

For AVI that´s no problem at all because AVI has square pixel. So to resize your Player form to the right AR you´ve just to calculate
the AR of the AVI. For example a AVI with a width of 384 and a height of 160 has the following AR:
384/160=2.4

Sor for a screen width of 640 your movie form has the height 640/2.4=266.666

For the rest you have to letterbox.

If you want to support "strange" formats like 720x288 and stretch to 720x576 during playback I would go for 4:3 AR for this calculation.

VCD PAL has a AR of 4:3 also. 352x288 has to be resized to 384x288 for square pixels. NTSC VCD with 352x240 has to be resized to 320x240 (AFAIK).

Hope this helps somewhat.

-D§

Demone
4th June 2002, 11:58
Ok thanks I did this way :)

Darksoul71
4th June 2002, 16:51
You´re welcome !

BTW: Not to insult you or something like this but why did you write your own video player ?
There are tons of free players out there.

cu,
D$

[Toff]
4th June 2002, 20:10
Yes there are tons of free players out there but there are not very good.
I just want a player that can play 2 cd divx keeping the right language and the right subtitle when switching from a cd to another.

Micro DVD Player and bsplayer can do that but you need to make an ini file for that.

I have too made a very simple player, I put it on my cd whith an autorun that do that :
DivXCDPlayer.exe cd:\part1.avi cd:\part2.avi cd:\french.sub cd:\english.sub

The player auto search for file on available cd players.

You can also start the player and drag & drop all the file you want.

You can do what you want when you make your own player.
Too bad there is no open source player.

BlackSun
7th June 2002, 10:25
PowerDivX 4 can do that :) but well maybe you can help me.

Ecris moi un PM si ça t'interesse, dejà de tester le player et ensuite je te presenterais le project 'nefertiti'

Nic
7th June 2002, 10:55
If christian were here he'd say:
Not PDivX4!! Core Codec Media Player!

But thats just christian :D

Im off to try the latest beta now, I havent done so in ages..... :) ill PM you BS with thoughts.

Cheers,
-Nic

Demone
7th June 2002, 16:29
Darksoul71, I'm a programmer and I wanted to try to use directshow
I really started to do a little proggie like to do these ogm(like oggmux)->mcf(gui for mode2cdmaker), after I thought to pass to something more interesting....and I found a player to be very cool to do :D .The problem is that I'm switching to vc and the player is currently in vb :rolleyes:

jj59
7th June 2002, 17:08
there is a open source (MPL) player at:\
http://www.recomp.hu/falcon/

[Toff]he also translated your MicroDVD MenuMaker 1.2

jj

BlackSun
11th June 2002, 08:23
Originally posted by Nic
If christian were here he'd say:
Not PDivX4!! Core Codec Media Player!

But thats just christian :D

Im off to try the latest beta now, I havent done so in ages..... :) ill PM you BS with thoughts.

Cheers,
-Nic

Hehe, no it's 'The Core Media Player' :)

Latexxx
5th July 2002, 13:09
Originally posted by BlackSun
PowerDivX 4 can do that :) but well maybe you can help me.

Ecris moi un PM si ça t'interesse, dejà de tester le player et ensuite je te presenterais le project 'nefertiti'

Maybe you could make the alpha versions (of project "nefertiti") public???