开发者

Convert YUV webcam image to java byte array

开发者 https://www.devze.com 2023-03-12 03:06 出处:网络
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 h

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号