Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
    
Welcome to Ask Ubuntu. Please, could you put some of your time to read askubuntu.com/help/someone-answers –  Sylvain Pineau Mar 30 at 7:42

1 Answer 1

up vote 8 down vote accepted

You can use lsof -t /dev/video0.

It will return the process which has 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
4051
share|improve this answer

Your Answer

 
discard

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.