v4l2 contrast or gamma problem

Martin Vit festr2 at gmail.com
Thu Jun 9 00:17:45 PDT 2011


Hi Devs!

First, I would like to thank you for developing this great tool. It allowed
me streaming from v4l2 web cam and sound card stream to my rtmp server
without loosing a/v sync which is not possible with competition like
ffmpeg.

Now get back to problem I've discovered. I've USB microsoft live cam which
is capable to stream RAW video and MJPEG video. RAW video is in YUY2. The
problem is that whan I stream RAW video in YUY2, contrast or gamma or
rounding problem (dont know) are ok. But once I stream in MJPEG, contrast is
too high and ligh places are too light so it creates white shapes (sorry for
my english).

Here is command line for YUY2 video which is OK

gst-launch -v -m v4l2src ! queue !
video/x-raw-yuv,format='(fourcc)'YUY2,width=640,height=360,framerate=30/1 !
ffmpegcolorspace ! queue ! videorate ! 'video/x-raw-yuv,framerate=30/1' !
hqdn3d ! x264enc

I've checked with v4l2-ctl that in the first case, pixel format is
        Pixel Format  : 'YUYV'
        Colorspace    : SRGB


Here is command line for MJPEG which has bad contrast

gst-launch -v -m v4l2src ! image/jpeg,width=640,height=360,framerate=30/1 !
queue ! ffdec_mjpeg ! ffmpegcolorspace ! queue ! videorate !
'video/x-raw-yuv,framerate=30/1' ! x264enc

v4l2-ctl -V
        Pixel Format  : 'MJPG'
        Colorspace    : SRGB


Streaming in MJPEG with ffmpeg looks good (contrast is ok)

ffmpeg -f alsa -i plughw:0 -f video4linux2 -s 640x360 -r 30 -i /dev/video0
-vcodec libx264 -threads 0 -vpre slow -b 500000 -strict experimental
 -acodec libfaac -ar 44100 -f flv rtmp://a.b.c.d/flvplayback/festr
v4l2-ctl -V
        Pixel Format  : 'MJPG'
        Colorspace    : SRGB


Anyone know if this is known issue or bug or misconfiguration? I've tried
forcing v4l2 src plugin to video/x-raw-yuv,format='(fourcc)'YV12 format
which sets my camera to MJPEG and the result is same, high contrast.


Thank you if you read the whole message and for possible hints.
Regards
Martin Vit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110609/44472422/attachment.html>


More information about the gstreamer-devel mailing list