Accessing webcam from commandline on Linux
·
1min
·
Dmitry Scherbakov
- Make sure to install
motion
package:apt install motion
- To start a webcam capture, simply type
motion
. This will create camera view onlocalhost:8081
and camera control panel onlocalhost:8080
. - To adjust parameters for webcam and for streaming, you can set following options inside the configuration file, which is located in
/etc/motion/motion.conf
file:stream_localhost
. Whether streaming server is bound to localhost or to0.0.0.0
. Default isoff
.stream_maxrate
. Maximum framerate for stream streams. Default is5
.stream_port
. Port for camera stream (not for control panel). Default is8081
.width
. Width of the image to capture (applies for video as well). Default is640
.height
. Height of the image to capture (applies for video as well). Default is480
.framerate
. Maximum number of frames to be captured per second. Default is15
. Limit is100
.