VideoFilterPreviewView rotation only rotate the view, not content
Hi, I'm currently trying to apply rotation to video preview together with filter preview. I apply it by using android:rotation to the com.linkedin.android.litr.preview.VideoFilterPreviewView. I've tried this within litr-demo:VideoFilterPreviewFragment.
but the video content being played is not rotated, instead it is stretched weirdly based on rotated view area. How can I correctly rotate the content for the VideoFilterpreview?
Hi. Are you trying to display the video rotated by 90 degrees without actually modifying it? According to ExoPlayer devs, that is not supported with SurfaceView (which VideoFilterPreviewView inherits). What are you trying to achieve? Maybe there is a different way...
I'm currently working on short video editing app, where user could apply transformation: filter and rotation. First page would be editing page where gives preview to how video looks after transformation without modifying source video, then after user confirm the results, I will apply the given transformations. The filter preview could be achieved through VideoFilterPreviewView, but couldn't find the solution for preview video rotation.
Yes, one possible workaround would be by actually modifying the source video directly for rotation, but kinda hoping there's way to do it so it is "aligned" with how filtering works
One thing that comes to mind is using DefaultVideoFrameRenderFilter with a Transform that has 90 degree rotation. Do you mind trying this?
I've tried the DefaultVideoFrameRenderFilter and could confirm it does work, though with some notes.
The user might need to handle the change of aspect ratio themselves and adjust the player size accordingly.
Also since this utilize VideoPreviewRenderer.setFilter, it can't be used together with other graphic filter (e.g. : BrightnessFilter, GrayscaleFilter).