Skip to content

Instantly share code, notes, and snippets.

@Rafat97
Last active November 26, 2021 13:55
Show Gist options
  • Save Rafat97/da04759b3a8f1ca3182706bb0856532f to your computer and use it in GitHub Desktop.
Save Rafat97/da04759b3a8f1ca3182706bb0856532f to your computer and use it in GitHub Desktop.
FFMPEG webcam udp livestreaming

💣 FFMPEG webcam UDP livestreaming 💣

Windows

Download FFMPEG

https://www.ffmpeg.org/download.html

How to Install FFmpeg on Windows

https://www.wikihow.com/Install-FFmpeg-on-Windows

How to

Get the device info

ffmpeg -list_devices true -f dshow -i dummy

Basic output image

Stream command

ffmpeg ^
-f dshow ^
-i video="HP Truevision HD" ^
-preset ultrafast ^
-vcodec libx264 ^
-tune zerolatency ^
-b 900k ^
-f mpegts udp://127.0.0.1:35001?pkt_size=1316

Basic output image

For VLC (Have Long Latency)

udp://@127.0.0.1:35001

image image

For FFPLAY (Have Low Latency)

ffplay -probesize 32 -sync ext  udp://@127.0.0.1:35001

Resources

https://trac.ffmpeg.org/wiki/StreamingGuide

https://gist.github.com/mhanney/dc329b1d9bff032b3600a1f7b44099e5

http://4youngpadawans.com/stream-camera-video-and-audio-with-ffmpeg/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment