Closed GoogleCodeExporter closed 9 years ago
Sure it's possible. It requires some coding, you'll find what you need to know
around the site and the mailing list, but I'll keep this issue opened as a RFE
for a sample... Let me know if you would like to contribute your code if you
get it working, thank you.
Original comment by samuel.a...@gmail.com
on 27 Feb 2012 at 3:41
[deleted comment]
[deleted comment]
No, I think the easiest way would be to use FFmpegFrameRecorder. We can copy
the YUV byte[] data into an IplImage, call cvCvtColor() on that, and write the
output image using the recorder, e.g.:
FrameRecorder recorder = new FFmpegFrameRecorder("video.mp4", imageWidth,
imageHeight);
recorder.setCodecID(CODEC_ID_MPEG4);
recorder.setFormat("mp4");
recorder.setPixelFormat(PIX_FMT_YUV420P);
recorder.start();
// loop ...
cvCvtColor(yuvimage, bgrimage, CV_YUV420sp2BGR)
recorder.record(bgrimage);
I guess though if we are going to write YUV420P video data anyway, we should
allow YUV images as input to FFmpegFrameRecorder and skip the RGB conversions
...
Or if you do no wish the OpenCV dependency, then you can always copy
FFmpegFrameRecorder and hack your own mod. I am sure someone has done something
like that. You should ask on the mailing list...
Original comment by samuel.a...@gmail.com
on 28 Feb 2012 at 4:50
[deleted comment]
[deleted comment]
[deleted comment]
[deleted comment]
Original issue reported on code.google.com by
zhangqia...@gmail.com
on 27 Feb 2012 at 3:22