Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yuv4mpeg_to_v4l2 V4L2_PIX_FMT_YUV420 does not work with flash actionscript getCamera #8

Closed
arpu opened this issue Dec 2, 2011 · 4 comments

Comments

@arpu
Copy link

arpu commented Dec 2, 2011

hello

i test your greate v4l2loopback all works fine with cheese :> but not with flash

flash getcamera only works with:
V4L2_PIX_FMT_BGR24
V4L2_PIX_FMT_YUYV
V4L2_PIX_FMT_YVU420
V4L2_PIX_FMT_YUV420M

with this formats i can access the flash camera maybe other works too dit not test all

so is it possible to convert the V4L2_PIX_FMT_YUV420 to flash working
V4L2_PIX_FMT_YVU420 ?

same problem with gst-launch can not get any other source working (filesrc,..)
only the videotestscr works fine with flash because of bgr24 -> bgr 24

simple
webcam test swf
http://peer-stream.com/api/Broadcaster.swf?myGroup=v4l2loopback

best regards

@arpu
Copy link
Author

arpu commented Dec 2, 2011

hmm i found out when i use
V4L2_PIX_FMT_YVU420 in yuv4mpeg_to_v4l2
than the video is blue in chees but works in the flash broadcaster
the result in flash broadcaster is very jerking and only 6fps:-/

would it better to convert to rgb24 or bgr24?

any ideas are welcome

@umlaeute
Copy link
Owner

umlaeute commented Dec 5, 2011

thanks for your report. however this is a "won't fix" issue.

here's why:

the target of v4l2loopback is to be an as-light-as-possible layer between the producer and consumer.
this means, that absolutely no conversion is done within the module, all properties of the producer images are passed through to the consumer, no colorspace conversion is done, no framerate conversion, no rescaling...
afaiu, this is also in line with the v4l2 policy (and the kernel in general), that prohibits user-space code (like colorspace conversion) from running in kernel space (which is where all module code is running).
there are user-space libraries out there like "libv4l" that handle things like conversion into a few standard colorspaces, so applications don't need to duplicate code among them.

having that said, i conclude that:
#1 if flash cannot handle a given colorspace then this is a problem of flash and should be fixed there. please file a bug-report to flash.
until this is fixed, you can use the v4lconvert layer of "libv4l" (using LD_PRELOAD magic)

#2 since the colorspace is passed through from the producer to the consumer, you can also simply make sure that your producer creates images in the correct colorspace. if your producer lacks the capabilities to create images in a given colorspace, you might want to file a feature request for that very producer

#3 gstreamer can produce virtually any colorspace. it can also convert between colorspaces, e.g. using "ffmpegcolorspace" (or alternatively "colorspace", "autovideoconvert")

@umlaeute umlaeute closed this as completed Dec 5, 2011
@arpu
Copy link
Author

arpu commented Dec 5, 2011

hello

yes you are right i will create a bug report for the flash player

but i get it working with V4L2_PIX_FMT_YVU420

the jerking and only 6fps is solved with
modprobe v4l2loopback max_buffers=1
without this i get a lot of [83047.961378] v4l2-loopback[1047]: trying to return not mapped buf

works greate now

i test with color convertetion from yuv4mpeg to rgb24 with v4lconvert it make no different for flash

so for flash best way is use
V4L2_PIX_FMT_YVU420 in yuv4mpeg_to_v4l2
and load the module with max_buffers=1

best regards

@umlaeute
Copy link
Owner

umlaeute commented Dec 5, 2011

great that you found a working solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants