2

I've got an application in React Native to be developed in Android and iOS, in which I'd like to take the camera stream, make some processing, and render it multiple times.

Imagine an app like Instagram, in which you can add filters to the camera live and it shows the applied filters with on live previews. It would be more or less the same.

I need to get the camera stream and be able to show it on screen multiple times.

I've tried react-native-camera, but it only lets me to get one instance of the camera to be shown.

With this same library, I've tried to take pictures in intervals of the camera and to render them via <Image> container but, of course, it's a performance kill and the app ends up crashing.

How can I achieve what I'm trying to do? Do you know of any module or any approach that allows me to do so?

Thank you.

Unapedra
  • 2,043
  • 4
  • 25
  • 42
  • I don't think there any modules that do this explicitly. There's WebRTC module that has this functionality but it would be an overkill to use it just for that. – Teivaz Dec 12 '17 at 14:34
  • Thank you @teivaz! I was thinking about some kind of OpenGL module that accepts the camera stream (for example, take a stream from WebRTC module and pass it to multiple OpenGL instances that could render the stream with some processing made). I don't know if that makes any sense, but I don't know not even from where can I start... – Unapedra Dec 12 '17 at 14:39
  • there's a couple of libraries that wrap native streams like [video-stream](https://www.npmjs.com/package/react-native-video-stream) or [videocore](https://www.npmjs.com/package/react-native-videocore). You can start with them. – Teivaz Dec 12 '17 at 18:08
  • Thank you! Those are only for iOS, though! I'll start with them and let's see if I find something more suitable for my project! Thank you for your time and recommendations! – Unapedra Dec 13 '17 at 07:45
  • Hey have you found a fix for this? – iThompkins Aug 12 '19 at 02:25
  • Unfortunatelly, no. Maybe there's some kind of workaround for that now, because it's been a long time since I stopped working on this project. But I did not found any solution by that time. – Unapedra Sep 04 '19 at 09:37

0 Answers0