Announcement

Collapse
No announcement yet.

Snap image from RTSP security camera stream using FFMPEG?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Snap image from RTSP security camera stream using FFMPEG?

    I currently have a Reolink NVR with 5 cameras. Essentially I want to grab an image from the RTSP stream, I'm assuming I would use FFMPEG to accomplish this. I can not use the native snapshot feature since the cameras are directly connected to the NVR.

    I figured out how to get a snapshot from the RTSP stream using FFMPEG using this command:
    Code:
    ffmpeg -y -i rtsp://user:password@192.1.1.1/h264Preview_04_sub -vframes 1 snapshot.jpg
    How can I get this into HomeSeer as a device?

    #2
    I have never used a Reolink NVR. Mostly all newer IP HD cameras are similar sort of using their own APIs (a bit proprietary) relating to the capture of a JPG. The only standard is that it is a JPG capture. Some API's allow for a specifically sized resolution capture on the command line (which is html). You might be able to concurrently utilize Blue Iris with the NVR and then utilize the Homeseer Blue Iris plugin. Here utilize Zoneminder as an NVR (many years now) which works with just about any IP camera.

    I am guessing that your cameras are on an autonomous IP network and your NVR is on the main home network.

    Relating Homeseer and Homeseer Windows Touch client.

    There are a couple of ways I have done this. (I have also used only VLC external program on the HSTouch for Windows Client). Easier to use html lines defined in your HSDesigner for the client.

    1 - Windows Homeseer client - it is just a HTTP text line to grab the JPG directly from the Zoneminder NVR or directly from the IP HD camera. Easiest for me to use the Zoneminder NVR.
    2 - Linux Homeseer server - similiar grabs the posts in a Homeseer directory of cctv images.

    First test the jpg grab in a browser on the client. Then write that html line to a text box using designer. That is what I do here.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #3
      Thank you for your help. I am not looking to implement this in HSTouch but into a virtual device in HS, so I can send it as an attachment either using Pushover (using the Pushover 3P plugin or through email).

      Comment


        #4
        I figured it out by creating an event and emailing the image as a text message.

        Edit: I'm not sure why it says the image doesn't exist but it is there and it triggers successfully.
        Attached Files

        Comment


          #5
          I do the same with text messages and image attachments.

          Above you have to define what directory the image is in and then read it from said directory.
          home
          IE: I use the image directory under the html directory which would be subdirectory. IE:

          html\cameras\frontdoor\frontdoor jpgs if you have homeseer as the root directory.

          Above it looks to be writing the jpg in the homeseer hs3/ffmpg/bin directory and reading from the /programfiles/homeseer HS3/programfiles/homeseer directory which doesn't really exist.

          You want to write it to launch then instead of "Snapshot_camera_4.jpg" you want to put the whole directory and name of file...."/homeseer/html/images/snapshot.jpg" and read it from the same directory.

          Relating to creating a device here I cheat a bit and use WeatherXML which will create a device variable image on demand or scheduled. Instead of a map variable I create an HD IP camera image.

          You define the image source in the map source configuration section of WeatherXML.

          Then also send a message with same said JPG attached as it is stored in an image sub directory as one name. IE: front door is just one image called frontdoor.jpg.

          If you want to get fancy you can utilize Jon00's image creator. Here you take your base image and overlay Homeseer variables to it if you want like time, temperature, trigger source, et al. It takes only a few seconds to do this with Jon00's program. You build the JPG image with an ini configuration which provides overlays. You give the image a new name and attach it to your text message or just send the image if you want with no text.
          Last edited by Pete; August 22, 2017, 04:06 PM.
          - Pete

          Auto mator
          Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
          Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
          HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

          HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
          HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

          X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

          Comment


            #6
            Originally posted by Pete View Post
            Above you have to define what directory the image is in and then read it from said directory.
            home
            IE: I use the image directory under the html directory which would be subdirectory. IE:

            html\cameras\frontdoor\frontdoor jpgs if you have homeseer as the root directory.

            Above it looks to be writing the jpg in the homeseer hs3/ffmpg/bin directory and reading from the /programfiles/homeseer HS3/programfiles/homeseer directory which doesn't really exist.

            You want to write it to launch then instead of "Snapshot_camera_4.jpg" you want to put the whole directory and name of file...."/homeseer/html/images/snapshot.jpg" and read it from the same directory.
            I took your advice but I keep getting the email attachment does not exist error.
            Attached Files

            Comment

            Working...
            X