Skip to content

Problem resizing 4k video

Hi @Dekans , @jbk , @tguillem. I am having problems resizing a 4k video. My method works perfectly with sd and HD videos but when I try to resize a 4k video, it does not seem to work (the video image is cut in the bottom).

With the values below the vlc library is not able to fit the 4k video inside the boundaries I defined. However, when I double height and width the 4k video fits in the boundaries without getting cropped.

x=10, y=120, w=460, h=260

private void pigVideoLayout(int h, int w, int x, int y){
        aLog.i(mTAG, "pigVideoLayout()");
        SurfaceView videoView = vlcVideoLayout.findViewById(R.id.surface_video);
        FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) videoView.getLayoutParams();
        params.height = h;
        params.width = w;
        params.setMargins(x,y, 0, 0);
        videoView.setLayoutParams(params);
    }

I include some pictures below which describe how 4k does not fit in the boundaries and hd videos does.

hd_full_Screen

hd_cropped

4k_full_screen

4k_cropped

Edited by Angel Rodriguez