>I have an MJPEG AVI that I wish to split into a series of JPEGs. >I've tried using lavtran, like so: > >bash% lavtrans +n -o image%05d.jpeg -f i vid.AVI > >but it generates JPEGS with empty huffman tables (0x0 DHT).
Beware that the JPEG's in an MJPEG stream (thus, those dumped out by lavtrans) are in a slightly different colorspace than the ones you want for plain old still images. (E.g. black is at Y'=16, and white is Y'=235; chroma is similarly compressed.) >So the approach I end up using is to first translate the MJPEG to >a YUV stream, transform these to PNMs, then transform the PNMs to >JPEGs: > >bash% lav2yuv +n MVI_1704.AVI | y4mtoppm | pnmsplit - image%d.pnm > >Is there a cleaner way? A way of using mjpegtools to go directly >from MJPEG to JPEGs (and filling out DHTs) ? This is about as clean as it gets if you want the correct colorspace. Fixing up the colorspace requires at a minimum: 1) decompress to Y'CbCr 2) convert video Y'CbCr to graphics Y'CbCr 3) recompress to JPEG The pipeline you have above replaces (2) with: 2.0) convert video Y'CbCr to R'G'B' 2.1) convert R'G'B' to graphics Y'CbCr I imagine the decompress/recompress cycle is the biggest source of loss. -m ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Mjpeg-users mailing list Mjpeg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mjpeg-users