Skip to content

Instantly share code, notes, and snippets.

@pmolchanov
Last active March 8, 2016 04:44
Show Gist options
  • Save pmolchanov/d8a6666bd395e2716dca to your computer and use it in GitHub Desktop.
Save pmolchanov/d8a6666bd395e2716dca to your computer and use it in GitHub Desktop.
Stream WebCam over HTTP using VLC to android smartphone for bathroom break
#!/usr/bin/env bash
# sudo apt-get install qrencode
# sudo apt-get install imagemagick
port=8080
# Lock screen in 10 seconds
(sleep 10; gnome-screensaver-command -l) &
# Display URL
ip=$(ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}')
echo http://$ip:$port
qrencode -s 10 -o - vlc://http://$ip:$port | display &
# Start Server
cvlc v4l2:///dev/video0 --sout '#transcode{vcodec=mp2v,vb=800,scale=1.0,acodec=none}:http{mux=ts,dst=:$port/}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment