diff --git a/app/templates/index.html b/app/templates/index.html index 907ba01..16dad11 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -95,11 +95,22 @@
If you're on X11 (or a Wayland session with Xwayland exposing
:0.0), this captures your screen + default audio
directly, no extra tools needed:
ffmpeg -f x11grab -framerate 30 -i :0.0 -f pulse -i default -c:v libx264 -preset veryfast -tune zerolatency -pix_fmt yuv420p -c:a aac -b:a 128k -f flv "<url you were given>"-
Swap -preset veryfast for ultrafast on
- weaker machines, or fast/medium if you
- have CPU to spare. RTMP/FLV requires H.264 video and AAC audio —
- other codecs won't work here.
ffmpeg -f x11grab -framerate 30 -i :0.0 -f pulse -i default -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -c:a aac -b:a 128k -f flv "<url you were given>"+
-preset ultrafast keeps CPU usage low for real-time
+ software encoding — if you're dropping frames on a weaker machine,
+ try lowering -framerate (e.g. 20) rather
+ than the resolution, which tends to look better for the same CPU
+ savings. If you have a GPU with VAAPI support, hardware encoding is
+ far less CPU-intensive — replace the video input/encode portion
+ with:
ffmpeg -vaapi_device /dev/dri/renderD128 -f x11grab -framerate 30 -i :0.0 -f pulse -i default -vf 'format=nv12,hwupload' -c:v h264_vaapi -b:v 4M -c:a aac -b:a 128k -f flv "<url you were given>"+
(adjust /dev/dri/renderD128 if you have multiple GPUs —
+ check ls /dev/dri.) RTMP/FLV requires H.264 video and
+ AAC audio —
+ some distro ffmpeg builds (e.g. Slackware) ship without these
+ encoders for licensing reasons; check with
+ ffmpeg -encoders | grep -E "libx264|aac", or use OBS
+ instead, which bundles its own encoder support.
For rebroadcasting a pre-recorded file or another running stream instead of capturing your screen: