AndroidViewFilterRender preview size issue
See original GitHub issueI’m using AndroidViewFilterRender as a filter but the preview is so big. The stream is good but the preview in phone isnt normal.
(HUAT.LIVE text is cropped on top)
im using ConstraintLayout and using it like this :
val viewRender = AndroidViewFilterRender()
viewRender.view = custom_view
rtmpCamera.glInterface.setFilter(0, viewRender)
custom_view is a layout which is match parent from this screen, it has HUAT.LIVE text, description text, chinese text and also price text
i also using preview size like this:
rtmpCamera.startPreview(CameraHelper.Facing.FRONT, 1280, 720)
and using stream size like this:
rtmpCamera.prepareVideo(1280, 720, 30, 1200 * 1024, false, CameraHelper.getCameraOrientation(this))
Thanks !
Issue Analytics
- State:
- Created 4 years ago
- Comments:21 (12 by maintainers)
Top Results From Across the Web
How to manage dynamic stream preview aspect ratio ... - GitHub
In portrait i have set 720 width and 1280 height and might be this was a problem . If i set width =...
Read more >Android Camera Preview Stretched - Stack Overflow
I'm using this method -> based on API Demos to get my Preview Size: ... You are able to fix this issue if...
Read more >How to programmatically control Preview size of Android ...
We use the capture size to dictates the width and height of the preview. It is important to note that the preview size...
Read more >Android Camera Preview Stretch Issue - MindBowser
The most important bug in the Camera Preview Stretch Issue is the ratio given to display a camera preview. So if the preview...
Read more >com.pedro.rtplibrary.view.GlInterface java code examples
Facing#FRONT} * @param width of preview in px. ... case R.id.android_view: AndroidViewFilterRender androidViewFilterRender = new AndroidViewFilterRender(); ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

i found the way to fix it. to preview the stream, dont hardcode the resolution size just using this (in Kotlin) :
and use it like this (it seems the variable is switched, width as height, height as width)
rtmpCamera.startPreview(CameraHelper.Facing.FRONT, height, width)rtmpCamera.prepareVideo(height, width, 30, 1200 * 1024, false, CameraHelper.getCameraOrientation(this))Thanks Pedro for this awesome library!
Try with this commit: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/commit/9839512cbb295bd7c2cce7c4dc2e8cb34fc9d584
implementation ‘com.github.pedroSG94:rtmp-rtsp-stream-client-java:previewfiltertest-SNAPSHOT’