[MPlayer-users] DVD rip Crop & scale little problems

Alain Barthélemy cassandre at bartydeux.be
Wed Aug 4 09:42:39 CEST 2004


Le Tuesday 03 August 2004, 19:06:38 ou environ JiHO <jo.irisson at noos.fr> a écrit:
> Alain Barthélemy wrote:
> 
> >Thus how can I calculate manually the cropping and rescaling of the image? 
> >Or
> >is scale=576:-2 the right way to do it?
> 
> don't you want to use the "autoaspect" option of mplayer?
> do you absolutely want to scale down the movie?
> 
> if the answers are no and yes, in that order ;), the solutions I see are:
> 
> Crop and take care of the "16 rule" while scaling:
> 1/ use cropdetect and check that even the half black pixels of the edges 
> are taken of. after that you come with cropping dimensions to feed to vf 
> crop.

I got "718:432:2:72"

> 2/ play the dvd with mplayer dvd://1 -vf crop "your_dimensions"
> in the output of mplayer you can see a line of the form:
> VO: [xv] 706x426 => 1004x426 Planar YV12
> if you are using xv for example.

mplayer dvd://1 -vf crop=704:432 ==> VO: [xv] ... => 1001x432


1001/432 = 2.31... => about 2.35 (cinemascope)

Do I understand that mplayer detected correctly an anamorphic resizing and
resized the movie accordingly to cinemascope size.

Thus movie is stored as 720x576 PAL (1.25:1). If I do a cropdetect, it is that
image that is cropped (704:432)=>1.66:1 but the original aspect is kept if I
rescale the image manually with "-vf crop=704:432,scale=640:272". 704/432 is
not equal to 640/272! Thus mencoder restores automatically the full size
aspect. That is what disturbed me. But I followed literally your instructions
and I got a movie with the right size.

> 3/ from this line you know which dimensions are to be used in order to 
> have a correct aspect ratio: they are 1004x426 in that example. you can 
> use a simple factor to scale these down to what you want. let say 576.
> 1004 -> 576
> 426  -> ?
> the height should be: 426 x 576 / 1004 = 244,4 = 244

1001 -> 432
640 -> 272 (2.35:1)


> 4/ then the problem is that the height is not likely to be divisible by 
> 16. you must choose the nearest 16 multiplier which is 15 x 16 = 240.
> 
> With this solution you loose no pixel of the video and you distort a 
> little bit the scale. nevertheless, if the nearest 16 multiplier is 
> close of your calculated height, you are likely to notice nothing.
> 
> Crop and care about the 16 rule before scaling:
> same first three steps, then
> 4/ modify your cropping so that the calculated height is divisible by 
> 16. I looked for a formula that will allow you to calculate it easily 
> but I can't find a solvable equations system. so I guess it's just trial 
> and error.
> 
> With this method you are likely to crop much more than needed of the 
> video but your output's scale will be perfect.
> 
> hope that helps.
> -- 
> JiHO
> ---

I make a small test yesterday and I got a 2.35:1 image. I'll try that on my
standalone reader.


-- 
Alain Barthélemy
cassandre at bartydeux.be
http://bartydeux.be
Linux User #315631




More information about the MPlayer-users mailing list