I did an implementation for capturing from an RTSP using FFMPEG (via RunProcess
):
capture = CaptureFromIPCamera[
"D:\\ffmpeg\\bin\\ffmpeg.exe",
"rtsp://10.6.149.218/live.sdp"
]
You can get this function from my Prototypes
paclet:
PacletInstall @ "https://github.com/arnoudbuzing/prototypes/releases/download/v0.2.9/Prototypes-0.2.9.paclet"
Or, if you prefer, you can just copy this one function from this source file:
https://github.com/arnoudbuzing/prototypes/blob/master/Prototypes/Image.wl#L41
The function works by simply calling the FFMPEG binary from the Wolfram Language with the right options to sample one image from an RTSP stream, and then importing that image. The implementation can probably be improved a lot, for example by directly importing from FFMPEG's standard output.
cvlc
) documentation on how to send decoded output to a pipe. Create a named pipe (if you're on a Unix-like system), and pipe the output in there. Use Mathematica'sBinaryRead
or related functions to read frames one by one. Mathematica has no builtin functionality to read from video streams. This is what'd I look into first if I really had to do this, but honestly, it's a long shot. $\endgroup$