前端怎么获取video本身一帧的widht/height
1个回答
展开全部
public void onPreviewFrame(byte[] data, Camera camera) { tick = 1; //到1帧的时候,将此帧的画面形成,然后发送出去 while(tick == ) { System.out.println("data len: " + data.length); try {// File file = new File("/sdcard/pal+"+UUID.randomUUID()+".3gp"); File file = new File("/sdcard/test/pal.jpg"); if (!file.exists()) file.createNewFile(); RandomAccessFile raf = new RandomAccessFile(file, "rw"); byte[] rgbBuf = new byte[width*height*6]; ConvertTools.decodeYUV420SP(rgbBuf, data, width, height); raf.write(rgbBuf); } catch (Exception ex) { Log.v("System.out", ex.toString()); }// } tick++; }
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询