about summary refs log tree commit diff
path: root/fun/tvl
diff options
context:
space:
mode:
Diffstat (limited to 'fun/tvl')
-rw-r--r--fun/tvl/default.nix18
-rw-r--r--fun/tvl/stream.sh14
2 files changed, 18 insertions, 14 deletions
diff --git a/fun/tvl/default.nix b/fun/tvl/default.nix
new file mode 100644
index 000000000000..6dc5fa89a0c7
--- /dev/null
+++ b/fun/tvl/default.nix
@@ -0,0 +1,18 @@
+{ depot, ... }:
+
+depot.third_party.writeShellScriptBin "start-tvl-stream" ''
+  env LD_LIBRARY_PATH=/run/opengl-driver/lib/ ${depot.third_party.ffmpeg}/bin/ffmpeg \
+       -vsync 0 \
+       -hwaccel cuvid \
+       -init_hw_device cuda=0 -filter_hw_device 0 \
+       -f x11grab \
+       -video_size 1920x1080 \
+       -framerate 30 \
+       -i :0.0+0,0 \
+       -filter:v "format=nv12,hwupload,scale_npp=w=1280:h=720:interp_algo=lanczos" \
+       -c:v h264_nvenc \
+       -preset:v llhq \
+       -rc:v cbr_ld_hq \
+       -an \
+       -f flv rtmp://tazj.in:1935/tvl
+''
diff --git a/fun/tvl/stream.sh b/fun/tvl/stream.sh
deleted file mode 100644
index 99030ab7698b..000000000000
--- a/fun/tvl/stream.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-env LD_LIBRARY_PATH=/run/opengl-driver/lib/ ffmpeg \
-     -vsync 0 \
-     -hwaccel cuvid \
-     -f x11grab \
-     -video_size 1920x1080 \
-     -framerate 60 \
-     -i :0.0+0,0 \
-     -vf "scale_npp=1280:720" \
-     -c:v h264_nvenc \
-     -preset fast \
-     -an \
-     -f flv rtmp://tazj.in:1935/tvl