问题
The application I am working on is developed for Google Glass but runs on Android tablets as well.It uses VP8 encoding to transfer camera images to a remote application.
The preview format parameter on the camera is set to ImageFormat.YV12.
The VP8 encoder is initialized with VPX_IMG_FMT_YV12 parameter.
When the application .apk file is installed and run from the Glass, the image is displayed in gray scale on the remote application.
When the same .apk file is installed on a tablet or a phone, the image is displayed in proper colors.
I am wondering if anyone has any idea on where the problem could lie. Regards.
回答1:
I finally figured out what is happening.
There is a bug in Google Glass camera module. Although it gladly accepts the requested image format of YV12, the preview buffer actually contains data in NV21 format.
I had to dump the camera preview buffer into a file and examine each byte just to figure this out:-(.
If you intend to use YV12 format, you may be better off using NV21 format for now until this bug is fixed.
来源:https://stackoverflow.com/questions/24049712/vp8-encoding-results-in-grayscale-image-on-google-glass