Reputation: 5770
I got a Google Pixel and tried recording a video with the official app, I found out there is a remarkable built-in stabilization mechanism happening on the recording, so if I shake my hand a bit this movement is only slightly transferred to the recording (even the video preview is impressively stable).
However I tried with my own Video recording app and this stabilization is not happening.
I of course tried with the setVideoStabilization()
method over at the official docs but the result is not as good as with the builtin Camera app.
Is there anything else I am missing?
Upvotes: 13
Views: 4335
Reputation: 16600
If you don't want to wait, an alternative is to read this amazing article on content unshaking using the accelerometer (with sourcecode here).
This was done to unshake the phone's content (to ease reading in moving transport for example), but it's the same logic you can apply to video feeds from the camera.
However, don't expect to get the same results as Google's approach. Indeed, this can only do software stabilization, which will move around your image, and thus crop it. To avoid cropping and luminance change, Google's uses Optical Image Stabilization, which mechanically moves the lens, and thus avoids any cropping. However, OIS is not yet supported on all phones, so take this into account if you use Google's API in your app.
Upvotes: 0
Reputation: 197
Wait for Google to release it in their API.
From previous experience new features generally take a little while to get through for us all to use in API form.
In the meantime try and get the attention of the experts here: https://code.google.com/p/android/issues/list. You may get it pushed into an update earlier even
Upvotes: 0
Reputation: 5137
You could consider looking at OpenSource.Android and find some logic for stabilization. Another link is here platform_packages_apps_camera. From there onwards you can do your own R&D.
Or
Wait until a Google Pixel Camera stabilization based API, or such code, is available to everyone.
A future update to the Android SDK may improve upon the current stabilization feature.
Upvotes: 5