Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get VLC to show my webcam in realtime:

vlc -I dummy v4l2:///dev/video0

does the trick for the most part, except there's almost a second delay between an action (say, me turning my head) and seeing it in the video window. Is there any way to reduce the lag, or other software I can use (Gentoo Linux)?

share|improve this question
up vote 2 down vote accepted

That's more than likely just a limitation of the webcam. Like early cellphone cameras (newer ones probably have less of a problem), webcams typically have lower frame rates and have, both, slower light sensors and also take longer to process the captured video frames. This causes there to be a delay between real-time and the displayed video. Having a USB connection between the camera and the PC also adds to the delay.

What you could try doing (besides upgrading to a better webcam) is to improve the lighting conditions. Digital cameras tend to take longer to capture a image in low light conditions because it takes longer to capture the necessary amount of light to produce a decent image (sorta like slowing down the shutter speed in an analog camera). Using a FireWire camera could also speed things up slightly.

share|improve this answer
Honestly, there really isn't much that can be done about this... the webcam likely is the culprit. – Nathan Osman Jun 20 '10 at 5:17

Bizarrely I am trying to solve this same problem and I have found a little success. I am using an HP HD 3110. They have them at best buy for about 20 bucks. Anyway I tried using it with VLC and third party software and I had a lag of about 300ms and for what I am doing that is almost unacceptable.

Brightness helped and setting the exposure to be fixed really low appeared to help, but it may simply raise the frame rate which is not necessarily the same as reducing the latency. Ultimately the best performance came from using the software that came with the webcam.

The latency is in the 100ms or lower ballpark which is below what humans typically detect without effort. I have no good explanation for this. Its possible that VLC and the other software I used buffered the images a little much or the software that came with the device may be accessing hidden options for the webcam.

The main issue is your system, but for all I know you may be able to get it to work. Secondly the software that comes with a camera will not make it easy to incorporate into other programs potentially.

share|improve this answer

Most cameras have some parameters, to adjust brightness level, etc.

You should turn off auto brightness, and maybe lower the brightness level. You will get darker image in low light conditions, but hopefully with reduced lag.

share|improve this answer

In the event this question is still relevant to someone, there is a setting visible when All is enabled under settings - see /Stream output/Sout stream/Display for Delay (ms). This value is 100 (ms) by default, and should be considered, as well as buffer values, when rebroadcasting/streaming/transcoding video.

I believe this Display value would apply, if you are just looking at displaying the video, and not streaming it.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .