Convert YUV webcam image to java byte array
In 开发者_如何学PythonJava, what is the most efficient way of converting a frame of PC webcam image data in YUV (I420 or YUY2) format to a byte (or integer) array?
Don't know about java, but this is how you can solve it using ffmpeg
ffmpeg -i in.avi -vcodec rawvideo -pix_fmt yuv420p -o out.yuv
Converts any input to 420 planar yuv.
You can try this project:
http://code.google.com/p/java-yuv/
I believe it has some code you can use
SOLVED. It may not be the MOST efficient, but PixelGrabber class seems to work with what I think is just a block data copy. Having said that, I'll still be happy to hear any more efficient methods. Thanks for your suggestions.
精彩评论