2

I'm trying to do something fairly specific and I was wondering if anyone had some suggestions for ways to do it.

I'm working on a program and for it I need an application to do the following utilizing a webcam:

  1. Be able to locally broadcast live video from a webcam to the user on the screen at a decent frame-rate (somewhere around 10 would be nice)

  2. From this live broadcast, be able to take single image snapshots at a commanded time

I'm looking for something that runs on the command line, preferably. I've tried using VLC which is nice for the first part, but in order to take a screenshot, I haven't found a way to do so using the command line. In order for that to work in my application I would need to simulate keystrokes with an active window which may make it a bit difficult to implement.

If anyone has any other suggestions as well using basic terminal commands that would also work, I'm fully open to them.

1 Answers1

1

The easiest way to accomplish this, would be to do the exact opposite of what you're trying to do:

(so basically a combination of both above answers)

I would: take a minimum of 16 fps as that is the minimum our brain needs to see smooth motion

If this is for a web application, you wouldn't even have to convert these still images to a video stream as you could use JavaScript to display 16 images every second (refresh page 16 times per second) provided you've got enough bandwidth available to upload 16 pictures / second. But that depends on your specific use case.

Fabby
  • 34,259
  • 1
    @Favvy - sadly it sometimes applied to 1+ users... using JavaScript can have problems as lots of lag can occur between frames (even when doing them at 1 every 2 seconds), unless all the images are cached or something which can take a while. nice answer :) – Wilf Mar 04 '15 at 11:50
  • @Wilf: :D :D :D Like I said: bandwidth would play a pertinent role, but as the OP didn't give a lot of information on his use case, that's the best I can come up with using the little information I have. – Fabby Mar 04 '15 at 11:54