Skip to content
/ latham Public

Network/RTSP camera recording and long-term timelapsing inspired by rebuilding my house under the watchful eye of a few Ubiquity cameras.

License

Notifications You must be signed in to change notification settings

abock/latham

Repository files navigation

Latham: Create Long-Running Timelapse Videos

.NET Core

Latham is a fully featured multi-source video stream recording, indexing, and timelapsing project geared towards creating long-running timelapse footage.

  • Record: from multiple sources (e.g. RTSP camera feeds) on a schedule (expressed in crontab notation):

    Save 5 seconds of video from each camera every ten minutes.

  • Index: keep an index of all recordings up to date for fast querying when it comes time to compose a timelapse. An index can be rebuilt from a path pattern and kept up to date directly from the record operation as well.

  • Filter: filter the index for recorded clips matching time-based predicates

    Select all recordings for the back camera, Monday through Friday, between 8am and 5pm, and not during the last week of February, 2020.

  • Compose: create a timelapse video from filtered clips.

    Given all footage that makes it through the filter, create a timelapse lasting one minute.

All of the above can be expressed in a Latham project file:

{
  "name": "Latham Way Construction Project",
  "description": "2020 Home Rebuild",
  "recordings": {
    "outputPath": "{tag}/{DateTime.Now:yyyy/MM/dd}/{tag}-{DateTime.Now:yyyy-MM-dd_HH.mm.sszzz}.mp4",
    "duration": "5s",
    "schedule": "*/10 * * * *",
    "unifiProtectEndpoints": [
      "https://user:password@unifi-cloud-key-host:7443"
    ],
    "sources": [
      {
        "tag": "back",
        "uri": "rtsp://unifi-cloud-key-host:7447/camera-channel-id1"
      },
      {
        "tag": "front",
        "uri": "rtsp://unifi-cloud-key-host:7447/camera-channel-id2"
      },
      {
        "tag": "driveway",
        "uri": "rtsp://unifi-cloud-key-host:7447/camera-channel-id3"
      }
    ]
  },
  "ingestions": [
    {
      "basePath": "/Volumes/LathamViewData",
      "pathGlob": "**/*.mp4",
      "pathFilter": "[\/\\\\](?<tag>\\w+)-(?<yyyy>\\d{4})-(?<MM>\\d{2})-(?<dd>\\d{2})_(?<HH>\\d{2}).(?<mm>\\d{2}).(?<ss>\\d{2})(?<z>[+-]\\d{4})?\\.mp4$"
    }
  ],
  "timelapses": [
    {
      "tagMatch": ".*",
      "include": [
        "Monday .. Friday",
        "8am .. 5pm"
      ],
      "exclude": [
        "2020-2-2",
        "2020-2-5 .. 2020-2-9",
        "2020-2-26 .. 2020-2-27"
      ]
    }
  ]
}

About

Network/RTSP camera recording and long-term timelapsing inspired by rebuilding my house under the watchful eye of a few Ubiquity cameras.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages