Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.
First install motion
:
~> sudo apt-get install motion
Then create a config file:
~> mkdir ~/.motion
~> nano ~/.motion/motion.conf
In it, the bare minimum to run a web server and view it on other computers:
webcam_port 8081
webcam_localhost off
Then run motion:
~> motion
Now you can view the webcam at http://hostname:8081 If it doesn't work, try rebooting between steps or something.
Isn't that easy? >:(
See also: How to run webcam software only when I am not home
This solution was posted long time ago, but - THANK YOU!
Just as said, was breaking my head with vlc, ffmpeg, etc. but this solution is so simple and it is working.
Arch Linux amd64 and actually it is not working out of box with default conf, posted in readme.md , but it is working with @OzzzM solution:
Why do I writing this? Because @global-qa was ask is it possible over https. Yes, it is true he was ask this before two years, but just in case someone else need solution, I am using NGINX and below is my webcam.conf (I already have a domain name and ssl certificate, I am using port 8080, change server_name , ssl_certificate location , ssl_certificate_key location and proxy_pass , to fit your configuration)
`server { listen 80;
return 301 https://$host$request_uri;
}
server { server_name webcam.example.com;
listen 443 ssl;
}`