Video recording lags behind audio

using Ubuntu 11.04 - the Natty Narwhal.

I am trying to record a video to put on to a web page. I am using Cheese 2.32.0 the video seems to be recording fine but when played back the video lags behind the sound.

I have a AMD duel core processor and a 500mb video card video streaming via Skype is good so would be interested in any suggestions? Am I using the wrong program to make the recording.

Have you tried adjusting the resolution of the webcam in Cheese ?

You don’t say what type of webcam youi are using, but you might want to try guvcview instead:

sudo apt-get install guvcview

I have adjusted the resolution to the min setting but the lag is not acceptable as when posted on the web page there is a lag that you notice.

I will try the program you suggest and let you know.

Does the video lag when the file is played locally through your media player ? (ie. not across the internet)

Can you provide a link to the website and video.

I have talked by Skype video link to 2 people today and they said there was no lag in the video so it can not be the camera.

I got this camera as it was recommended to work with Linux and it has been a big improvement on the one I had before.

Have noted that improving the lighting and reducing the resolution to min has reduced the lag but then the pic quality is reduced.

The web page is not yet published and is held on my computer and viewed direct from the hard drive.

I have talked by Skype video link to 2 people today and they said there was no lag in the video so it can not be the camera.

That wasn’t why I asked about the webcam … I just wanted to know if it was a v4l2 device or not :slight_smile:

It may be something to do with the way the file is being streamed from the webpage … how does the file play when opened directly in a media player (not a web browser) such as VLC ?

What format is the file saved in ? … and how is it displayed on the website ? (in flashplayer ?)

Or as you suggest, it may be the recording software itself … have you tried guvcview ?

What I’m getting at is first you need to know if it’s a problem with the way Cheese is recording the file, or a problem in the way the file is being streamed from the webpage.

Ok now this is interesting. No lag this morning whilst recording in bright sun, I was able to improve the resolution be two settings and still no lag. So the issue seems to be the lighting level in my office.

Now I only have to convert the file to FLV or MP4 so that the website creation software can embed it into the page.

I generally use Arista to convert video … it comes with a ton of presets for “web” optimized video.

Thanks for the tip, this problem was defently due to the amount of light, recording in strong light conditions means no lag.