|
| 1 | +# sshcam |
| 2 | + |
| 3 | +Webcam live streaming in SSH terminal. |
| 4 | + |
| 5 | +[DEMO](https://asciinema.org/a/14968) |
| 6 | + |
| 7 | +## Install |
| 8 | + |
| 9 | +**Install binary from GitHub** if you don't have a Go development environment: |
| 10 | + |
| 11 | +```bash |
| 12 | +curl -sL https://github.com/kfei/sshcam/releases/download/v1.0.0/sshcam-v1.0.0-x64.tar.bz | tar xj |
| 13 | +``` |
| 14 | + |
| 15 | +**Build from source** (also requires GCC): |
| 16 | + |
| 17 | +```bash |
| 18 | +go get -u github.com/kfei/sshcam |
| 19 | +cd $GOPATH/src/github.com/kfei/sshcam |
| 20 | +go build |
| 21 | +go install |
| 22 | +``` |
| 23 | + |
| 24 | +## Quick Start |
| 25 | + |
| 26 | +Preview the live stream locally via `sshcam` (without any argument). Also note |
| 27 | +that you should run `sshcam` as an user with privilege to open `/dev/videoX`. |
| 28 | + |
| 29 | +Start the SSH server with all default settings: |
| 30 | + |
| 31 | +```bash |
| 32 | +sshcam --server |
| 33 | +``` |
| 34 | + |
| 35 | +Then on the client-side, run: |
| 36 | + |
| 37 | +```bash |
| 38 | +ssh sshcam@your.server.ip -p 5566 # Default login: sshcam/p@ssw0rd |
| 39 | +``` |
| 40 | + |
| 41 | +Note that there are more configurable settings for server, have a look at |
| 42 | +`sshcam -h` for more details. For example, |
| 43 | + |
| 44 | +```bash |
| 45 | +sshcam --server --listen=127.0.0.1 --port=22222 \ |
| 46 | + --user=john --pass=nhoj \ |
| 47 | + --device=/dev/video0 --size=1280x720 |
| 48 | +``` |
| 49 | + |
| 50 | +## Requirements |
| 51 | + |
| 52 | + - On the client-side, a standard `ssh` utility is enough. |
| 53 | + - Video device is supported by |
| 54 | + [V4L2](https://www.kernel.org/doc/Documentation/video4linux/v4l2-framework.txt), |
| 55 | + which means the server is currently Linux only. |
| 56 | + |
| 57 | +## TODO |
| 58 | + |
| 59 | +There are still lots of interesting works to be done. Discussions and pull |
| 60 | +requests are both welcome. :) |
| 61 | + |
| 62 | + - *P2P functions*: So that it can be a terminal video messenger. |
| 63 | + - *Higher resolution*: Can this be done by using the Unicode block |
| 64 | + characters? |
| 65 | + - *Colors*: In a *xterm-256color* terminal, display images with colors. |
| 66 | + - *Port to other platforms*, maybe QT? |
| 67 | + - *Improve algorithm*: Currently the image scaling is inefficient and lossy. |
| 68 | + |
| 69 | +## Credits |
| 70 | + |
| 71 | +This project is inspired from [txtcam](https://github.com/dhotson/txtcam) and |
| 72 | +[Star Wars Movie in Telnet](telnet://towel.blinkenlights.nl). |
| 73 | + |
| 74 | +## License |
| 75 | + |
| 76 | +The MIT License (MIT) |
0 commit comments