Skip to content

Instantly share code, notes, and snippets.

@mrbid
Last active April 5, 2024 00:57
Show Gist options
  • Save mrbid/620eecca5fe177074c8a4213e81d0588 to your computer and use it in GitHub Desktop.
Save mrbid/620eecca5fe177074c8a4213e81d0588 to your computer and use it in GitHub Desktop.
FFmpeg Direct IP to IP screen sharing

Cast Screen

ffmpeg -f x11grab -i :0.0 -f mpegts -preset veryslow -r 60 udp://remote-host.com:1337
ffmpeg -f x11grab -i :0.0 -f mpegts -preset ultrafast -r 60 udp://remote-host.com:1337

ffmpeg -framerate 60 -f x11grab -i :0.0 -f mpegts -preset veryslow udp://remote-host.com:1337
ffmpeg -framerate 60 -f x11grab -i :0.0 -f mpegts -preset ultrafast udp://remote-host.com:1337

Receive Screen

ffplay -f mpegts -i udp://localhost:1337

Nvidia NVENC Hardware Encoding

ffmpeg -re -framerate 60 -f gdigrab -i desktop -f mpegts -b:v 20M -vcodec h264_nvenc udp://remote-host.com:1337

Default Video & Audio Codecs

ffmpeg -h muxer=mp4 | grep codec

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment