Using VLC to capture an image from an RTSP video stream 4 August 2016Posted by David Wilson in General.
This exercise was harder than it should have been.
I’ve got me a shiny new security camera. http://www.aliexpress.com/item/Multi-language-Wifi-Wireless-Camera-IP-1080P-Auto-PTZ-Dome-Camera-DS-2DE2202-DE3-W-3X/32556807980.html?spm=2114.13010608.0.73.cIC8rO
It supports RTSP for streaming the video and audio from the camera to what ever is watching.
The software in the webcam also says it supports snapshots at regular intervals that you can set… after trawling through the menus I haven’t yet figured out how to get the image off the camera to my server.
I could write my own software to pick up the RTSP video stream and grab a frame at regular intervals… but before I do that I wonder if some other clever people have already solution this? see PLAN C.
It’s supported by VLC! http://www.videolan.org
And VLC has a command line interface… so this can be automated with a script. That’s simple stuff. For now what’s important is testing getting the image via the command line and VLC. Let’s just say this took a while to sort out. Web references to older versions of software. Differences between the different platforms that VLC is supported on as well. Anyway, long story short. Here’s the syntax.
/Applications/VLC.app/Contents/MacOS/VLC -I rc -v rtsp://admin:firstname.lastname@example.org –video-filter=scene –scene-format=png –scene-prefix=CameraImage –scene-path=. –scene-replace –scene-ratio=30 –sout-x264-lookahead=1 –sout-x264-tune=stillimage –vout=dummy –aout=dummy –run-time 5 vlc://quit