commit bebcdb481c4980c9b6469a080b5f4361a3929c70
parent fd79aa766e936d1767d6fd61fa62e448f1de1bc2
Author: Oliver Lowe <o@olowe.co>
Date: Tue, 11 Jun 2024 13:16:39 +1000
add xstream
Diffstat:
3 files changed, 53 insertions(+), 1 deletion(-)
diff --git a/README b/README
@@ -7,6 +7,6 @@ The following commands are provided:
hits - count web traffic
hlsget - download the contents of a HLS playlist
jsfmt - format javascript source code
-knocknocauth - create and close knocknoc sessions
lemmyverse - find lemmy communities
webpaste - create a web paste on webpaste.olowe.co
+xstream - stream X display over the network
diff --git a/bin/xstream b/bin/xstream
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+usage='usage: xstream addr'
+
+if test $# -ne 1
+then
+ echo $usage
+ exit 127
+fi
+
+addr=$1
+ffmpeg -hide_banner -f x11grab -i $DISPLAY -r 25 \
+ -f mpegts -c:v mpeg2video -b:v 3000k udp://$addr
diff --git a/man/xstream.1 b/man/xstream.1
@@ -0,0 +1,39 @@
+.Dd
+.Dt XSTREAM 1
+.Sh NAME
+.Nm xstream
+.Nd stream X display over the network
+.Sh SYNOPSIS
+.Nm
+.Ar address
+.Sh DESCRIPTION
+.Nm
+captures the primary
+.Xr X 7
+display from
+.Ev DISPLAY
+and sends encoded video to
+.Ar address
+via MPEG-TS in UDP.
+.Ar address
+must be provided in
+.Ar host:port
+format.
+.Pp
+Video is encoded with MPEG-2 at a bitrate of 3000kbps.
+This is to minimise the use of system resources
+on machines with older processors
+and on systems with no hardware video encoding support.
+To customise these settings,
+study the
+.Nm
+script and use
+.Xr ffmpeg 1
+directly.
+.Sh EXIT STATUS
+.Ex
+.Sh EXAMPLE
+Send video to live.olowe.co port 6969:
+.Dl xstream live.olowe.co:6969
+.Sh SEE ALSO
+.Xr ffmpeg 1