-
-
Save ntrp/16b155fa97d647db0d18 to your computer and use it in GitHub Desktop.
Live Streaming to Youtube - Linux/Ffmpeg/PulseAudio/Generic Webcam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One webcam: | |
ffmpeg -f alsa -ac 2 -i pulse -f v4l2 -s 1280x720 -r 10 -i /dev/video0 -vcodec libx264 -pix_fmt yuv420p101e -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 4 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMKEY | |
Two webcam overlay: | |
ffmpeg -f alsa -ac 2 -i pulse -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMKEY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just removed
-pix_fmt yuv420p101e
and it works