Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 have a device that records the audio and video using ffmpeg. And I am using Ubuntu 12.04 for that device, but I want to find out if the device is currently recording or if it is in idle state from command line.

Is there any Ubuntu command to find the current status of device?

share|improve this question
up vote 8 down vote accepted

You can use lsof -t /dev/video0.

It will return the process which owns the webcam (the first webcam should default to /dev/video0 but if you have more then one you may have a /dev/video1, /dev/video2 and so on).

On idle I got nothing:

sylvain@sylvain-ThinkPad-T430s:~$ lsof -t /dev/video0

If I start a Google Hangout for example:

sylvain@sylvain-ThinkPad-T430s:~$ lsof -t /dev/video0
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.