ffmpeg -f dshow -i video="Logitech HD Pro Webcam C920" -f dshow -i audio="Micrófono (5- Samson Meteor Mic)" -r 60 -vcodec libx264 -preset ultrafast -tune zerolatency -crf 18 -b:v 500k -bufsize 300k -f rtp_mpegts udp://192.168.1.121:1234
Streaming with dropping frames
ffmpeg -f dshow -i video="Logitech HD Pro Webcam C920" -f dshow -i audio="Micrófono (5- Samson Meteor Mic)" -r 30 -vcodec libx264 -preset ultrafast -tune zerolatency -crf 18 -b:v 1500k -bufsize 2500k -pix_fmt yuv420p -async 1 -vsync 1 -f flv rtmp://live.twitch.tv/app/{code}
Streaming to twitch (remove dropping frames)
ffmpeg -f dshow -i video="Logitech HD Pro Webcam C920" -f dshow -i audio="Micrófono (5- Samson Meteor Mic)" -r 24 -vcodec libx264 -preset ultrafast -tune zerolatency -crf 18 -b:v 1500k -bufsize 2500k -pix_fmt yuv420p -async 1 -vsync 1 -vf mpdecimate,setpts=N/FRAME_RATE/TB -f flv rtmp://live.twitch.tv/app/{code}
Streaming desktop (and audio). You need first install https://github.com/rdp/screen-capture-recorder-to-video-windows-free
ffmpeg -y -loglevel warning -f dshow -i video="screen-capture-recorder":audio"=virtual-audio-capturer" -threads 4 -r 30 -vcodec libx264 -preset ultrafast -tune zerolatency -crf 18 -b:v 1500k -bufsize 2500k -pix_fmt yuv420p -async 1 -vsync 1 -f flv rtmp://live.twitch.tv/app/{code}
Streaming audio recording from computer and microphone and display emacs:
References:
- http://ffmpeg.org/ffmpeg-filters.html#amerge
- https://stackoverflow.com/questions/14212503/ffmpeg-overlay-issue-for-2-videos-sound-missing-from-second-input
- rdp/screen-capture-recorder-to-video-windows-free#84
- https://superuser.com/questions/1210033/ffmpeg-directshow-multiple-audio-capture
ffmpeg -y -loglevel warning -f dshow -rtbufsize 1000M -i audio="virtual-audio-capturer" -f dshow -rtbufsize 2000M -i audio="Micrófono (5- Samson Meteor Mic)" -f gdigrab -rtbufsize 1000M -i title="emacs" -r 30 -vcodec libx264 -preset ultrafast -tune zerolatency -crf 22 -b:v 1500k -bufsize 3500k -maxrate 1000k -pix_fmt yuv420p -async 1 -vsync 1 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -filter_complex amix=inputs=2 -f flv test.mp4
if twitch gives an I/O error, pls update your key
ffmpeg -y -loglevel warning -f dshow -rtbufsize 1000M -i audio="virtual-audio-capturer" -f dshow -rtbufsize 2000M -i audio="Micrófono (5- Samson Meteor Mic)" -f gdigrab -rtbufsize 1000M -i title="emacs" -r 30 -vcodec libx264 -preset ultrafast -tune zerolatency -crf 22 -b:v 1500k -bufsize 3500k -maxrate 1000k -pix_fmt yuv420p -async 1 -vsync 1 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -filter_complex amix=inputs=2 -f flv rtmp://live-mad.twitch.tv/app/{code}