Skip to content

Instantly share code, notes, and snippets.

@azureru
Last active October 22, 2021 03:47
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 azureru/c7bd45377aaf9673ec9a8af1d8d49cc7 to your computer and use it in GitHub Desktop.
Save azureru/c7bd45377aaf9673ec9a8af1d8d49cc7 to your computer and use it in GitHub Desktop.
FFMPEG stream to Janus stream plugin

FFMPEG stream to Janus Server stream-plugin from Video Capture Device

FFMPEG

Using ffmpeg for windows from gyan.dev at https://www.gyan.dev/ffmpeg/builds/, it is executed in WSL shell (in case you are wondering with all the shell syntax - for cmd or PowerShell just change it to windows path)

To List DirectShow Capture Devices

See https://trac.ffmpeg.org/wiki/DirectShow

./ffmpeg.exe -list_devices true -f dshow -i dummy

Stream Audio Only

./ffmpeg.exe -f dshow \
   -i audio="Digital Audio Interface (2- ezcap U3 capture)" \
   -acodec opus -strict -2 -vn -f rtp udp://janus-url:5002?pkt_size=1200

Stream Video and Audio

./ffmpeg.exe \
  -f dshow \
  -i video="ezcap U3 capture":audio="Digital Audio Interface (2- ezcap U3 capture)" \
  -an \
  -vcodec libx264 \
  -f rtp udp://janusurl:5004?pkt_size=1200 \
  -acodec opus \
  -vn \
  -f rtp udp://janusurl:5002?pkt_size=1200

Using Elgato

./ffmpeg.exe -f dshow -i video="Game Capture HD60 S+":audio="Digital Audio Interface (Game Capture HD60 S+)" \
-an -f null NUL -acodec libopus \
-filter:a "volume=2.0" -vn -f \
rtp udp://janus-audiourl:5002?pkt_size=1200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment