Closed pratheepchowdhary closed 6 years ago
I can do it. I detect a crash with gif, images and text but it has an easy fix that will be update in the next days (no time now). To fix replace in openglview:
//need load a stream object
if (loadStreamObject) {
if (textStreamObject != null) {
managerRender.setText(textStreamObject);
} else if (imageStreamObject != null) {
managerRender.setImage(imageStreamObject);
} else if (gifStreamObject != null) {
managerRender.setGif(gifStreamObject);
} else {
managerRender.clear();
}
}
To:
//need load a stream object
if (loadStreamObject) {
if (textStreamObject != null) {
managerRender.setText(textStreamObject);
} else if (imageStreamObject != null) {
managerRender.setImage(imageStreamObject);
} else if (gifStreamObject != null) {
managerRender.setGif(gifStreamObject);
} else {
managerRender.clear();
}
if (surfaceManagerEncoder == null) loadStreamObject = false;
}
Of course in activity example you need delete this conditional: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/java/com/pedro/rtpstreamer/openglexample/OpenGlRtmpActivity.java#L105
K Thank you.....
And how to preview local video stream after applying filters and water marks
No preview available streaming a file for now. It need be developed.
K How to make AndroidViewFilter fit to the video view width and height Accordingly Now it will show according screen resolution of mobile How to make it according to video resloution
Go xml, create a layout with match parent size and set it to androidviewfilter. Now you have a layout that fit stream. You can hide this layout behind other view to avoid duplicate view in the activity.
Still remains the same issue It will takes the same screen size Is there is any way to fix it programmatically In canvas by giving width and height of video
Ok, this error is only with stream file mode. I'm looking a fix for it.
please fix it bro
I try it but for now I can't find a solution. The problem is that you need resize canvas to adjust to stream resolution. I did severals test with a device 1920x1080 screen resolution and I cant find a mathematical relationship. If you are in portrait resize values is 1080x1530 (setted in this line: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/OffScreenGlThread.java#L203)
K Another issue is that while adding jpg images as watermark in file stream the it will shows completly white screen with watermark image I tried to convert jpg to png same result But I use already extisted png images works good but with jpg come white screen is there is any solution
Can you send me an image capture and jpg image that produce error?
Can you send me an image while you are streaming please?
Ok, I understand now. I have to fix the overlay in all stream but the rest is jpg problem but jpg has not alpha so you can't provide a transparency like I do with png and if you convert an image jpg to png the result is an image without transparency because the original image has not it. In this case: 0 -> 100% transparency 1 -> 0% transparency (opaque)
JPG image alpha always 1 because this format has not transparency then you convert to png that has transparency but original transparency is 1 so the result is png with 1 transparency.
How can you fix it (this is a concrete fix for your case)? using a concrete color like transparency (like in chroma stage with green color) in your case white color is good choice.
To do it go to watermark shader: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/encoder/src/main/res/raw/watermark_fragment.glsl#L14 Replace that line to:
if (watermarkPixel.a <= 0.5 || watermarkPixel.rbg == vec3(1.0, 1.0, 1.0)) {
This will filter pure white color but I test and no totally filter in your case so I recommend you filter grey scale totally like:
if (watermarkPixel.a <= 0.5 || (watermarkPixel.r == watermarkPixel.b && watermarkPixel.b == watermarkPixel.g)) {
Overlay in all stream size is fixed now: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/commit/936e58afe92534f4fece30630890f8dfbb718140
K it's working Thank u
Hello sir how to preview the filter effects and watermarks before the stream by apply effects and watermarks before stream it will not showing it while streaming only it works so please guide me sir