Last active
April 27, 2020 10:43
-
-
Save gustavohenrique/6a8ccdc3d1ba1f2f8f9aeb8944d834bd to your computer and use it in GitHub Desktop.
Share a webcam over network/wifi almost latency free using v4l2loopback and ffmpeg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| SENDER=192.168.178.25 | |
| RECEIVER=192.168.178.59 | |
| PORT=8445 | |
| #on receiver | |
| nc -l $PORT | ffmpeg -f rawvideo -pix_fmt yuyv422 -s:v 640x480 -i - -f v4l2 /dev/video0 2> /dev/null & | |
| #on sender | |
| ssh $SENDER "v4l2-ctl --stream-mmap --stream-to=- 2>/dev/null | nc $RECEIVER $PORT" | |
| #use ssh for more security | |
| #ssh $SENDER "v4l2-ctl --stream-mmap --stream-count=-1 --stream-to=-"| ffmpeg -f rawvideo -pix_fmt yuyv422 -s:v 640x480 -i - -map 0:v -f v4l2 /dev/video1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment