Webcam video streaming with WebRTC and FFMPEG
git clone https://github.com/nkien0204/webrtc-ffmpeg.git
go build main.go
- Base on your OS to download ffmpeg binary version.
- After downloading, put the
ffmpeg
binary file into the project, (<PATH>/webrtc-ffmpeg/ffmpeg.exe
) for example.
So now we have these files for running: main.exe
, .env
, ffmpeg.exe
and index.html
.
Run cmd:
./main serve wf
Take a look into .env
file
LOG_***
: for log config.HTTP_ADDR
: HTTP server address.WEBCAM_NAME
: name of your webcam device.SCREEN_RESOLUTION
: width and height for video (default is 640x360)
You must write the name of your webcam correctly
Go to browser and enter: http://<address>/get-player
. It will show a simple player for streaming your webcam!