VLC crops videos incorrectly
Video crops incorrectly
VLC crops X properly but when it should crop Y it instead enlarges X. Which is incorrect behavior.
Why: Cropping a video should never have a result larger than the original size in both X and Y. Just as cropping a physical picture will always make it smaller.
To reproduce the problem:
- Have VLC play a video that has a resolution that is smaller than your screen resolution.
- Restore VLC's window. (Not maximized or minimized)
- cycle through crop modes by pressing 'c'. (default hotkey)
these are the results of an experiment conducted with a 1920x1080 video.
=factor= | =crop mode= | =expected behavior= | =VLC's behavior= |
---|---|---|---|
1.77 | default | 1920x1080 | 1920x1080 |
1.6 | 16:10 | 1728x1080 | 1728x1080 |
1.77 | 16:9 | 1920x1080 | 1920x1080 |
1.85 | 1.85:1 | 1920x1037.84 | 1998x1080 |
2.21 | 2.21:1 | 1920x868.78 | 2386.8x1080 |
2.35 | 2.35:1 | 1920x817.02 | 2538x1080 |
2.39 | 2.39:1 | 1920x803.35 | 2581.2x1080 |
1.66 | 5:3 | 1800x1080 | 1800x1080 |
1.33 | 4:3 | 1440x1080 | 1440x1080 |
1.25 | 5:4 | 1350x1080 | 1350x1080 |
1 | 1:1 | 1080x1080 | 1080x1080 |
- Factor is X:Y in decimal form. (16:10 == 16/10 == 1.6)
- As we can notice in the third column, VLC seems to only care about modifying X. This is not always correct.
To fix:
VLC must consider the factor of the video and the factor of the desired crop.
- If | A crop mode's factor is smaller than the video factor, X should be cropped.
- If else | when a crop mode's factor is larger than the video factor, Y should be cropped.
- Else | And if it is equal, no changes will be made.
Video factor can be obtained by dividing the video's X by it's Y. For example to get the factor of 800x600, one must divide 800 by 600 (f = 800/600).