public void preFrame(float tpf) { if (null == writer) { try { writer = new MjpegFileWriter(file, width, height, framerate); } catch (Exception ex) { Logger.getLogger(VideoRecorderAppState.class.getName()).log(Level.SEVERE, "Error creating file writer: {0}", ex); } } }
public void addImage(Bitmap image, float quality) throws Exception { addImage(writeImageToBytes(image, quality)); }
public void cleanup() { try { while (freeItems.size() < numCpus) { Thread.sleep(10); } writer.finishAVI(); } catch (Exception ex) { Logger.getLogger(VideoRecorderAppState.class.getName()).log(Level.SEVERE, "Error closing video: {0}", ex); } writer = null; }
public byte[] toBytes() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(fcc); baos.write(intBytes(swapInt(cb))); baos.write(intBytes(swapInt(biSize))); baos.write(intBytes(swapInt(biWidth))); baos.write(intBytes(swapInt(biHeight))); baos.write(shortBytes(swapShort(biPlanes))); baos.write(shortBytes(swapShort(biBitCount))); baos.write(biCompression); baos.write(intBytes(swapInt(biSizeImage))); baos.write(intBytes(swapInt(biXPelsPerMeter))); baos.write(intBytes(swapInt(biYPelsPerMeter))); baos.write(intBytes(swapInt(biClrUsed))); baos.write(intBytes(swapInt(biClrImportant))); return baos.toByteArray(); } }
public void addImage(Bitmap image) throws Exception { addImage(image, 0.8f); }
public byte[] toBytes() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(fcc); baos.write(intBytes(swapInt(cb))); baos.write(intBytes(swapInt(biSize))); baos.write(intBytes(swapInt(biWidth))); baos.write(intBytes(swapInt(biHeight))); baos.write(shortBytes(swapShort(biPlanes))); baos.write(shortBytes(swapShort(biBitCount))); baos.write(biCompression); baos.write(intBytes(swapInt(biSizeImage))); baos.write(intBytes(swapInt(biXPelsPerMeter))); baos.write(intBytes(swapInt(biYPelsPerMeter))); baos.write(intBytes(swapInt(biClrUsed))); baos.write(intBytes(swapInt(biClrImportant))); baos.close(); return baos.toByteArray(); } }
public void addImage(Image image) throws Exception { addImage(image, 0.8f); }
public byte[] toBytes() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(fcc); baos.write(intBytes(swapInt(cb))); baos.write(fccType); baos.write(fccHandler); baos.write(intBytes(swapInt(dwFlags))); baos.write(shortBytes(swapShort(wPriority))); baos.write(shortBytes(swapShort(wLanguage))); baos.write(intBytes(swapInt(dwInitialFrames))); baos.write(intBytes(swapInt(dwScale))); baos.write(intBytes(swapInt(dwRate))); baos.write(intBytes(swapInt(dwStart))); baos.write(intBytes(swapInt(dwLength))); baos.write(intBytes(swapInt(dwSuggestedBufferSize))); baos.write(intBytes(swapInt(dwQuality))); baos.write(intBytes(swapInt(dwSampleSize))); baos.write(intBytes(swapInt(left))); baos.write(intBytes(swapInt(top))); baos.write(intBytes(swapInt(right))); baos.write(intBytes(swapInt(bottom))); baos.close(); return baos.toByteArray(); } }
public void addImage(Image image, float quality) throws Exception { addImage(writeImageToBytes(image, quality)); }
public void preFrame(float tpf) { if (null == writer) { try { writer = new MjpegFileWriter(file, width, height, framerate); } catch (Exception ex) { Logger.getLogger(VideoRecorderAppState.class.getName()).log(Level.SEVERE, "Error creating file writer: {0}", ex); } } }
public void cleanup() { logger.log(Level.INFO, "cleanup in VideoProcessor"); logger.log(Level.INFO, "VideoProcessor numFrames: {0}", numFrames); try { while (freeItems.size() < numCpus) { Thread.sleep(10); } logger.log(Level.INFO, "finishAVI in VideoProcessor"); writer.finishAVI(); } catch (Exception ex) { Logger.getLogger(VideoRecorderAppState.class.getName()).log(Level.SEVERE, "Error closing video: {0}", ex); } writer = null; }
public void addImage(Image image) throws Exception { addImage(image, 0.8f); }
public byte[] toBytes() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(fcc); baos.write(intBytes(swapInt(cb))); baos.write(fccType); baos.write(fccHandler); baos.write(intBytes(swapInt(dwFlags))); baos.write(shortBytes(swapShort(wPriority))); baos.write(shortBytes(swapShort(wLanguage))); baos.write(intBytes(swapInt(dwInitialFrames))); baos.write(intBytes(swapInt(dwScale))); baos.write(intBytes(swapInt(dwRate))); baos.write(intBytes(swapInt(dwStart))); baos.write(intBytes(swapInt(dwLength))); baos.write(intBytes(swapInt(dwSuggestedBufferSize))); baos.write(intBytes(swapInt(dwQuality))); baos.write(intBytes(swapInt(dwSampleSize))); baos.write(intBytes(swapInt(left))); baos.write(intBytes(swapInt(top))); baos.write(intBytes(swapInt(right))); baos.write(intBytes(swapInt(bottom))); return baos.toByteArray(); } }
public Void call() throws Exception { Screenshots.convertScreenShot(item.buffer, item.image); item.data = writer.writeImageToBytes(item.image, quality); while (usedItems.peek() != item) { Thread.sleep(1); } writer.addImage(item.data); usedItems.poll(); freeItems.add(item); return null; } });
public void preFrame(float tpf) { if (null == writer) { try { writer = new MjpegFileWriter(file, width, height, framerate); } catch (Exception ex) { Logger.getLogger(VideoRecorderAppState.class.getName()).log(Level.SEVERE, "Error creating file writer: {0}", ex); } } }
public void cleanup() { try { while (freeItems.size() < numCpus) { Thread.sleep(10); } writer.finishAVI(); } catch (Exception ex) { Logger.getLogger(VideoRecorderAppState.class.getName()).log(Level.SEVERE, "Error closing video: {0}", ex); } writer = null; } }