How to toggle mjpg_streamer on and off

477 views Asked by At

I have an arduino yun setup with a Logitech C270 web cam. I ssh into it and run the following command:

mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480 -f 25" -o "output_http.so -p 8080 -w /www/webcam" &

It works as intended. I made a python script so that when I run:

python stream.py

The camera starts up and I can stream. Also working as intended.

My question is: is there a way to disable the camera? As of right now the only way to turn it off is to unplug it or unplug the arduino.

I'm looking for another command I can run to turn it off.

My stream.py script looks like this:

from subprocess import call
call(
  [
      "mjpg_streamer",
      "-i",
      "input_uvc.so -d /dev/video0 -r 640x480 -f 25",
      "-o",
      "output_http.so -p 8080 -w /www/webcam",
      "&"
  ]
)
0

There are 0 answers