jcodec
now (jcodec-0.1.9.jar) includes a SequenceEncoder
that directly allows BufferedImage
to be written to the video stream.
I spent some time fixing the default import of this new class in Eclipse. After removing the first import, trying (as I said above, I could not find some of the classes) to create my own Stanislav code and re-import, I noticed an error:
import org.jcodec.api.awt.SequenceEncoder;
The second is completely out of date, with no documentation directing me to the latter.
Proportional method:
private void saveClip(Trajectory traj) { //See www.tutorialspoint.com/androi/android_audio_capture.htm //for audio cap ideas. SequenceEncoder enc; try { enc = new SequenceEncoder(new File("C:/Users/WHOAMI/today.mp4")); for (int i = 0; i < BUFF_COUNT; ++i) { BufferedImage image = buffdFramToBuffdImage(frameBuff.get(i)); enc.encodeImage(image); } enc.finish(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
source share