question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AndroidViewFilterRender preview size issue

See original GitHub issue

I’m using AndroidViewFilterRender as a filter but the preview is so big. The stream is good but the preview in phone isnt normal.

Screenshot_20191031-210111 (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:closed
  • Created 4 years ago
  • Comments:21 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
wendrawangcommented, Nov 12, 2019

i found the way to fix it. to preview the stream, dont hardcode the resolution size just using this (in Kotlin) :

width = resources.displayMetrics.widthPixels
height = resources.displayMetrics.heightPixels

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!

0reactions
pedroSG94commented, Nov 11, 2019

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’

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found