-
Notifications
You must be signed in to change notification settings - Fork 162
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
Improve jpg conversion speed a bit #56
Comments
Thanks @fjolublar! Any speed improvement suggestions are always very welcome. Would you be interested in providing an example program pair that illustrates your use of |
Of course. It`s a pleasure to contribute to this work. I will work on it. |
Thanks again for your pull request. Merged it. |
Thank you for giving me the opportunity. These were my very first Pull Requests :) |
+1 |
I tried this in my project, but didn't go well, at least as a drop-in replacement. if self.publish_cam:
self._rate.update()
#ret_code, jpg_buffer = cv2.imencode(".jpg", image,
# [int(cv2.IMWRITE_JPEG_QUALITY), camera.jpeg_quality])
jpg_buffer = simplejpeg.encode_jpeg(image,
quality=camera.jpeg_quality,
colorspace='BGR')
Outpost.publisher.send_jpg(camera.text, jpg_buffer) The call into
OK, Update. Disregard the above. Installing the newest version of numpy fixed that. And WOW it's much faster!! |
This is NOT an issue with the imagezmq library, but I wanted to express my opinion to improve some speed in the use cases where this library is used.
Instead of using OpenCV to encode/decode video frames, it might be better to use another library:
simplejpeg
.With some testing I did, the speed of jpg conversion was up 10 to 30% faster. In my case, I had to optimize every step of the transmission.
I have no affiliation with the library, just want to spread some knowledge.
The text was updated successfully, but these errors were encountered: