Skip to content

Instantly share code, notes, and snippets.

View AvalancheTheory's full-sized avatar

AvalancheTheory

View GitHub Profile
@AvalancheTheory
AvalancheTheory / youtube_stream.sh
Last active August 29, 2015 14:15
These are the sample settings to get a youtube recording using ffmpeg
ffmpeg -f x11grab -video_size 1920x1080 -framerate 30 -i :0.0+1920,0 \
-f v4l2 -video_size 640x360 -framerate 30 -i /dev/video0 \
-f alsa -ac 2 -i pulse -filter_complex \
"[0:v]setpts=PTS-STARTPTS[bg]; \
[1:v]setpts=PTS-STARTPTS[fg]; \
[bg][fg]overlay=W-w-10:10,format=yuv420p[out]" \
-map "[out]" -map 2:a -vcodec libx264 -preset veryfast \
-maxrate 6000k -bufsize 12000k -acodec libmp3lame -ar 44100 -b:a 128k \
-g 60 \
-f flv rtmp://a.rtmp.youtube.com/live2/{YOUTUBE_KEY}