Skip to content

Instantly share code, notes, and snippets.

@xbelanch
Last active October 8, 2022 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xbelanch/77c7cddbe0e023cff8cd473a7741845d to your computer and use it in GitHub Desktop.
Save xbelanch/77c7cddbe0e023cff8cd473a7741845d to your computer and use it in GitHub Desktop.
ffmpeg windows 10 streaming udp
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:

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment