Build 2737, Device does not support video standard

Forum for questions and support relating to the 1.24.x releases only.
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Build 2737, Device does not support video standard

Post by ris2t »

I have a couple of usb web cams I'm trying to setup locally (rather than mjpeg_streamer).

With build 2678 these connected and streamed an image but the palette was all wrong (http://www.zoneminder.com/forums/viewtopic.php?t=12611).

Installing build 2737 I can nolonger connect and encountering the following error:

01/31/09 18:33:04.465817 zmc_dvideo0[-1].FAT-zm_local_camera.cpp/351 [Device does not support video standard 1]

The above seems to occur for all device format and palette combinations.

Any suggestions, I'm happy to try a few things out to debug this.

Background

Intrepid 8.10 - Linux 2.6.27-11-generic x86_64

uvcdynctrl -l:
video1 UVC Camera (046d:0994) - aka Logitech Sphere AF
video0 USB2.0 2MP UVC AF Camera

Build settings:

./configure --with-webuser=www-data --with-webgroup=www-data ZM_DB_NAME=zm78 ZM_DB_USER=zmuser78 ZM_DB_PASS=XXXX --with-webdir=/var/www/html/zm --with-cgidir=/usr/lib/cgi-bin --with-
libarch=lib64 --with-ffmpeg=/usr --enable-mmap=yes

build 2737 setup

Code: Select all

Monitor Source Settings:
device path: /dev/video0
Capture Method: Video For Linux version 2
channel: 0
Device Format: PAL B
Caputure Palette: YUYV 
Width: 640
Heigh: 480
Debug file:

Code: Select all

01/31/09 18:33:04.231681 zmc_dvideo0[-1].INF-zm_debug.c/292 [New Debug Level = 9, New Debug Log = /tmp/zm_debug.log.07604]
01/31/09 18:33:04.231779 zmc_dvideo0[-1].DB1-zm_monitor.cpp/1708 [Got 1 monitors]
01/31/09 18:33:04.231819 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/103 [Opening video device /dev/video0]
01/31/09 18:33:04.231838 zmc_dvideo0[-1].DB2-zm_local_camera.cpp/109 [V4L2 support enabled, using V4L2 api]
01/31/09 18:33:04.231844 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/236 [Checking video device capabilities]
01/31/09 18:33:04.231854 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/246 [Setting up video format]
01/31/09 18:33:04.464939 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/275 [Setting up request buffers]
01/31/09 18:33:04.465261 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/297 [Setting up 8 data buffers]
01/31/09 18:33:04.465807 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/332 [Configuring video source]
01/31/09 18:33:04.465817 zmc_dvideo0[-1].FAT-zm_local_camera.cpp/351 [Device does not support video standard 1]
compared with build 2678 setup

Code: Select all

device path: /dev/video0
channel: 0
Device Format: PAL
Capture Method: Video For Linux version 2
Caputure Palette: YUYV (note: all other palettes fail)
Width: 640
Heigh: 480
Debug file

Code: Select all

01/31/09 18:10:10.512546 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/99 [Opening video device /dev/video0]
01/31/09 18:10:10.512568 zmc_dvideo0[-1].DB2-zm_local_camera.cpp/105 [V4L2 support enabled, using V4L2 api]
01/31/09 18:10:10.512575 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/110 [Checking video device capabilities]
01/31/09 18:10:10.512584 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/145 [Setting up video format]
01/31/09 18:10:10.531950 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/214 [Setting up request buffers]
01/31/09 18:10:10.532236 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/236 [Setting up 8 data buffers]
01/31/09 18:10:10.532713 zmc_dvideo0[-1].DB3-zm_local_camera.cpp/416 [Setting up static colour tables]
01/31/09 18:10:10.533697 zmc_dvideo0[-1].DB1-zm_monitor.cpp/335 [monitor purpose=1]
01/31/09 18:10:10.533713 zmc_dvideo0[-1].DB1-zm_monitor.cpp/342 [mem.size=36865524]
01/31/09 18:10:10.533740 zmc_dvideo0[-1].DB1-zm_monitor.cpp/367 [Unable to map file /dev/shm/.zm.mmap.1 (36865524 bytes) to locked memory, trying unlocked]
01/31/09 18:10:10.550351 zmc_dvideo0[-1].DB1-zm_zone.cpp/50 [Initialised zone 0/All - 1 - 640x480 - Rgb:ff0000, CM:3, MnAT:15, MxAT:0, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0, OF: 0]
Web Cam info: v4l-info

Code: Select all

### v4l2 device info [/dev/video0] ###
general info
    VIDIOC_QUERYCAP
        driver                  : "uvcvideo"
        card                    : "USB2.0 2MP UVC AF Camera"
        bus_info                : "0000:00:1a.7"
        version                 : 0.1.0
        capabilities            : 0x4000001 [VIDEO_CAPTURE,STREAMING]

standards

inputs
    VIDIOC_ENUMINPUT(0)
        index                   : 0
        name                    : "Camera 1"
        type                    : CAMERA
        audioset                : 0
        tuner                   : 0
        std                     : 0x0 []
        status                  : 0x0 []

video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
        index                   : 0
        type                    : VIDEO_CAPTURE
        flags                   : 1
        description             : "MJPEG"
        pixelformat             : 0x47504a4d [MJPG]
    VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
        index                   : 1
        type                    : VIDEO_CAPTURE
        flags                   : 0
        description             : "YUV 4:2:2 (YUYV)"
        pixelformat             : 0x56595559 [YUYV]
    VIDIOC_G_FMT(VIDEO_CAPTURE)
        type                    : VIDEO_CAPTURE
        fmt.pix.width           : 640
        fmt.pix.height          : 480
        fmt.pix.pixelformat     : 0x56595559 [YUYV]
        fmt.pix.field           : NONE
        fmt.pix.bytesperline    : 1280
        fmt.pix.sizeimage       : 614400
        fmt.pix.colorspace      : SRGB
        fmt.pix.priv            : 0

controls
    VIDIOC_QUERYCTRL(BASE+0)
        id                      : 9963776
        type                    : INTEGER
        name                    : "Brightness"
        minimum                 : 0
        maximum                 : 255
        step                    : 1
        default_value           : 128
        flags                   : 0
    VIDIOC_QUERYCTRL(BASE+1)
        id                      : 9963777
        type                    : INTEGER
        name                    : "Contrast"
        minimum                 : 0
        maximum                 : 255
        step                    : 1
        default_value           : 32
        flags                   : 0
    VIDIOC_QUERYCTRL(BASE+2)
        id                      : 9963778
        type                    : INTEGER
        name                    : "Saturation"
        minimum                 : 0
        maximum                 : 255
        step                    : 1
        default_value           : 32
        flags                   : 0
    VIDIOC_QUERYCTRL(BASE+3)
        id                      : 9963779
        type                    : INTEGER
        name                    : "Hue"
        minimum                 : -180
        maximum                 : 180
        step                    : 1
        default_value           : 0
        flags                   : 0

### video4linux device info [/dev/video0] ###
general info
    VIDIOCGCAP
        name                    : "USB2.0 2MP UVC AF Camera"
        type                    : 0x1 [CAPTURE]
        channels                : 1
        audios                  : 0
        maxwidth                : 0
        maxheight               : 0
        minwidth                : 48
        minheight               : 32

channels
ioctl VIDIOCGCHAN: Invalid argument

tuner
ioctl VIDIOCGTUNER: Invalid argument

audio
ioctl VIDIOCGAUDIO: Invalid argument

picture
    VIDIOCGPICT
        brightness              : 32896
        hue                     : 32768
        colour                  : 8224
        contrast                : 8224
        whiteness               : 10923
        depth                   : 16
        palette                 : YUYV

buffer
ioctl VIDIOCGFBUF: Invalid argument

window
    VIDIOCGWIN
        x                       : 0
        y                       : 0
        width                   : 640
        height                  : 480
        chromakey               : 0
        flags                   : 0

bokusouchi
Posts: 13
Joined: Sat Jan 31, 2009 10:36 pm

Post by bokusouchi »

I ran into the same snag as you .
I also try to run a bunch of usb cameras , (preferably without mjpeg_streamer)
i have
video0 UVC Camera (046d:0994)
0c45:602c Microdia Clas Ohlson TWC-30XOP WebCam
0c45:6005 Microdia Sweex Mini WebCam


to get the cameras to display , i had to modify the file zm_local_camera.cpp
here is the diff :
[root@venus src]# diff zm_local_camera.cpp zm_local_camera.cpp.save
348,349c348
< if ( input.std!=V4L2_STD_UNKNOWN )
< {
---
>
352c351
<Fatal> Fatal( "Device does not support video standard %d", format );
360d358
< }


the problem is that the usb camera i have (and yours as well) have the
"input.std" field set to zero . this seems logical fo a usb cam , this fiel contain normaly codes for "secam/PAL/NTSC" etc in the case of TV cards tuners etc .


see the extract of your v4l-info :
inputs
VIDIOC_ENUMINPUT(0)
index : 0
name : "Camera 1"
type : CAMERA
audioset : 0
tuner : 0
std : 0x0 []
status : 0x0 []

I modified the code to bypass the match control of this field .

unfortunately , i have reached the same point you reached :
I get pictures from the cams but the colors are all garbled .
wrong palettes or wrong format conversion or something ?
i am giving up for the now .

by the way i use libv4l convert library ;

export LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so
before lauching zm

hope this helps

By the way ; the diag tool "zmu" is non functional wit v4l2 only devices
like uvc cams . As zmu still contains v4l1 calls.....
guess it will be upgraded in the future ....


BG
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

bokusouchi wrote: hope this helps

By the way ; the diag tool "zmu" is non functional wit v4l2 only devices
like uvc cams . As zmu still contains v4l1 calls.....
guess it will be upgraded in the future ....


BG
It helps some, maybe with your help we can nail this down before release, we just don't have any of these cams to work the issues out our self so need some one with this device to um lean on.
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Post by ris2t »

to get the cameras to display , i had to modify the file zm_local_camera.cpp
here is the diff :
[root@venus src]# diff zm_local_camera.cpp zm_local_camera.cpp.save
348,349c348
< if ( input.std!=V4L2_STD_UNKNOWN )
< {
---
>
352c351
<Fatal> Fatal( "Device does not support video standard %d", format );
360d358
< }
Thanks, this did the trick. Now I'm back to the palette problem. Looks like I need to start digging through the code. Any ideas which module I should focus on?

Below my version of the code I added.

Code: Select all

       if (input.std != V4L2_STD_UNKNOWN || format != V4L2_STD_UNKNOWN)
bokusouchi wrote:
By the way ; the diag tool "zmu" is non functional wit v4l2 only devices
like uvc cams . As zmu still contains v4l1 calls.....
guess it will be upgraded in the future ....
Patch also fixes zmu.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

ris2t wrote: Patch also fixes zmu.
Might be a good place to start. What output do you get from zmu?
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Post by ris2t »

bokusouchi wrote: unfortunately , i have reached the same point you reached :
I get pictures from the cams but the colors are all garbled .
wrong palettes or wrong format conversion or something ?
i am giving up for the now .
Palette codes seems to be in zm_local_camera.cpp around line 1438. I suspect its converting YUYV (YUYV422) to RGB.

http://en.wikipedia.org/wiki/YUV#Y.27UV422 - I'm taking a guess the algorithm will be similar to this one.
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Post by ris2t »

Following my earlier post i've managed to improve the colour situation.

Heres a quick hack at the palette code that seems to improve things. I just need to work out whats wrong with the static table approach, suspect an offset problem.

diff zm_local_camera.cpp zm_local_camera.save

Code: Select all

349,350d348                                                                                                                                                         
<       if (input.std != V4L2_STD_UNKNOWN || format != V4L2_STD_UNKNOWN)                                                                                            
<       { // RIS 1 Feb 09 uvc patch
353c351
<Fatal>             Fatal( "Device does not support video standard %d", format );
361d358
<       } // end uvc patch
611c608
</r_v_table>       r_v_table += 127;
615,619d611
<       */
<       r_v_table += 128;
<       g_v_table += 128;
<       g_u_table += 128;
<       b_u_table += 128;
1446,1447d1437
<               // reference : http://en.wikipedia.org/wiki/YUV#Y.27UV422
<
1461,1466c1451,1453
<                     r = y1 + 1.402 * (v - 128);
<                     // r = y1 + r_v_table[v];
<                     g = y1 - 0.344 * (u - 128) - 0.714 * (u - 128);
<                     // g = y1 - (g_u_table[u]+g_v_table[v]);
<                     b = y1 + 1.772 * (u - 128);
</b>                     r = y1 + r_v_table[v];
>                     g = y1 - (g_u_table[u]+g_v_table[v]);
>                     b = y1 + b_u_table[u];
1472,1477c1459,1461
<                     r = y2 + 1.402 * (v - 128);
<                     // r = y2 + r_v_table[v];
<                     g = y2 - 0.344 * (u - 128) - 0.714 * (u - 128);
<                     // g = y2 - (g_u_table[u]+g_v_table[v]);
<                     b = y2 + 1.772 * (u - 128);
</b>                     r = y2 + r_v_table[v];
>                     g = y2 - (g_u_table[u]+g_v_table[v]);
>                     b = y2 + b_u_table[u];
Got both cameras up and running, colours may be still a little off.

video1 UVC Camera (046d:0994) - Logictech Sphere AF @ disappointing 176*144
video0 USB2.0 2MP UVC AF Camera - DSE XH5223 @ 640*480
Last edited by ris2t on Sun Feb 01, 2009 10:57 am, edited 1 time in total.
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Post by ris2t »

cordel wrote:
ris2t wrote: Patch also fixes zmu.
Might be a good place to start. What output do you get from zmu?
Actually I was mistaken. Got zmu/zmc mixed up.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

The zmu query function currently only functions on V4L1. I plan to add V4L2 queries when I get time. In the meantime I recommend using v4l-info as it does pretty much the same thing for V4L2 devices anyway.

The video standard thing I will update to allow zero values. The palettes _should_ now be V4L2 compliant. I recommend making sure you have the fmmpeg libraries installed which will now do the format conversions. If you still get weird colours even using that let me know. I no longer have any USB cams to test against.
Phil
bokusouchi
Posts: 13
Joined: Sat Jan 31, 2009 10:36 pm

got 1.24 running with 4 usb cams , thanks to libv4l

Post by bokusouchi »

[quote="ris2t"]Following my earlier post i've managed to improve the colour situation.

Here's a quick hack at the palette code that seems to improve things. I just need to work out whats wrong with the static table approach, suspect an offset problem.



I tried your hack , it did work somehow with the format YUYV for the
quickcam sphere , but not for my other cameras (sonix and Ohlson)
(sugar cube type cameras ).

So i decided to hack zm_local_camera.cpp a little bit more , I decided to use libv4l inside the code and not just as a wrapper .
By the way, libv4l is a great piece of code thanks to Hans de Goede !!!
you can get it at :
http://hansdegoede.livejournal.com/3636.html

here is my diff :

Code: Select all

[[root@venus src]# diff zm_local_camera.cpp zm_local_camera.cpp.save
27d26
< #include <libv4l2>
32,35c31,34
< //    do
< //    {
<         result = v4l2_ioctl( fd, request, arg );
</while>     do
>     {
>         result = ioctl( fd, request, arg );
>     } while ( result == -1 && errno == EINTR );
106c105
<     if ( (vid_fd = v4l2_open( device.c_str(), O_RDWR, 0 )) <0>     if ( (vid_fd = open( device.c_str(), O_RDWR, 0 )) < 0 )
118d116
<               Debug( 2, "palette=V4L2_PIX_FMT_RGB444" );
122d119
<               Debug( 2, "palette=V4L2_PIX_FMT_RGB55" );
126d122
<               Debug( 2, "palette=V4L2_PIX_FMT_RGB565" );
130d125
<               Debug( 2, "palette=V4L2_PIX_FMT_BGR24" );
134d128
<               Debug( 2, "palette=V4L2_PIX_FMT_RGB24" );
138d131
<               Debug( 2, "palette=V4L2_PIX_FMT_BGR32" );
143d135
<               Debug( 2, "palette=V4L2_PIX_FMT_RGB32" );
146d137
<               Debug( 2, "palette=V4L2_PIX_FMT_GRAY" );
150d140
<               Debug( 2, "palette=V4L2_PIX_FMT_YUV422" );
154d143
<               Debug( 2, "palette=V4L2_PIX_FMT_YUV422P" );
158d146
<               Debug( 2, "palette=V4L2_PIX_FMT_YUV411P" );
162d149
<               Debug( 2, "palette=V4L2_PIX_FMT_YUV444P" );
166d152
<               Debug( 2, "palette=V4L2_PIX_FMT_YUV410P" );
170d155
<               Debug( 2, "palette=V4L2_PIX_FMT_YUV420P" );
174d158
<               Debug( 2, "palette=V4L2_PIX_FMT_YUV444P" );
269d252
<         Debug( 3, "current device image format %x ",v4l2_data.fmt.fmt.pix.pixelformat );
275d257
<       Debug( 3, "palette (wanted= %x",palette);
278,280d259
<         if ( vidioctl( vid_fd, VIDIOC_TRY_FMT, &v4l2_data.fmt ) < 0 )
<            Debug(3, "VIDIOC_TRY_FMT Failed error: %s", strerror(errno) );
<         Debug( 3, "device image format after VIDIOC_TRY_FMT: %x ",v4l2_data.fmt.fmt.pix.pixelformat );
284,286d262
<         Debug( 3, "device image format after VIDIOC_S_FMT: %x ",v4l2_data.fmt.fmt.pix.pixelformat );
<         Debug( 3, "device image height after VIDIOC_S_FMT: %d ",v4l2_data.fmt.fmt.pix.height );
<         Debug( 3, "device image  width after VIDIOC_S_FMT: %d ",v4l2_data.fmt.fmt.pix.width );
333c309
</vid_buf>             //vid_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
335c311
</vid_buf>             //vid_buf.memory = V4L2_MEMORY_MMAP;
343c319
<v4l2_data>             v4l2_data.buffers[i].start = mmap( NULL, vid_buf.length, PROT_READ|PROT_WRITE, MAP_SHARED, vid_fd, vid_buf.m.offset );
372,374c348
<         Debug( 3, "Format(wanted):%d  ;  input.std=%d",format ,input.std  );
<       if ( input.std!=V4L2_STD_UNKNOWN || format != V4L2_STD_UNKNOWN)
<       {
---
> 
377c351
<Fatal>             Fatal( "Device does not support video standard %d", format );
385d358
<       }
635,638c608,611
<       r_v_table += 128;
<       g_v_table += 128;
<       g_u_table += 128;
<b_u_table>       r_v_table += 127;
>       g_v_table += 127;
>       g_u_table += 127;
>       b_u_table += 127;
675c648
<v4l2_close>       close( vid_fd );
683c656
<       if ( (vid_fd=v4l2_open(device, O_RDWR)) <0>       if ( (vid_fd=open(device, O_RDWR)) <=0 )

ZoneMinder need to be configured with (notice extralib):

Code: Select all

./configure --prefix=/usr --with-extralibs="-lv4l2"--with-webdir=/var/www/html --with-cgidir=/var/www/cgi-bin th-cgidir=/var/www/cgi-bin
so far i have four cameras running 2 sonix and one Ohlson at max res (352x288) , the quickcam is running at 640x480
all formats are RGB24 (i tried YUYV but it gives garbage on all cameras but the Quickcam).

Code: Select all

 list of cameras 
[root@venus ZoneMinder-1.24.0]# lsusb
Bus 005 Device 007: ID 0409:005a NEC Corp. 
Bus 005 Device 004: ID 046d:0994 Logitech, Inc. 
Bus 005 Device 001: ID 1d6b:0002  
Bus 003 Device 002: ID 0c45:602c Microdia Clas Ohlson TWC-30XOP WebCam
Bus 003 Device 001: ID 1d6b:0001  
Bus 004 Device 002: ID 0c45:6005 Microdia Sweex Mini WebCam
Bus 004 Device 001: ID 1d6b:0001  
Bus 001 Device 004: ID 04d9:1203 Holtek Semiconductor, Inc. 
Bus 001 Device 005: ID 0c45:6005 Microdia Sweex Mini WebCam
Bus 001 Device 001: ID 1d6b:0001  
Bus 002 Device 001: ID 1d6b:0001  

the driver are :
gspca for 0c45:6005
sn9c102 for 0c45:602c
uvc for 046d:0994

things i noticed :
the driver sn9c102 does not work welll with two camera of same model (0c45:602c) . picture of two camera get mixed into one device (alternating frames) .

normalised picture sizes work better : 176x244 352x288 480x640

changing size with gspca and uvc drivers need a computer reboot (or unplug of camera ?)

Next step is to get control of tilt and pan for the quickam sphere ;
i had it running for 1.22 , but since, the scripts api got completely changed...
:?

and may be try a v4l1 camera ....

[/img]
newvisionantenna
Posts: 381
Joined: Sat Jan 17, 2009 7:49 pm
Location: Germany

Post by newvisionantenna »

Control of the sphere via Zoneminder and mjpg_streamer on 1.24 is working. Would be nice to also have local control over it when plugged direct into the server.
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Post by ris2t »

zoneminder wrote: The video standard thing I will update to allow zero values. The palettes _should_ now be V4L2 compliant. I recommend making sure you have the fmmpeg libraries installed which will now do the format conversions. If you still get weird colours even using that let me know. I no longer have any USB cams to test against.
I presume your referrring to a build later than 2737? Or is this an existing complie option I missed, pretty sure I included the ffmpeg stuff though.

I'd been keen to test when publised.
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Post by ris2t »

newvisionantenna wrote:Control of the sphere via Zoneminder and mjpg_streamer on 1.24 is working. Would be nice to also have local control over it when plugged direct into the server.
Yes that would be nice. Going to see how far I can get with that one.

BTW, any notes or references for getting the mjpg_streamer controls working? I've been trying for awhile with various bits I've found but not making alot of progress.
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Post by ris2t »

Below slightly different patch for the palette problem with build 2737. Fixes the slight off colours of the earlier patch.

diff zm_local_camera.cpp zm_local_camera.save

Code: Select all

349,350d348
<       if (input.std != V4L2_STD_UNKNOWN || format != V4L2_STD_UNKNOWN)
<       { // RIS 1 Feb 09 uvc patch
361d358
<       } // end uvc patch
611,612c608,612
<
<       for ( int i = 0; i < 255 ; i++ )
---
>       r_v_table += 127;
>       g_v_table += 127;
>       g_u_table += 127;
>       b_u_table += 127;
>       for ( int i = -127; i <= 127; i++ )
614,619c614,619
<               r_v_table[i] = 1402*(i-128)/1000;
<               g_u_table[i] = 344*(i-128)/1000;
<               g_v_table[i] = 714*(i-128)/1000;
<               b_u_table[i] = 1772*(i-128)/1000;
<       }
<
---
>               signed char c = i;
>               r_v_table[c] = (1402*c)/1000;
>               g_u_table[c] = (344*c)/1000;
>               g_v_table[c] = (714*c)/1000;
>               b_u_table[c] = (1772*c)/1000;
>       }
1438d1437
<
ris2t
Posts: 43
Joined: Thu Jan 22, 2009 8:44 am

Post by ris2t »

ris2t wrote:
zoneminder wrote: The video standard thing I will update to allow zero values. The palettes _should_ now be V4L2 compliant. I recommend making sure you have the fmmpeg libraries installed which will now do the format conversions. If you still get weird colours even using that let me know. I no longer have any USB cams to test against.
I presume your referrring to a build later than 2737? Or is this an existing complie option I missed, pretty sure I included the ffmpeg stuff though.

I'd been keen to test when publised.
Figured this one out. Its as zoneminder has stated.

If ffmpeg is installed and compiled with the "--enable-swscale" option and Zoneminder is pointed to the correct ffmpeg installation "--with-ffmpeg=/usr/local" then the zoneminder code (#ifdef switch) utilises the ffmpeg libraries rather then the internal code to do the palette conversions.

Hence no YUYV palette problems.

BTW: ZM 1.24 (release) still needs the code tweaks if your not using ffmpeg.

My fault was trying to use pre package deployment of ffmpeg.
Locked