[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mjpeg-users
Subject:    Re: [Mjpeg-users] splitting an MJPEG to a series of JPEGs
From:       Matto Marjanovic <maddog () mir ! com>
Date:       2005-10-04 0:36:28
Message-ID: 1191-Mon03Oct2005203628-0400-maddog () yoo-hoo ! mir ! com
[Download RAW message or body]


 >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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic