[Mplayer-dvb] ANNOUNCEMENT: mplayer.sh 0.0.4 ready

Arpi arpi at thot.banki.hu
Mon May 6 23:46:52 CEST 2002


Hi,

> If youre interested you can download it at 
> http://ma.hoff.bei.t-online.de/mplayer.sh/mplayer.sh004.tar.gz

nice work...

some comments:

DVB card allows near any X resolution (n*16 ?) with Y=576, at least (tested)
352, 480, 512, 640, 704, 720

it seems with Y=288 it only allow X=352 :(

now, you have ORIG_X and ORIG_Y, the w/h of the movie
you should find the next dvb-accepted width (DVB_X) to ORIG_X.
now, get pixel size from:  DVB_X/576 = 4:3 (or 16:9 for 16:9 TV)
  PIXEL_WIDTH=(DVB_X*3)/(576*4)
it will be 1.0 for 768x576, <1 for DVB_X<768

and calc scaled Y size:

SCALED_Y=ORIG_Y*(DVB_X/ORIG_X)/PIXEL_WIDTH

in most case, (DVB_X/ORIG_X) will be 1.0, as DVB accepts the commonly used
movie widths, but Y scaling will be done as PIXEL_WIDTH < 1.0

now run mplayer with -vop lavc,expand=DVB_X:576:-1:-1:1,scale=DVB_X:SCALED_Y

let's test it with an example:

i have 13th Floor in divx:

VIDEO:  [DIV3]  512x240  24bpp  25.00 fps  690.2 kbps (84.2 kbyte/s)

going through the above calcs:
optimal DVB_X=512
PIXEL_WIDTH=(512*3)/(576*4) = 0.66667
SCALED_Y=240*(512/512)/0.66667=360

so, i should use:
-vop lavc,expand=512:576:-1:-1:1,scale=512:360

and yes, it is working well, just tried!

note: the extra parameters to expand enables OSD/SUB rendering

note 2: yes, your script also work, but it will upscale to 720, causing much
more cpu load (by sw horizontal scaling and by mpeg1 encoding of 1.5 times
bigger area)

note3: you shouldn't guess video codec (-vc odivx/mpegpes), mplayer does it
much better! and ffodivx is faster than odivx...

note4: just tried, it seems DVB supports any width from 100 to 720 !
it work with 768 too but my TV cannot display that picture, it's running...
-> the step of finding optimal DVB_X can be left out...
so things are even simpler:

SCALED_Y=ORIG_Y*(576*4)/(ORIG_X*3)=768*ORIG_Y/ORIG_X
and -vop lavc,expand=ORIG_X:576:-1:-1:1,scale=ORIG_X:SCALED_Y

to verify, my example of 512x240 gives 768*240/512=360 ! so it's ok.

note5: if you can update the script, i'll include it with mplayer, in TOOLS/


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dvb mailing list