[vlc-devel] Implementing crop using the current vout API
david.fuhrmann at googlemail.com
Sat Mar 10 19:42:08 CET 2012
Some time ago, I browsed through the code as well in order to find the reason why crop does not work on mac.
All opengl vouts for other platforms seem to work flawlessly with crop. When I looked at the code for the linux opengl vout, I came to the conclusion that the results of all calls to placePicture (and similar) are only used for other vout variants, but not for the opengl one.
Therefore, as far as I understood, crop seems to be already implemented in opengl.c and works fine for other platforms.
Furthermore I noticed that when I have some crop ratio and set and I slowly resize the main window, the vout sometimes flickers between the distorted and the correctly cropped picture in a short time period. Because of this observation, I think that some crop is done actually, but it is wrongly rendered in some way.
But I have no knowledge on opengl, so I cannot help much further. Perhaps they are some ideas from the authors of opengl.c for this issue?
With best regards,
Am 10.03.2012 um 19:02 schrieb Felix Paul Kühne:
> Hello guys,
> as some of you might have seen on the forums or trac, cropping the video isn't supported in the 2.0.0 release of VLC for the Mac, mostly because I didn't know prior to release that the video output module needs to implement the functionality, since it isn't provided by the core (yet? at least, I get a "TODO FIXME" error message related to core crop when blocking crop events in the vout).
> Anyway, based upon the x11 vout, I cooked up a patch which provides the needed functionality quite nicely:
> However, this code does only work for a certain set of chroma formats and video sizes . Otherwise, I get repeatable crashes in swscale , the OS graphics driver  and the core's video filter functionality .
> Additionally, when changing the crop border, my debug log is spammed with error messages from the core about the use of "ThreadExecuteCropBorder". So I guess, this isn't the intended way to change the crop border? Or is this just a debug left over?
> Furthermore, there are artifacts when cropping 10bit content. 
> It would be really cool to get some advice on this issue, since I'm a bit stuck at the moment.
>  basically, the only working samples I got supporting all crop formats are H.264 (baseline profile) videos with Planar 4:2:0 YUV with a 16:9 AR. A native AR of 16:10 leads to the mentioned artifacts or crashes.
>  http://pastie.org/3565494
>  http://pastie.org/3565509
>  http://pastie.org/3565537
>  http://cl.ly/3P3G3a1P3U431K3d212K and http://cl.ly/2E3Z1d382s163n3i2B3u
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
More information about the vlc-devel