croppadd filter on Android VLC

VLC for Android and Chrome OS specific usage questions
gregoiregentil
Blank Cone
Blank Cone
Posts: 27
Joined: 30 Jan 2013 07:48

croppadd filter on Android VLC

Postby gregoiregentil » 19 Oct 2013 08:02

Based on the discussion in this thread: https://forum.videolan.org/viewtopic.ph ... d9a0f7a9e4

I have applied that patch: http://comments.gmane.org/gmane.comp.vi ... evel/81357 and added to libvlcjni.c:

libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
libvlc_set_video_filter(mp, "croppadd", true);

I have therefore support of the croppadd video filter in Android VLC.

I'm playing a 1024x1024 movie. In the resource file, the Android VLC surface is defined with "wrap_content" for both height and width. Therefore, I have a 1024x1024 surface and the movie is correctly played. When I apply the croppadd filter while playing, VLC correctly crops to 512x512 as shown in the log below. Nevertheless, it adds another filter to compensate the format change. So the movie is cropped to 512x512, scaled to 1024x0124, and then it appears scaled in the unchanged 1024x1024 surface.

10-18 11:11:24.794: D/VLC(11786): main video output: Adding 'croppadd' as interactive
10-18 11:11:24.794: D/VLC(11786): main filter: looking for video filter2 module matching "croppadd": 33 candidates
10-18 11:11:24.794: D/VLC(11786): croppadd filter: Crop: Top: 0, Bottom: 512, Left: 0, Right: 512
10-18 11:11:24.794: D/VLC(11786): croppadd filter: Padd: Top: 0, Bottom: 0, Left: 0, Right: 0
10-18 11:11:24.794: D/VLC(11786): croppadd filter: 1024x1024 -> 512x512
10-18 11:11:24.794: D/VLC(11786): main filter: using video filter2 module "croppadd"
10-18 11:11:24.794: D/VLC(11786): main video output: Filter 'croppadd' (0x75775984) appended to chain
10-18 11:11:24.794: D/VLC(11786): main video output: Adding a filter to compensate for format changes
10-18 11:11:24.794: D/VLC(11786): main filter: looking for video filter2 module matching "any": 33 candidates
10-18 11:11:24.804: D/VLC(11786): swscale filter: 512x512 chroma: NV12 -> 1024x1024 chroma: NV12 with scaling using Bicubic (good quality)
10-18 11:11:24.804: D/VLC(11786): main filter: using video filter2 module "swscale"
10-18 11:11:24.804: D/VLC(11786): main video output: Filter 'Swscale' (0x757435dc) appended to chain

I would like to avoid this step and have the surface changed to 512x512 so there is no VLC scaling. I have tried to update the surface size from the top java level when the filter is applied but VLC resizes it immediately back to 1024x1024.

Alternatively, I would love to apply the filter before the movie starts so that VLC understands that I want a 512x512 output not scaled, but VLC crashes if the filter is applied before the movie starts (I'm not sure why).

How can I figure out a quick and dirty solution?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: croppadd filter on Android VLC

Postby edwardw » 20 Oct 2013 18:24

This is because VLC has to scale the video to fit the size of the video output.

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: croppadd filter on Android VLC

Postby XilasZ » 21 Oct 2013 16:04

i think the core is asking for a new size at some point, but current android video output doesn't handle it (VOUT_DISPLAY_CHANGE_DISPLAY_SIZE), so it fallback to upscale.


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 29 guests