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

ondemandcam.c not waiting for frames to be consumed #235

Open
allsey87 opened this issue Oct 11, 2019 · 2 comments
Open

ondemandcam.c not waiting for frames to be consumed #235

allsey87 opened this issue Oct 11, 2019 · 2 comments
Labels
topic:documentation things regrading missing/wrong/outdated documentation

Comments

@allsey87
Copy link

System configuration

version: v4l2loopback driver version 0.12.2 loaded
kernel version: Linux ToshibaLaptop 5.2.11-arch1-1-ARCH #1 SMP PREEMPT Thu Aug 29 08:09:36 UTC 2019 x86_64 GNU/Linux

Problem

The example ondemandcam.c is producing frames as fast as possible and does not wait for the other end of the V4L2 pipe to be opened.

Steps to reproduce:

  1. modprobe the driver
  2. add a fprintf(stderr, "."); to sendvid in ondemandcam.c
  3. compile and link ondemandcam.c against pthread and run it

Observed Results:

The ondemandcam is printing dots to the screen at a rapid rate even though the device is not open for reading. Opening the device in ffplay shows that the code is working (cycling through 4 colors, changing every second), but reports an error when trying to set the framerate:

[video4linux2,v4l2 @ 0x7f61b0000b80] The driver does not permit changing the time per frame

Expected Results:

  1. Frames should not be produced unless a program has opened /dev/videoX for reading.
  2. ffplay should be able to control the framerate and consume X FPS
@copiltembel
Copy link

More than one year later, I'm having the same problem.

@allsey87 Did you manage to fix this?

@copiltembel
Copy link

This works and it is a more elegant solution: #109 (comment)

@umlaeute umlaeute added the topic:documentation things regrading missing/wrong/outdated documentation label Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:documentation things regrading missing/wrong/outdated documentation
Projects
None yet
Development

No branches or pull requests

3 participants