-
Notifications
You must be signed in to change notification settings - Fork 960
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
add Capture implementation for Linux #2061
base: master
Are you sure you want to change the base?
Conversation
Great to see this work! Haven't had a detailed look but tried it out quickly on Ubuntu 18.04 VMware inside macOS 10.13.4 and it worked nicely with the built-in camera ( I do get a crash, when closing the window, on the destructor of Will definitely give it a try again once in front of a proper Linux machine with an external usb camera. |
👋 Just tried on a Linux box with Ubuntu 18.04 and I believe I'm running into what Petros is seeing(I'm not totally set up to properly debug just yet). The following shows up in the console when I close the window. terminate called without an active exception
Aborted (core dumped)
Edit |
Looks like if I add mRunning.store( false );
mThread.join(); to the very top of the destructor - this seems to fix things; closing the window doesn't raise the error anymore. |
Hi guys, Thanks @sortofsleepy for pointing me in the right direction, in my tests I was explicitly calling shutdown(), so I've added that to the destructor. It also turns out that I wasn't properly shutting down the thread, so I've fixed that too. |
This looks good to me, and I know @sortofsleepy has continued stress-testing it as well. I was going to request a macro like |
Thanks for this. Tested it on Fedora and works well. |
I got the following error when compiling cinder-capture with captureBasic in linux. Any pointer on how to fix it? |
I found the bug!. It turns out that the program detected two webcams if ( !mDevice ) { |
The thing with the two devices shown above is that they are two modes, motion-jpeg and yuv on my webcam. The current implementation only works with the yuv uncompressed stream, which has lower fps. For better frame rate in higher resolutions we would need to implement the mjpg support. What do you think?
|
This seems to have stalled out, any plans to merge? @andrewfb |
Just pushed this along with the two merge conflicts fixed to the CaptureLinux branch. It is essentially ready to merge to master, though i wanted to ask a couple questions around how this is built and configured:
|
Given
v4l2
is part of the Linux kernel, I thought it would be a good idea to use it to implement video capture on Linux. I didn't need it, but on some distributions you may need to download thelibv4l-dev
package for this to compile.With view of issue #2052,
CaptureBasic
andCaptureCube
now build and work on my machine.Here are a few notes:
v4l2
to double buffer the incoming capture frames.getSurface()
is called a copy of the last written buffer is made. As far as I can see, this is necessary.shared_ptr
is created each timegetSurface()
is called. I noticed that the Windows implementation has a pool ofSurfaceRef
s to eliminate this overhead. I chose the simplest solution!