Motion - Support Question 2007x 10x 23x 183238

Force RGB24 when camera supports it and YUV422

Question

I have a Logitech Communicate camera. When I load the driver qcset -i says:
Depth         : 24
Palette       : RGB888 packed into 24bit words.

When I start motion it then says:
Depth         : 16
Palette       : Video style YUV422 - 8bits packed 4bits Y 2bits U 2bits V

Since YUV422 initializes before RGB, is there a way to force RGB? I'm just trying to see if the picture quality improves for RGB

Before:
Name          : Logitech QuickCam USB
Type          : capture
Channels      : 1
Audio devices : 0
Maxsize       : 640,496
Minsize       : 160,120

Overlay coords: 1532713819,1532713819
Capture size  : 320,240
Chromakey     : 1532713819
Flags         :

Channel       : 0
Name          : Camera
Tuners        : 0
Flags         :
Type          : camera
Norm          : 2052

Brightness    : 32768
Hue           : 32768
Color         : 32768
Contrast      : 32768
Whiteness     : 32768
Depth         : 24
Palette       : RGB888 packed into 24bit words.

After:
Name          : Logitech QuickCam USB
Type          : capture
Channels      : 1
Audio devices : 0
Maxsize       : 640,496
Minsize       : 160,120

Overlay coords: 1532713819,1532713819
Capture size  : 320,240
Chromakey     : 1532713819
Flags         :

Channel       : 0
Name          : Camera
Tuners        : 0
Flags         :
Type          : camera
Norm          : 2052

Brightness    : 32768
Hue           : 32768
Color         : 32768
Contrast      : 32768
Whiteness     : 32768
Depth         : 16
Palette       : Video style YUV422 - 8bits packed 4bits Y 2bits U 2bits V

Environment

Motion version: 3.2.7
ffmpeg version: SVN
Libraries: ffmpeg, mysql, postgresql
Server OS: Gentoo

-- GuardianBob - 23 Oct 2007

Answer

If you camera supports V4L2 , you can get svn version and apply patch to choose between supported palettes ,

you can find this patch here :

http://www.lavrsen.dk/twiki/bin/view/Motion/VideoForLinuxTwoDiscussion

-- AngelCarpintero - 24 Oct 2007

Question

And if it doesn't support V4L2?

Here's the better question, why aren't all 24 bit methods exhausted before going to 16 bit, then gray scale? In fact I patched the source (switched YUV442 and RGB24 in video.c) to do this and it works great. I can submit the patch (I think I remember how to make a patch file) if that would be better.

-- GuardianBob - 24 Oct 2007


I'm quite sure that it supports V4L2 as V4L1 is deprecated and will be unsupported in a future.

Of course you can submit a patch but , please do it from svn version.

Main reason to use YUV442 before RGB24 because motion works internally with YUV420P so all palettes are converted to. Conversion from YUV442 is faster than RGB24, it has smaller size and is faster to capture from.

RGB24     - 24bits/pixel
YUV442    - 16bits/pixel
YUV420P  - 12bits/pixel

-- AngelCarpintero - 25 Oct 2007


Oh, I thought YUV420P was a higher, not lower. I was hoping for more resolution, for the mjpeg stream. -- GuardianBob - 26 Oct 2007
Topic revision: r5 - 27 Oct 2007, GuardianBob
Copyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.