v4l2rtspserver
#4780
Replies: 2 comments
-
|
FFmpeg already allows to ingest v4l2 devices and publish them with RTSP, to MediaMTX, without the need of instantiating an additional RTSP server: paths:
cam1:
runOnInit: ffmpeg -f v4l2 -input_format h264 -framerate 30 -video_size 640x480 -i /dev/v4l/cam1 -c:v copy -f rtsp rtsp://localhost:50723/cam1
runOnInitRestart: true
source: publisher |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
The only reason to use Publishing video stream via Unix socket may be a better approach: paths:
cam1:
runOnInit: ffmpeg -f v4l2 -input_format h264 -framerate 30 -video_size 640x480 -i /dev/v4l/cam1 -c:v copy -f mpegts unix:/tmp/cam1.sock
runOnInitRestart: true
source: unix+mpegts:///tmp/cam1.sock |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is just quick note describing how to use v4l2rstpserver utility with MediaMTX to capture compressed video from V4L2 devices (e.g. webcams).
v4l2rtspserveris a really small utility with minimal dependencies.MediaMTX path definition
Required parameters of
v4l2rtspserver-F- capture framerate,-W- video width,-H- video height,-u- postfix of RTSP URI,/dev/v4l/cam- path to V4L2 device,-P 50723-50723is a randomly chosen IP port; remember to use different port numbers when defining more than one MediaMTX paths.Optional parameters of
v4l2rtspserver-I localhost- bind server to localhost only; do not exposev4l2rtspserveroutside,-s- reduces number of threads created byv4l2rtspserver,-t- specify short timeout.Remember.
v4l2rtspserverutility is useful only for devices supporting compressed (MJPEG, H.264) video stream. Usev4l2-ctlutility to check supported video formats:Beta Was this translation helpful? Give feedback.
All reactions