mirror of
https://github.com/aler9/rtsp-simple-server
synced 2026-04-22 15:07:19 +08:00
797 B
797 B
Generic webcams
If the operating system is Linux, edit mediamtx.yml and replace everything inside section paths with the following content:
paths:
cam:
runOnInit: ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -pix_fmt yuv420p -preset ultrafast -b:v 600k -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
runOnInitRestart: yes
If the operating system is Windows:
paths:
cam:
runOnInit: ffmpeg -f dshow -i video="USB2.0 HD UVC WebCam" -c:v libx264 -pix_fmt yuv420p -preset ultrafast -b:v 600k -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
runOnInitRestart: yes
Where USB2.0 HD UVC WebCam is the name of a webcam, that can be obtained with:
ffmpeg -list_devices true -f dshow -i dummy
The resulting stream will be available on path /cam.