This is a repository of random bash scripts, in addition to these lovely commands.
see Maciej Piechotka's post here
dd if=/dev/video0 | mplayer tv://device=/dev/stdin
## OR ##
mkfifo videoCam
dd if=/dev/video0 of=videoCam &
mplayer tv://device=videoCam
sudo apt update && sudo apt install vlc
cvlc v4l2:///dev/video0
sudo apt update && sudo apt install mplayer
mplayer tv://device=/dev/video0
see my post here
[me@myComp /some/dir]$ ssh someone@remoteComp
...
[someone@remoteComp /some/dir]$ cvlc v4l2:///dev/video0
Just the live stream
[me@myComp /some/dir]$ sudo apt update && sudo apt install mplayer
[me@myComp /some/dir]$ ssh someone@remoteComp
...
[someone@remoteComp /some/dir]$ sudo apt update && sudo apt install ffmpeg
[someone@remoteComp /some/dir]$ exit
...
[me@myComp /some/dir]$ ssh someone@remoteComp "ffmpeg -hide_banner -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | mplayer - -idle
-hide_banner
is what it says it is-r
is framerate-s
is size of window in pixels-f
is the format-i
is the input device
Again, but with tee
for saving to a file as well
[me@myComp /some/dir]$ ssh someone@remoteComp "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | tee $(date +%Y-%m-%d_%H-%M-%S)_recording.mkv | mplayer - -idle
It also works with netcat:
# From remote machine
ffmpeg -hide_banner -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska - | nc -l 12345
# from local machine
nc <remote machine IP> 12345 | mplayer - -idle
Whether using netcat or ssh, the delay was roughly 9 seconds. So, the benefit of netcat is bypassing ssh security, like odd ports and firewalls. Netcat worked without opening the port on either computer's firewall. However, netcat has to be started on the remote computer somehow...