Log in

View Full Version : To crop or not?


kray
29th August 2007, 21:29
Hello,
I have a question about cropping
I have a ripped movie from a DVD of mine. I want to encode it in x264.
But what is the best solution for resizing/cropping?
Indeed, usually I encode my movie with a GUI without editing the script and it resizes in 720*404 without cropping the black bands.
So I thought that its stupid to compress this band and I decided to crop it
But I got a problem: Must I resize then crop or crop then resize?

I wanted to made a bench. Unfortunately I succeed only in writing the avs for "crop then resize":

DirectShowSource("C:\Drop\MVIE\VIDEO_TS\VTS_01_1.d2v",fps=25,audio=false)
#deinterlace
crop( 10, 74, -10, -68)
trim(100,400)
LanczosResize(696,304) # Lanczos (Sharp)
#denoise

indeed for resizing then cropping, I used my GUI to make the script(since I don't know where to crop after resizing) and it create this AVS:

LoadPlugin("C:\PROGRA~1\Video\RIAM\dlls\MPEG2Dec3.dll")
Source="C:\Drop\MVIE\VIDEO_TS\VTS_01_1.d2v"
Largeur=720 #width
Hauteur=404 #height
ratio =1.782178
vratio =1.782178
Crop_g=12
Crop_d=-12
Crop_h=54
Crop_b=-46
Indice=0.192364

Video=mpeg2Source(Source)
Video=trim(Video,100,400)
Video=LanczosResize(Video, Largeur, Hauteur)
Video=Crop(Video, crop_g, crop_h, crop_d, crop_b)
Return(Video)


The problem is that the trim doesn't extract the same part of movie(I dont know why)than in my other script, so I cant compare the differences.
The other concern is about dimension: the cropped video dimensions aren't 16 multiple and I wonder if x264 like it(it works, but is it optimized?)

So Finally I asked me this question and I Got no answer:
What is the best solution with movies with black band(Anamorphic?) in term of quality or/and size or/and encoding time beetween: cropping then resizing, resizing then cropping, no resize at all: encode the black band
(and optionnaly what is the difference between the script use by the GUI that use mpeg2source and the one using directshow?)

Thank you very much and sorry for my awful english :)

PuzZLeR
29th August 2007, 21:58
Welcome to the forum.Thank you very much and sorry for my awful english :)Understood you clearly. :) This forum has many folks from many countries where English is not their first language. There is nothing to be concerned about.

As for your question, cropping is seriously a matter of taste and opinion. There is no right answer as to whether you should or not. Probably the next post will give you tips on how to crop the correct way, but I will tell you, for the sake of discussion, why I, and others, don't bother.

1) I could do without the extra work. Cropping is not the exciting part of this hobby. Sometimes these borders aren't consitent throughout a movie anyway and you could, if you don't notice, accidentally eliminate footage. It's time consuming going through this. AVISynth can adjust different crops for each frames and resize but you'd be messing with aspect ratio in the process.
2) Alot of "auto crop" procedures never work properly or optimally anyway, in case you want to save time.
3) One mistake and you could distort the aspect ratio. See 1).
4) I personally consider the black borders as part of the whole production. Killing them means killing a part of the clip.
5) Cropping changes resolution. Some prefer the original resolution of the source as closely as possible for a more "natural feel". I personally use 640x480 for small files like music videos, but use anamorphic for other content.
6) I stick with one "standard" or format. In fact, the closer to the source, the more "standard". I have a nagging suspicion that it may affect its long-term wide-compatibility if you change the rez/size. But maybe I'm being neurotic on this one.
7) Alot of the reason for cropping is to save bitrate. However, since I use CRF alot, the encoding doesn't add much, if any, bitrate to those black areas.
8) Playback apps like VLC automatically adjust to the screen and remove the black borders for you in decoding/playback if done right anyway.

But like I said, that's me, and my tastes. :) I find it alot of work for little benefit, and it may even be counterproductive.

mr soft
29th August 2007, 22:27
:thanks:

I think you have just answered a lot of potential threads.

:goodpost:

kray
8th September 2007, 09:59
Ok! thank you.
For me, the only reason to crop is to save size on disk, but not to have a "fullscreen" image( In answer to point 8, if I have understood it ;) )
So, I was just wondering if encoding black border takes time and size.
It's seems that it's not so time/size consuming.


(What is CRF? I googled it, but no good anwser)

Manao
8th September 2007, 11:30
I'll give a completely different advice : remove black borders at all cost. They aren't part of the movie, they shouldn't be there. Furthermore, even though they don't take much bitrate to encode, they completely mess up the motion estimation close to the border of the frame and that leads to unefficiency ( the bitrate isn't lost in the border, but in the frame itself ).

Finally, the mpeg2 source tends to have a lot of ringing at those borders, because it wasn't cropped. That means a black border also has a negative effect on quality.

So, crop, then resize if you need to resize. It's worth the trouble.

Terranigma
8th September 2007, 14:48
Finally, the mpeg2 source tends to have a lot of ringing at those borders, because it wasn't cropped.
I always wondered why there was smearing and ringing on the edges mpeg-2 sources, now I know. :D Would it be worth it to completely crop off these areas that exhibits this, even if it requires for you to over crop?

Manao
8th September 2007, 14:54
Would it be worth it to completely crop off these areas that exhibits this, even if it requires for you to over crop?That means accepting to sacrifice some parts of the original content. It's only 3/4 pixels, so it's not a lot, but I can understand perfectly people that want to keep the whole non-black area.

Personnally, I would overcrop if it's excessively ringed.