Files
kioubit-ipv6-canvas-streamer/stream_to_telegram.sh

28 lines
575 B
Bash
Executable File

#!/usr/bin/env bash
CURRENT_DIRECTORY="$(pwd)"
# Telegram forces 16:9 aspect ratio for streams
python3 "$CURRENT_DIRECTORY/fetch_stream.py" | ffmpeg \
-hide_banner \
\
-f rawvideo \
-pix_fmt rgb24 \
-s:v 512x512 \
-r 25 \
-i - \
\
-vf "scale=910:512:force_original_aspect_ratio=decrease,pad=910:512:(ow-iw)/2:(oh-ih)/2,setsar=1" \
\
-vcodec libx264 \
-crf 17 \
-preset slow \
-tune stillimage \
-g 50 \
-profile:v main \
\
-f flv \
-flvflags no_duration_filesize \
-pix_fmt yuv420p \
"$1"