Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-31 Thread Jean-Francois Moine
On Mon, 31 May 2010 00:03:10 +0200
Ondrej Zary li...@rainbow-software.org wrote:

  I would try extracting a JPEG header from one of the files captured
  by the camera in stand alone mode (either a JPEG still or MJPEG
  file), and put that header together with the image data from the
  USB capture.  It may not look perfect, but hopefully you will get
  something you recognize.  
 
 Just thought about the same thing so I uploaded a video file: 
 http://www.rainbow-software.org/linux_files/spca1528/sunp0003.avi
 
  Attached was Theodore's first attempt of such a procedure with a
  header extracted from a standalone image file from my Jeilin based
  camera and USB snoop data from the same camera.  It wasn't perfect,
  but it was recognizable.  

I could not believe it! I already tried the image as JPEG, but I got
just big colored pixels. I changed the 'samples Y' from 21 to 22 and
I got something coherent! Here is the same image as yesterday with
JPEG 411 header, compression quality 80% and insertion of 0x00 after
0xff.

-- 
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef |   http://moinejf.free.fr/
attachment: image640.jpg

Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-31 Thread Ondrej Zary
On Monday 31 May 2010, Jean-Francois Moine wrote:
 On Mon, 31 May 2010 00:03:10 +0200

 Ondrej Zary li...@rainbow-software.org wrote:
   I would try extracting a JPEG header from one of the files captured
   by the camera in stand alone mode (either a JPEG still or MJPEG
   file), and put that header together with the image data from the
   USB capture.  It may not look perfect, but hopefully you will get
   something you recognize.
 
  Just thought about the same thing so I uploaded a video file:
  http://www.rainbow-software.org/linux_files/spca1528/sunp0003.avi
 
   Attached was Theodore's first attempt of such a procedure with a
   header extracted from a standalone image file from my Jeilin based
   camera and USB snoop data from the same camera.  It wasn't perfect,
   but it was recognizable.

 I could not believe it! I already tried the image as JPEG, but I got
 just big colored pixels. I changed the 'samples Y' from 21 to 22 and
 I got something coherent! Here is the same image as yesterday with
 JPEG 411 header, compression quality 80% and insertion of 0x00 after
 0xff.

That's great - that's what it should look like! It's a part of LCD monitor and 
a shelf above it.

-- 
Ondrej Zary
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-31 Thread Andy Walls
On Mon, 2010-05-31 at 09:19 +0200, Jean-Francois Moine wrote:
 On Mon, 31 May 2010 00:03:10 +0200
 Ondrej Zary li...@rainbow-software.org wrote:
 
   I would try extracting a JPEG header from one of the files captured
   by the camera in stand alone mode (either a JPEG still or MJPEG
   file), and put that header together with the image data from the
   USB capture.  It may not look perfect, but hopefully you will get
   something you recognize.  
  
  Just thought about the same thing so I uploaded a video file: 
  http://www.rainbow-software.org/linux_files/spca1528/sunp0003.avi
  
   Attached was Theodore's first attempt of such a procedure with a
   header extracted from a standalone image file from my Jeilin based
   camera and USB snoop data from the same camera.  It wasn't perfect,
   but it was recognizable.  
 
 I could not believe it! I already tried the image as JPEG, but I got
 just big colored pixels. I changed the 'samples Y' from 21 to 22 and
 I got something coherent! Here is the same image as yesterday with
 JPEG 411 header, compression quality 80% and insertion of 0x00 after
 0xff.

Very nice work!

I think I understand the 'samples Y' change.  According to ITU T.81, you
changed the Vertical sampling factor in the Y component.  So, I guess
Luma is undersampled vertically for that mode of the camera (the camera
only really has a 240 line sensor)?

Regards,
Andy

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-30 Thread Ondrej Zary
On Sunday 30 May 2010 13:34:55 Jean-Francois Moine wrote:
 On Sat, 29 May 2010 21:32:07 +0200

 Ondrej Zary li...@rainbow-software.org wrote:
  The Color Space/Compression reported by the driver is only one: RGB 24
  The driver also uses these files which may (or may not) be related to
  used compression: iyuv_32.dll, msh263.drv, msyuv.dll, tsbyuv.dll
  In standalone mode, the camera records video in MJPEG format.

 Hello Ondrej,

 Bad news, the images are compressed by an unknown algorithm (unknown
 from Linux point of vue). The decompression function could be found in
 some part of the ms-win driver, but:
 - first, I have no time to search and disassemble this function,
 - then, I did have this problem with an other webcam (17a1:0118), and
   after searching for a long time, nobody could find the function, and
   the driver is in stand-by since 2 years,
 - eventually, is this legal?

That's bad...

The driver contains file sp5x_32.dll which is registered in system.ini file as
[drivers32]
VIDC.SP54=SP5X_32.DLL

Seems that the codec is called SP54 - hope that it's used to decompress the 
data.

 All I can do is to code the driver and let you or anyone find the
 decompression function...

Maybe we can dump some data, create AVI file from that and try to decode the 
file using that codec.

-- 
Ondrej Zary
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-30 Thread Jean-Francois Moine
On Sun, 30 May 2010 19:55:22 +0200
Ondrej Zary li...@rainbow-software.org wrote:

 That's bad...
 
 The driver contains file sp5x_32.dll which is registered in
 system.ini file as [drivers32]
 VIDC.SP54=SP5X_32.DLL
 
 Seems that the codec is called SP54 - hope that it's used to
 decompress the data.
 
  All I can do is to code the driver and let you or anyone find the
  decompression function...
 
 Maybe we can dump some data, create AVI file from that and try to
 decode the file using that codec.

It is easy to get images from the usbsnoop files. I join an image
extracted from your file usbsnoop-video-capture-640x480.log. If you
want more images, they are in IsoPackets. The first 2 bytes of each isoc
packet mean:
- '02 80' or '02 81': first of intermediate part of the image ('0' or
  '1' is the image sequence number)
- '02 82' or '02 83': last part of the image

Someone had an idea to try and guess the compression algorithm: do
usbsnoop's with full black and full white images. But this idea did not
work with the other webcam: the images were quite the same!

-- 
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef |   http://moinejf.free.fr/


image640.dat
Description: Binary data


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-30 Thread Andy Walls
On Sun, 2010-05-30 at 13:34 +0200, Jean-Francois Moine wrote:
 On Sat, 29 May 2010 21:32:07 +0200
 Ondrej Zary li...@rainbow-software.org wrote:
 
  The Color Space/Compression reported by the driver is only one: RGB 24
  The driver also uses these files which may (or may not) be related to
  used compression: iyuv_32.dll, msh263.drv, msyuv.dll, tsbyuv.dll
  In standalone mode, the camera records video in MJPEG format.
 
 Hello Ondrej,
 
 Bad news, the images are compressed by an unknown algorithm (unknown
 from Linux point of vue). The decompression function could be found in
 some part of the ms-win driver, but:
 - first, I have no time to search and disassemble this function,
 - then, I did have this problem with an other webcam (17a1:0118), and
   after searching for a long time, nobody could find the function, and
   the driver is in stand-by since 2 years,
 - eventually, is this legal?
 
 All I can do is to code the driver and let you or anyone find the
 decompression function...

I ran into this with my daughetr's cheap little Sakar webcam based on a
Jeilin chip.  After some investigation about the chip and learning it
being only able to perform JPEG compression, it was rather easy to
figure out it was just sending MJPEG data with the headers stripped off.

This thread from last year tells most of the story

http://www.mail-archive.com/linux-media@vger.kernel.org/msg06766.html

(Many thanks to Theodore for doing the legwork on experiments and a new
GSPCA driver - jeilinj)

Since your camera records MJPEG in stand-alone mode (mine recorded MJPEG
in an AVI container in stand-alone mode), it stands to reason, your
camera may be doing the same sort of thing.  The payload of MJPEG data
will look very random since the compressed data is Huffman (entropy)
encoded in the final step of encoding.


Regards,
Andy



--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-30 Thread Andy Walls
On Sun, 2010-05-30 at 19:55 +0200, Ondrej Zary wrote:
 On Sunday 30 May 2010 13:34:55 Jean-Francois Moine wrote:
  On Sat, 29 May 2010 21:32:07 +0200
 
  Ondrej Zary li...@rainbow-software.org wrote:
   The Color Space/Compression reported by the driver is only one: RGB 24
   The driver also uses these files which may (or may not) be related to
   used compression: iyuv_32.dll, msh263.drv, msyuv.dll, tsbyuv.dll
   In standalone mode, the camera records video in MJPEG format.
 
  Hello Ondrej,
 
  Bad news, the images are compressed by an unknown algorithm (unknown
  from Linux point of vue). The decompression function could be found in
  some part of the ms-win driver, but:
  - first, I have no time to search and disassemble this function,
  - then, I did have this problem with an other webcam (17a1:0118), and
after searching for a long time, nobody could find the function, and
the driver is in stand-by since 2 years,
  - eventually, is this legal?
 
 That's bad...
 
 The driver contains file sp5x_32.dll which is registered in system.ini file as
 [drivers32]
 VIDC.SP54=SP5X_32.DLL
 
 Seems that the codec is called SP54 - hope that it's used to decompress the 
 data.
 
  All I can do is to code the driver and let you or anyone find the
  decompression function...


SP54 is Sunplus' ( http://www.sunplus.com.tw/ ) FourCC code for a
version of MJPEG with the headers removed according to 

http://www.fourcc.org/


 Maybe we can dump some data, create AVI file from that and try to decode the 
 file using that codec.

FourCC.org points to this page:

http://libland.fr.st/download.html

which points to a utility to conver the data back into an MJPEG:
 
http://mxhaard.free.fr/spca50x/Download/sp54convert.tar.gz


I have no idea if any of the above is true, 'cause I read it on the
Internet. ;)

Regards,
Andy

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-30 Thread Ondrej Zary
On Sunday 30 May 2010 21:26:14 Andy Walls wrote:
 On Sun, 2010-05-30 at 19:55 +0200, Ondrej Zary wrote:
  On Sunday 30 May 2010 13:34:55 Jean-Francois Moine wrote:
   On Sat, 29 May 2010 21:32:07 +0200
  
   Ondrej Zary li...@rainbow-software.org wrote:
The Color Space/Compression reported by the driver is only one: RGB
24 The driver also uses these files which may (or may not) be related
to used compression: iyuv_32.dll, msh263.drv, msyuv.dll, tsbyuv.dll
In standalone mode, the camera records video in MJPEG format.
  
   Hello Ondrej,
  
   Bad news, the images are compressed by an unknown algorithm (unknown
   from Linux point of vue). The decompression function could be found in
   some part of the ms-win driver, but:
   - first, I have no time to search and disassemble this function,
   - then, I did have this problem with an other webcam (17a1:0118), and
 after searching for a long time, nobody could find the function, and
 the driver is in stand-by since 2 years,
   - eventually, is this legal?
 
  That's bad...
 
  The driver contains file sp5x_32.dll which is registered in system.ini
  file as [drivers32]
  VIDC.SP54=SP5X_32.DLL
 
  Seems that the codec is called SP54 - hope that it's used to decompress
  the data.
 
   All I can do is to code the driver and let you or anyone find the
   decompression function...

 SP54 is Sunplus' ( http://www.sunplus.com.tw/ ) FourCC code for a
 version of MJPEG with the headers removed according to

   http://www.fourcc.org/

  Maybe we can dump some data, create AVI file from that and try to decode
  the file using that codec.

 FourCC.org points to this page:

   http://libland.fr.st/download.html

 which points to a utility to conver the data back into an MJPEG:

   http://mxhaard.free.fr/spca50x/Download/sp54convert.tar.gz


 I have no idea if any of the above is true, 'cause I read it on the
 Internet. ;)

Modified that utility to work on raw video frame extracted from usbsnoop file. 
The bad news is that the resulting jpeg file is not readable.

I also deleted the sp5x_32.dll file and the camera still works...

-- 
Ondrej Zary
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-30 Thread Andy Walls
On Sun, 2010-05-30 at 23:28 +0200, Ondrej Zary wrote:
 On Sunday 30 May 2010 21:26:14 Andy Walls wrote:
  On Sun, 2010-05-30 at 19:55 +0200, Ondrej Zary wrote:
   On Sunday 30 May 2010 13:34:55 Jean-Francois Moine wrote:

 
  SP54 is Sunplus' ( http://www.sunplus.com.tw/ ) FourCC code for a
  version of MJPEG with the headers removed according to
 
  http://www.fourcc.org/
 
   Maybe we can dump some data, create AVI file from that and try to decode
   the file using that codec.
 
  FourCC.org points to this page:
 
  http://libland.fr.st/download.html
 
  which points to a utility to conver the data back into an MJPEG:
 
  http://mxhaard.free.fr/spca50x/Download/sp54convert.tar.gz
 
 
  I have no idea if any of the above is true, 'cause I read it on the
  Internet. ;)
 
 Modified that utility to work on raw video frame extracted from usbsnoop 
 file. 
 The bad news is that the resulting jpeg file is not readable.
 
 I also deleted the sp5x_32.dll file and the camera still works...

I would try extracting a JPEG header from one of the files captured by
the camera in stand alone mode (either a JPEG still or MJPEG file), and
put that header together with the image data from the USB capture.  It
may not look perfect, but hopefully you will get something you
recognize.

Attached was Theodore's first attempt of such a procedure with a header
extracted from a standalone image file from my Jeilin based camera and
USB snoop data from the same camera.  It wasn't perfect, but it was
recognizable.


I did look at the image data file Jean-Francois provided from your
usbsnoop logs.  To my eye the data looks like it is Huffman coded
(indicating JPEG).  Maybe I'm just seeing what I want to see.


Regards,
Andy
attachment: frame_one.jpg

Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-30 Thread Ondrej Zary
On Sunday 30 May 2010 23:58:11 Andy Walls wrote:
 On Sun, 2010-05-30 at 23:28 +0200, Ondrej Zary wrote:
  On Sunday 30 May 2010 21:26:14 Andy Walls wrote:
   On Sun, 2010-05-30 at 19:55 +0200, Ondrej Zary wrote:
On Sunday 30 May 2010 13:34:55 Jean-Francois Moine wrote:
  
   SP54 is Sunplus' ( http://www.sunplus.com.tw/ ) FourCC code for a
   version of MJPEG with the headers removed according to
  
 http://www.fourcc.org/
  
Maybe we can dump some data, create AVI file from that and try to
decode the file using that codec.
  
   FourCC.org points to this page:
  
 http://libland.fr.st/download.html
  
   which points to a utility to conver the data back into an MJPEG:
  
 http://mxhaard.free.fr/spca50x/Download/sp54convert.tar.gz
  
  
   I have no idea if any of the above is true, 'cause I read it on the
   Internet. ;)
 
  Modified that utility to work on raw video frame extracted from usbsnoop
  file. The bad news is that the resulting jpeg file is not readable.
 
  I also deleted the sp5x_32.dll file and the camera still works...

 I would try extracting a JPEG header from one of the files captured by
 the camera in stand alone mode (either a JPEG still or MJPEG file), and
 put that header together with the image data from the USB capture.  It
 may not look perfect, but hopefully you will get something you
 recognize.

Just thought about the same thing so I uploaded a video file: 
http://www.rainbow-software.org/linux_files/spca1528/sunp0003.avi

 Attached was Theodore's first attempt of such a procedure with a header
 extracted from a standalone image file from my Jeilin based camera and
 USB snoop data from the same camera.  It wasn't perfect, but it was
 recognizable.

Thanks, I'll try that tomorrow.

 I did look at the image data file Jean-Francois provided from your
 usbsnoop logs.  To my eye the data looks like it is Huffman coded
 (indicating JPEG).  Maybe I'm just seeing what I want to see.


 Regards,
 Andy

-- 
Ondrej Zary
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-30 Thread Andy Walls
On Sun, 2010-05-30 at 20:13 +0200, Jean-Francois Moine wrote:
 On Sun, 30 May 2010 19:55:22 +0200
 Ondrej Zary li...@rainbow-software.org wrote:
 
  That's bad...
  
  The driver contains file sp5x_32.dll which is registered in
  system.ini file as [drivers32]
  VIDC.SP54=SP5X_32.DLL
  
  Seems that the codec is called SP54 - hope that it's used to
  decompress the data.
  
   All I can do is to code the driver and let you or anyone find the
   decompression function...
  
  Maybe we can dump some data, create AVI file from that and try to
  decode the file using that codec.
 
 It is easy to get images from the usbsnoop files. I join an image
 extracted from your file usbsnoop-video-capture-640x480.log. If you
 want more images, they are in IsoPackets. The first 2 bytes of each isoc
 packet mean:
 - '02 80' or '02 81': first of intermediate part of the image ('0' or
   '1' is the image sequence number)
 - '02 82' or '02 83': last part of the image
 
 Someone had an idea to try and guess the compression algorithm: do
 usbsnoop's with full black and full white images. But this idea did not
 work with the other webcam: the images were quite the same!

I have attached an image I constructed from the image data file you
provided, the MJPEG headers in the AVI file Ondrej provided, and the
Huffman table in the jpeg.h file in the gspca driver.

If you zoom in, there is an small pattern in the top left portion of the
scan.

I doesn't look quite like an whole image, but it does look like the
start of one.

Regards,
Andy


attachment: test1.jpg000: ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01  ..JFIF..
010: 00 01 00 00 ff db 00 c5 00 0a 07 07 08 07 06 0a  
020: 08 08 08 0b 0a 0a 0b 0e 18 10 0e 0d 0d 0e 1d 15  
030: 16 11 18 23 1f 25 24 22 1f 22 21 26 2b 37 2f 26  ...#.%$.!+7/
040: 29 34 29 21 22 30 41 31 34 39 3b 3e 3e 3e 25 2e  )4)!0A149;%.
050: 44 49 43 3c 48 37 3d 3e 3b 01 0a 0b 0b 0e 0d 0e  DICH7=;...
060: 1c 10 10 1c 3b 28 22 28 3b 3b 3b 3b 3b 3b 3b 3b  ;((
070: 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b  
080: 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b  
090: 3b 3b 3b 3b 3b 3b 3b 3b 3b 3b 02 17 18 18 24 21  ;;$!
0a0: 24 47 26 26 47 99 66 56 66 99 99 99 99 99 99 99  $GG.fVf...
0b0: 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99  
0c0: 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99  
0d0: 99 99 99 99 99 99 99 99 99 99 99 ff c4 01 a2 00  
0e0: 00 01 05 01 01 01 01 01 01 00 00 00 00 00 00 00  
0f0: 00 01 02 03 04 05 06 07 08 09 0a 0b 01 00 03 01  
100: 01 01 01 01 01 01 01 01 00 00 00 00 00 00 01 02  
110: 03 04 05 06 07 08 09 0a 0b 10 00 02 01 03 03 02  
120: 04 03 05 05 04 04 00 00 01 7d 01 02 03 00 04 11  .}..
130: 05 12 21 31 41 06 13 51 61 07 22 71 14 32 81 91  ..!1A..Qa.q.2..
140: a1 08 23 42 b1 c1 15 52 d1 f0 24 33 62 72 82 09  ..#B...R..$3br..
150: 0a 16 17 18 19 1a 25 26 27 28 29 2a 34 35 36 37  ..%'()*4567
160: 38 39 3a 43 44 45 46 47 48 49 4a 53 54 55 56 57  89:CDEFGHIJSTUVW
170: 58 59 5a 63 64 65 66 67 68 69 6a 73 74 75 76 77  XYZcdefghijstuvw
180: 78 79 7a 83 84 85 86 87 88 89 8a 92 93 94 95 96  xyz.
190: 97 98 99 9a a2 a3 a4 a5 a6 a7 a8 a9 aa b2 b3 b4  
1a0: b5 b6 b7 b8 b9 ba c2 c3 c4 c5 c6 c7 c8 c9 ca d2  
1b0: d3 d4 d5 d6 d7 d8 d9 da e1 e2 e3 e4 e5 e6 e7 e8  
1c0: e9 ea f1 f2 f3 f4 f5 f6 f7 f8 f9 fa 11 00 02 01  
1d0: 02 04 04 03 04 07 05 04 04 00 01 02 77 00 01 02  w...
1e0: 03 11 04 05 21 31 06 12 41 51 07 61 71 13 22 32  !1..AQ.aq.2
1f0: 81 08 14 42 91 a1 b1 c1 09 23 33 52 f0 15 62 72  ...B.#3R..br
200: d1 0a 16 24 34 e1 25 f1 17 18 19 1a 26 27 28 29  ...$4.%.'()
210: 2a 35 36 37 38 39 3a 43 44 45 46 47 48 49 4a 53  *56789:CDEFGHIJS
220: 54 55 56 57 58 59 5a 63 64 65 66 67 68 69 6a 73  TUVWXYZcdefghijs
230: 74 75 76 77 78 79 7a 82 83 84 85 86 87 88 89 8a  tuvwxyz.
240: 92 93 94 95 96 97 98 99 9a a2 a3 a4 a5 a6 a7 a8  
250: a9 aa b2 b3 b4 b5 b6 b7 b8 b9 ba c2 c3 c4 c5 c6  
260: c7 c8 c9 ca d2 d3 d4 d5 d6 d7 d8 d9 da e2 e3 e4  
270: e5 e6 e7 e8 e9 ea f2 f3 f4 f5 f6 f7 f8 f9 fa ff  
280: c0 00 11 08 01 e0 02 80 03 01 21 00 02 11 01 03  ..!.
290: 11 01 ff da 00 0c 03 01 00 02 11 03 11 00 3f 00  ..?.


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-30 Thread Theodore Kilgore


On Sun, 30 May 2010, Andy Walls wrote:

 On Sun, 2010-05-30 at 20:13 +0200, Jean-Francois Moine wrote:
  On Sun, 30 May 2010 19:55:22 +0200
  Ondrej Zary li...@rainbow-software.org wrote:
  
   That's bad...
   
   The driver contains file sp5x_32.dll which is registered in
   system.ini file as [drivers32]
   VIDC.SP54=SP5X_32.DLL
   
   Seems that the codec is called SP54 - hope that it's used to
   decompress the data.
   
All I can do is to code the driver and let you or anyone find the
decompression function...
   
   Maybe we can dump some data, create AVI file from that and try to
   decode the file using that codec.
  
  It is easy to get images from the usbsnoop files. I join an image
  extracted from your file usbsnoop-video-capture-640x480.log. If you
  want more images, they are in IsoPackets. The first 2 bytes of each isoc
  packet mean:
  - '02 80' or '02 81': first of intermediate part of the image ('0' or
'1' is the image sequence number)
  - '02 82' or '02 83': last part of the image
  
  Someone had an idea to try and guess the compression algorithm: do
  usbsnoop's with full black and full white images. But this idea did not
  work with the other webcam: the images were quite the same!
 
 I have attached an image I constructed from the image data file you
 provided, the MJPEG headers in the AVI file Ondrej provided, and the
 Huffman table in the jpeg.h file in the gspca driver.
 
 If you zoom in, there is an small pattern in the top left portion of the
 scan.
 
 I doesn't look quite like an whole image, but it does look like the
 start of one.
 
 Regards,
 Andy

Downloaded it. And, hmmm. Here are the error messages on trying to look at 
the output:

kilg...@khayyam:~$ display test1.jpg
display: Corrupt JPEG data: premature end of data segment `test1.jpg' @ 
warning/jpeg.c/EmitMessage/228.
display: Unsupported marker type 0x3a `test1.jpg' @ 
error/jpeg.c/EmitMessage/233.
kilg...@khayyam:~$ 

Quite possibly it _is_ going down strips or such. That is what the 
JL2005C cameras are doing. Each vertical strip of 16 bytes from the 
picture is in fact a separate JPEG image, and needs to be separately 
processed, and then the results glued together into an image. This is even 
seen in the raw data, once one is so wise that it is all figured out. The 
data for each strip ends with FF D9. So one suggestion here would be to 
see how many times the FF D9 is coming up in the data. There may be a 
pattern to that.

Theodore Kilgore
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-29 Thread Jean-Francois Moine
On Sat, 29 May 2010 19:09:32 +0200
Ondrej Zary li...@rainbow-software.org wrote:

 I got a MD80-clone camera based on SPCA1527A chip. It's webcam-like
 camera with battery and microSD slot and can record video on its own.
 It has two USB modes - mass storage (USB ID 04fc:0171) and webcam
 mode (USB ID 04fc:1528). This chip seems to be used in many other SD
 card cameras too.
 
 The webcam mode is not supported by gspca so I captured some data to 
 (hopefully) make support in gspca possible. There seems to be 3
 interfaces:

Hello Ondrej,

I got your ms-win traces, thank you. The commands seem simple enough,
but I don't know yet the compression algorithm of the images. I will
have a look at this on next week. May you tell me if there are other
resolutions than 320x240 and, also, what are the webcam controls?

Best regards.

-- 
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef |   http://moinejf.free.fr/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: SPCA1527A/SPCA1528 (micro)SD camera in webcam mode

2010-05-29 Thread Ondrej Zary
On Saturday 29 May 2010 20:24:25 Jean-Francois Moine wrote:
 On Sat, 29 May 2010 19:09:32 +0200

 Ondrej Zary li...@rainbow-software.org wrote:
  I got a MD80-clone camera based on SPCA1527A chip. It's webcam-like
  camera with battery and microSD slot and can record video on its own.
  It has two USB modes - mass storage (USB ID 04fc:0171) and webcam
  mode (USB ID 04fc:1528). This chip seems to be used in many other SD
  card cameras too.
 
  The webcam mode is not supported by gspca so I captured some data to
  (hopefully) make support in gspca possible. There seems to be 3
  interfaces:

 Hello Ondrej,

 I got your ms-win traces, thank you. The commands seem simple enough,
 but I don't know yet the compression algorithm of the images. I will
 have a look at this on next week. May you tell me if there are other
 resolutions than 320x240 and, also, what are the webcam controls?

The supported resolutions are:
160x120
176x144
320x240
352x288
640x480

The Color Space/Compression reported by the driver is only one: RGB 24
The driver also uses these files which may (or may not) be related to used 
compression: iyuv_32.dll, msh263.drv, msyuv.dll, tsbyuv.dll
In standalone mode, the camera records video in MJPEG format.


Controls:
Banding Filter - 50Hz/60Hz - bandwidth 3/4/5/6/7 (default=50Hz, 3)
Brightness - 0..255 (default=128)
Contrast - 1..8 (default=1)
Saturation - 0..8 (default=1)
Sharpness - 0..255 (default=0)
Hue - 0..360 (default=0)

I added some more logs to 
http://www.rainbow-software.org/linux_files/spca1528/

different resolutions (with default control settings):
usbsnoop-video-capture-160x120.log
usbsnoop-video-capture-176x144.log
usbsnoop-video-capture-352x288.log
usbsnoop-video-capture-640x480.log

160x120 with one control changed (other are at default values):
usbsnoop-controls-brightness-226.log
usbsnoop-controls-brightness-43.log
usbsnoop-controls-contrast-5.log
usbsnoop-controls-hue-91.log
usbsnoop-controls-saturation-4.log
usbsnoop-controls-sharpness-145.log

opening controls window with no capture running:
usbsnoop-open-controls.log

-- 
Ondrej Zary
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html