docker-blueiris icon indicating copy to clipboard operation
docker-blueiris copied to clipboard

Volume mount settings and recordings only

Open TonyBrobston opened this issue 3 years ago • 9 comments

Here's where my docker-compose is at, at the moment:

version: '3'

services:
  blue-iris:
    image: leonowski/docker-blueiris:pull_request
    restart: unless-stopped
    privileged: true
    environment:
    - RESOLUTION=1440x768x24
    ports:
    - 8080:8080
    - 5900:5900
    - 81:81
    volumes:
    - ~/blue-iris/system.reg:/root/prefix/system.reg:rw
    - ~/blue-iris/userdef.reg:/root/prefix/userdef.reg:rw
    - ~/blue-iris/user.reg:/root/prefix/user.reg:rw
    - /SURVEILLANCE/blue-iris:/root/prefix/drive_c/BlueIris

Volume mounting just the couple .reg files seems to work well to get the settings into new containers, but when modifying the settings through the Blue Iris UI, they don't seem to end up back on the host machine. I'm not sure why this is.

Volume mounting the "New" and "Stored" folders gets the recordings onto the host machine, but later they magically disappear. Which has me a little baffled. Edit: I think maybe this is fixed.

Looking for advice/ideas on how to proceed.

@leonowski Any ideas?

TonyBrobston avatar Aug 31 '20 14:08 TonyBrobston

It's probably best to mount the entire wine prefix directory /root/prefix instead of individual items like the reg files. The wine prefix directory is the entire wine Windows environment needed for BlueIris to run (including the Microsoft libraries installed during initial install, windows user app data, etc.). So, if you ever want to start from scratch, you just need to delete the directory. The directory is the only thing that needs to persist.

To import reg files, you could merge it using some of the windows tools provided by wine (the same tools as windows). I'm working on ways to script this to make it easier, but you can do it through the gui now using windows regedit or the command like reg import. To bring up windows tools, right click on the desktop (it's easier to switch to a new workspace using the arrows in the lower left hand corner) > choose applications > shell > bash > wine regedit

Or, wine cmd to bring up the windows command line.

You can also do this from the docker command line from the host:

docker exec -it <name_of_container> wine cmd

I'm trying to work through a better way of managing all this using fluxbox menus. I also got a way of making this run as a windows service (like in windows). I just need to work out the details of how to make things start up nice.

leonowski avatar Aug 31 '20 18:08 leonowski

I'm trying to separate my recordings, settings, and docker-compose files.

I typically volume mount a drive that is dedicated to large storage and then volume mount my os drive to hold settings and docker-compose files. This allows me to backup my settings to GitHub (making this repo private) and then backup my docker-compose files to GitHub (and potentially make this public in the future), then us some sort of RAID to ensure I don't lose my recordings.

It seems like a solution for importing reg files would be helpful for me personally. I'll temporarily put all of /root/prefix on my video drive and hopefully help work on a reg import solution.

TonyBrobston avatar Aug 31 '20 21:08 TonyBrobston

You should still be able to keep this separate mount:

/SURVEILLANCE/blue-iris:/root/prefix/drive_c/BlueIris

Even though you're already mounting /root/prefix, you can still mount other paths under there like your existing BlueIris under drive_c. Just make sure the folder doesn't already exist.

leonowski avatar Aug 31 '20 22:08 leonowski

@TonyBrobston - it looks like switching to x64 BlueIris may have been a mistake. I didn't really test it that much until tonight. When I attempt to record anything, the app crashes pretty quickly. I went back and built the 32-bit version of things again and I don't get a crash.

Can you confirm if you see an immediate crash when recording on x64? (I just turn on "continuous recording").

leonowski avatar Sep 01 '20 08:09 leonowski

@leonowski I turned two of my cameras to "Video: Continuous", is this what you mean?

image

I didn't experience that application crashing in this case. However I did have it crash on me at least one yesterday, I think it was just running and I was doing something else; I went to look at a camera live view and noticed it was down. When I sent to view the UI on 8080 it said that Blue Irist had experience some error and had to shutdown.

TonyBrobston avatar Sep 01 '20 13:09 TonyBrobston

@leonowski I swapped over to your latest build on docker hub. Things seem good so far. I'll try to report back later today on whether I have any problems.

I was also wondering, could you provide more information on how you're using: Blue Iris, danecreekphotography/node-deepstackai-trigger, and Deepstack? I'm hoping to start configuring those. I imagine it's loosely based on this: https://www.youtube.com/watch?v=fwoonl5JKgo&t=307s I hope to configure it all in a docker-compose file, since all three of these are dockerized. Any information is much appreciated, I'm sure I can work out the majority of the details with a bit of info.

TonyBrobston avatar Sep 01 '20 14:09 TonyBrobston

node-deepstackai-trigger project has a lot of documentation here:

https://github.com/danecreekphotography/node-deepstackai-trigger/wiki

Essentially, it's a drop in replacement for the windows "AI Tool" but with a few more features. A docker-compose example for it along with deepstack AI is available at the git repo. It looks like this:

version: "3.8"
services:
  trigger:
    volumes:
      # Change d:/myfolder/myimages to point to the folder that will have the images
      # to analyze. Only change the local path that is before the :/aiinput portion.
      # Don't change the :/aiinput part. For example, if you are on Windows and your
      # images are stored locally in d:/blueiris/capturedImages your final line should
      # look like this:
      # d:/blueIris/capturedImages:/aiinput
      - /mnt/cache/aiinput:/aiinput

    environment:
      # Change this to match the timezone the images are produced in,
      # Typically this will be the timezone of the machine running
      # the Docker container. For a list of valid timezone values
      # see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
      # The value to use is in the "TZ database name" column.
      - TZ=America/Los_Angeles

    ports:
      # This port is used by the local web server when annotated images are enabled.
      # If you change the port used by the local web server in the settings.json file
      # this also has to change to match.
      - 4242:4242

    # ------------------------------------------------------------------------
    # Don't change anything below this line unless you know what you are doing
    secrets:
      - triggers
      - settings
    image: danecreekphotography/node-deepstackai-trigger:latest
    restart: always
    depends_on:
      - deepstack-ai

  deepstack-ai:
    image: deepquestai/deepstack:latest
    restart: always
    volumes:
      - localstorage:/datastore
    environment:
      - VISION-DETECTION=True

volumes:
  localstorage:

secrets:
  settings:
    # This should point to the location of the settings.json configuration file
    file: ./settings.json
  triggers:
    # This should point to the location of the triggers.json configuration file
    file: ./triggers.json

The flow of things is that blueiris will send jpgs to the /aiinput directory --> analyzed by deepstack --> trigger whatever you want appropriately (recording blueiris at full res, triggering a web request, triggering MQTT, etc.)

The documentation is really good. I found it really helpful first to use the AI tool on Windows to understand the basics and then switch to the container. Configuration after that is easy peasy.

leonowski avatar Sep 01 '20 15:09 leonowski

@leonowski Thanks for the info. I'll dig into the docs. Looks like a pretty sweet setup. I'm definitely excited to implement it.

TonyBrobston avatar Sep 02 '20 17:09 TonyBrobston

I tried the same thing, even had the volumes the same as yours. Copied the .reg files and drive_c/BlueIris folder from my running container over to the volume locations and started a fresh container with those mounted. BlueIris doesn't start the install process so it can't start. I guess I need to find out what prevents the install process.

I'm also not sure why /root/prefix32 is mounted in a volume when Blueiris 5 doesn't run from there. Maybe it's leftovers from Blueiris 4 compatibility? Guessing 4 runs 32 bit while 5 runs 64 bit.

version: "3.6"
services:
  blueiris2:
    container_name: blueiris2
    image: jshridha/blueiris:gpu
    restart: unless-stopped
    privileged: true # Necessary for running the BlueIris install the first time evidently.
#    init: true
    devices:
      - /dev/dri:/dev/dri
    environment:
      - LIBVA_DRIVER_NAME=iHD
    ports:
      - 8383:8080
      - 500:5900 # VNC Port
      - 1025:1025 # WebUI Port
    volumes:
      - /keg/docker/blueiris2:/root/prefix32:rw
      - /etc/timezone:/etc/timezone:ro
      - /usr/share/zoneinfo/America/New_York:/etc/localtime:ro
      - /keg/videos/surveillance/BlueIris/:/home/wineuser/prefix/drive_c/BlueIris:rw
      - /mnt/keg/docker/blueiris/system.reg:/home/wineuser/prefix/system.reg:rw
      - /mnt/keg/docker/blueiris/user.reg:/home/wineuser/prefix/user.reg:rw
      - /mnt/keg/docker/blueiris/userdef.reg:/home/wineuser/prefix/userdef.reg:rw
    environment:
      - PUID=1000
      - PGID=1000
      - UMASK=0077
      - TZ=America/New_York
    logging:
      options:
        max-size: "10M"
        max-file: "10"

cron410 avatar May 19 '21 01:05 cron410