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

Plugin for v4l2loopback devices #280

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tachang
Copy link

@tachang tachang commented Nov 27, 2020

This plugin allows you to grab frames from a v4l2loopback device.
Theoretically it should work with other v4l2 compatible devices but no guarantees are made.

I am opening this PR up early for comments and to get some eyes on it. Some stuff is hard coded for now.

This plugin allows you to grab frames from a v4l2loopback device.

Theoretically it should work with other v4l2 compatible devices
but no guarantees are made.
@tachang
Copy link
Author

tachang commented Nov 27, 2020

I have a feeling I am not clearing the buffer properly because some frames I get a "flash".

This happens when using an older kernel 3.10.14
Throw away the first frame every time we enter the loop
@jacksonliam
Copy link
Owner

Hey, thanks for this,
It does seem strange to create a whole other plugin to get around some bug or missing implementation in v4l2loopback though. I'm not sure about the general usefullness of this plugin.

What exactly is this doing differently to input_uvc which requires it being a whole seperate plugin?

@tachang
Copy link
Author

tachang commented Dec 18, 2020

The real answer is I am not quite sure. Now that I wrote this plugin I think I can go back to input_uvc and double check. All I know is that it didn't really work for me for v4l2loopback.

@jacksonliam
Copy link
Owner

Just to be clear - are you saying input_uvc never worked for you with v4l2loopback or you never go this plugin working?

I can see it looks like you drop to using a single buffer from the usual 4 and have added in a hack to try and deal with v4l2loopback/v4l2loopback#191 which I'm not really sure how that it supposed to work.

I'm not sure how a single buffer would work either, surely you'd get tearing or lost frames?

@tachang
Copy link
Author

tachang commented Dec 18, 2020

  • input_uvc never worked for me. It threw some error basically as you described.
  • I decided to create some code to make it work with v4l2loopback in order to better learn what was going on. I definitely did get tearing and green screens but someone working on the project mentioned it was because the v4l2loopback was providing frames a bit too fast. Could never really narrow down what was going on.

@tachang
Copy link
Author

tachang commented Dec 18, 2020

Here is an issue with images at the bottom of what I experienced:
@jacksonliam v4l2loopback/v4l2loopback#191

@tachang
Copy link
Author

tachang commented Dec 18, 2020

And then I put in that ugly hack to make it read slower and it seemed to make some of the issues go away.

@jacksonliam
Copy link
Owner

OK thanks for the info, I will wait for the outcome of discussions with the v4l2loopback maintainers before deciding what to do with this

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

Successfully merging this pull request may close these issues.

2 participants