mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.44k stars 1.09k forks source link

how to return Frame from frameprocessor and display it on screen #1262

Closed zheniagnedchik closed 1 year ago

zheniagnedchik commented 2 years ago

Question

how to return Frame from frameprocessor and display it on screen

What I tried

how to return Frame from frameprocessor and display it on screen

VisionCamera Version

2.1.14

Additional information

thomas-coldwell commented 2 years ago

This will be enabled by #1198 soon - just need to add Android support!

zheniagnedchik commented 2 years ago

This will be enabled by #1198 soon - just need to add Android support!

For ios, the functionality in this pr is already working?

thomas-coldwell commented 2 years ago

Yes you can use it already for iOS with the useSyncFrameProcessor hook, but please be aware this might change. Revisiting the PR shortly as I got busy with work, but will be working on Android support next week. Cheers!

zheniagnedchik commented 2 years ago

Yes you can use it already for iOS with the useSyncFrameProcessor hook, but please be aware this might change. Revisiting the PR shortly as I got busy with work, but will be working on Android support next week. Cheers!

Thank you very much for the detailed answer) can you please tell me if it is possible to take a photo with the filter applied?

xulihang commented 2 years ago

I convert the frame to Bitmap/UIImage and then convert it to base64: https://github.com/tony-xlh/vision-camera-dynamsoft-label-recognizer/blob/328624d0d1daf3583886d2958a938ac90963bfdc/ios/VisionCameraDLRPlugin.swift#L88. Don't know if there are better options.

thomas-coldwell commented 1 year ago

Thank you very much for the detailed answer) can you please tell me if it is possible to take a photo with the filter applied?

Hey @zheniagnedchik - its not currently implemented, but support will definitely be added :)

thomas-coldwell commented 1 year ago

Going to also mark this as a duplicate of https://github.com/mrousavy/react-native-vision-camera/issues/724. We are actively working on adding support for write-back frame processors in Vision Camera V3 (the in-progress PR for this functionality can be found at https://github.com/mrousavy/react-native-vision-camera/pull/1198).