Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live streaming #5

Open
johnbird7 opened this issue Nov 26, 2020 · 3 comments
Open

Live streaming #5

johnbird7 opened this issue Nov 26, 2020 · 3 comments

Comments

@johnbird7
Copy link

Hey Hugand. Love your work. So I've been trying to send live frames to server after converting to base64. But the conversion from yuv to normal image for every image captured takes a lot of time. Is it possible to make it real-time? I just want to send every frame to the server and I can't convert yuv or bgra directly to base64 . Please help.

@ugu11
Copy link
Owner

ugu11 commented Nov 27, 2020

Converting the image from YUV to RGBA on the server should be faster, so I believe you can convert the _savedImage.planes list to base64, send that over to the server, and if you need you can convert it to RGBA. I haven't converted an image to base64 with dart/flutter before, but I believe you can find a solution to here: https://stackoverflow.com/questions/50036393/how-to-convert-an-image-to-base64-image-in-flutter

@johnbird7
Copy link
Author

Thank you for the quick response.
I am able to send the _savedImage.planes list to redis and on server I'm reading the same. I work with python and opencv for image processing. Is there a way to convert these to save jpg/png on disk? I haven't worked with yuv420 and bgra8888 .. If python/C is easy for you, could you please share a function that takes planes as args and return the imagepath saved on disk?

@ugu11
Copy link
Owner

ugu11 commented Nov 28, 2020

I've never used python with C, but I'm pretty sure there is an easier way to do the yuv to rgba conversion with python and opencv. I did a quick search and I came across this:
https://stackoverflow.com/questions/60729170/python-opencv-converting-planar-yuv-420-image-to-rgb-yuv-array-format
https://gist.github.com/Quasimondo/c3590226c924a06b276d606f4f189639
https://www.programmersought.com/article/7067280860/

I hope this helps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants