A discord bot that replaces image/gif, text, and video posts with a rich preview
Requires Go 1.21+
make all
or CGO_ENABLED=0 go build -ldflags "-s -w" ./cmd/reddit-bot
See the default configuration file for more information.
The Reddit Bot uses yt-dlp for downloading and processing videos. This allows you to customize the post processing args for your hardware.
postProcessingArgs:
- >-
Merger+ffmpeg_i1:
-vaapi_device /dev/dri/renderD128
- >-
Merger+ffmpeg_o:
-vcodec h264_vaapi
-vf 'format=nv12,hwupload,scale_vaapi=iw/2:ih/2'
-qp 28
-fpsmax 24
-c:a libopus
-b:a 64k
When using Docker Compose you need to add this:
version: '3'
services:
reddit-bot:
...
group_add:
# Change this to match your "render" host group id.
# Use: getent group render | cut -d: -f3
- "989"
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
postProcessingArgs:
- >-
Merger+ffmpeg_i1:
-hwaccel cuda
-hwaccel_output_format cuda
- >-
Merger+ffmpeg_o:
-vf 'hwupload,scale_cuda=iw/2:ih/2'
-c:v h264_nvenc
-rc constqp
-qp 28
-fpsmax 24
-c:a libopus
-b:a 64k
Docker setup not done yet. Contributions are welcome.