Hi all,
I'm capturing video frame with V4L ( Video 4 linux ) and I want to save it in jp2 format, I'm doing it with jpg format but I didn't find nothing related to jp2.
I don't think you got much choice, FreeImage also uses OpenJPEG internally to handle jp2 files.
I don't know if there any other implementations.
I'd recommend FreeImage because it is very easy to use. Never used OpenJPEG directly, so I dunno about that.
actually, I need to convert from YUV420 to RGB, and then save in JPEG or JP2, but the FreeImage do not support YUV, then I convert manually, but now I don't know how to save in JPEG, my source at moment is:
void JPGOutput::process(MyFrame frame, string name) {
string file = "/home/pc/Desktop/img/";
file.append(name);
file.append(".jpeg");
void *rgb24 = NULL;
rgb24 = yuv420p_to_rgb24(320, 240, (unsigned char *)frame.getFrame(), (unsigned char *)rgb24);
int fh;
if (-1 == (fh = open(file.c_str(), O_CREAT|O_WRONLY|O_TRUNC,0666))) {
if (ENOENT == errno) {
}
fprintf(stderr,"open %s: %s\n","teste.jpg",strerror(errno));
exit(1);
}
// here I don't know how can I save the converted rgb24
}