Files
gitlab-instance-0a899031_do…/obs1.sh
Your Name 3ccbf3d973 hdmi
2026-01-27 08:55:32 +00:00

24 lines
823 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 先确保有推流pm2 start tiktok/youtube 等,让 ffmpeg 推到 SRS 的 live/livestream
export SDL_VIDEODRIVER=kmsdrm # 尝试 SDL 的 DRM 驱动(直接 HDMI 输出,无需 DISPLAY
mpv \
--fs \
--no-border \
--vo=drm \
--drm-device=/dev/dri/card0 \ # 如果 card0 不对,改 card1ls /dev/dri/ 查看)
--hwdec=auto \
--video-sync=display-resample \
--untimed \
--cache=no \
--demuxer-lavf-o=ffflags=nobuffer \
--demuxer-lavf-probesize=32 \
--demuxer-lavf-analyzeduration=0 \
--vf=setpts=PTS-STARTPTS \
--no-audio \
--loop=inf \
http://127.0.0.1:8081/live/livestream.flv # 先用 HTTP-FLV 测试(稳定,不依赖 SRT
# 如果 HTTP-FLV 正常,再切回 SRT
# 'srt://127.0.0.1:10080?streamid=#!::r=live/livestream,m=request&latency=10'