Skip to content

Instantly share code, notes, and snippets.

@pierrelux
Created February 14, 2017 22:01
Show Gist options
  • Save pierrelux/a4dd10f005dd351712d5cbe35d557e20 to your computer and use it in GitHub Desktop.
Save pierrelux/a4dd10f005dd351712d5cbe35d557e20 to your computer and use it in GitHub Desktop.
Stream to Youtube Live using ffmpeg and save a local copy
ffmpeg -f video4linux2 -thread_queue_size 512 -input_format mjpeg -video_size hd720 -i /dev/video0 \
-f alsa -thread_queue_size 512 -i hw:1,0,0 \
-acodec mp3 -async 1 -vcodec libx264 -preset veryfast output.mp4 \
-acodec mp3 -ar 44100 -vcodec libx264 -preset ultrafast -maxrate 1984k -bufsize 3968k -g 60 -f flv rtmp://x.rtmp.youtube.com/live2/yourid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment