Last active
December 3, 2024 05:52
-
-
Save cbarraco/f6cb40e3f5eb1f2733b5 to your computer and use it in GitHub Desktop.
The poor man's VNC. If you have ffmpeg and netcat you can stream your screen across your network with two one-liners
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
# If the server has ffmpeg: | |
## For the server: | |
ffmpeg -f fbdev -i /dev/fb0 -f avi pipe:1 | nc -l -p 1234 | |
## For the viewer: | |
nc 127.0.0.1 1234 | ffplay -i pipe:0 | |
# If the server doesn't have ffmpeg: | |
## For the server: | |
sudo cat /dev/fb0 | nc -l -p 1234 | |
## For the viewer (replace 1920x1080 with the server's resolution): | |
nc 127.0.0.1 1234 | ffplay -f rawvideo -vcodec rawvideo -pixel_format bgra -video_size 1920x1080 -i pipe:0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version that doesn't require root.
Server:
ffmpeg -video_size 1600x900 -framerate 25 -f x11grab -i :0 -f avi - | nc -l -p 1234
change 1600x900 to screen size, and framerate to whichever you desire.
Client:
nc 127.0.0.1 1234 | ffplay -i -
change 127.0.0.1 to the IP of the Server.
Tested on Ubuntu 14.04, Ubuntu 16.04, and Linux Mint 18.
ffmpeg 2.8.11