Skip to content

Instantly share code, notes, and snippets.

@bongole
Created December 12, 2022 16:15
Show Gist options
  • Save bongole/2c95fa6d96f1df57e91b2f9a55ed07d6 to your computer and use it in GitHub Desktop.
Save bongole/2c95fa6d96f1df57e91b2f9a55ed07d6 to your computer and use it in GitHub Desktop.
YouTubeにテスト動画を流すスクリプト
#!/usr/bin/env bash
RTMP_URL="rtmp://a.rtmp.youtube.com/live2/<STREAM-KEY>"
ffmpeg \
-re \
-f lavfi -i "testsrc=s=1920x1080:r=30,format=yuv420p" \
-f lavfi -i "sine=f=440:b=4" \
-vf "drawtext=text='%{pts\:localtime\:$(date +%s)\:%Y-%m-%d %T}':fontsize=48:fontcolor=white:box=1:boxborderw=6:[email protected]:x=(w-text_w)/2:y=h-text_h-20" \
-vcodec libx264 -pix_fmt yuv420p -preset medium -r 30 -b:v 1M \
-acodec aac -ar 44100 -b:a 128k \
-f flv \
"$RTMP_URL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment