Sign inSign up

jennettwheeler/inter_vid_timelapse

By jennettwheeler

•Updated over 6 years ago

Image
0

226

jennettwheeler/inter_vid_timelapse repository overview

A container that produces timelapses between video files featuring linuxserver's architecture :-

  • easy user mappings (PGID, PUID)
  • custom base image with s6 overlay
  • uses a base OS that has weekly updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
  • however, these images are only updated when new motioneye releases are available

⁠jennettwheeler/inter_vid_timelapse⁠

Calculates duration of each video and produces timelapses between those videos from snapshots.

Designed to work with motioneye where the media directory is structured as // with files named with time. Images are expected to be jpg and videos mp4.

⁠Requirements

  • Images and Movies are set to have a filename of "%Y-%m-%d/%H-%M-%S" within a sub directory for each camera.
    • E.g. /media/lounge/2020-03-04/09-43-21.jpg
  • Movies are stored as mp4 files.

⁠Processing Description

  • The program will monitor each camera's sub directories for new mp4 files.
  • The latest mp4 file will be ignored (except for identifying it's start time)
  • A timelapse will be created between each video file. If there is no gap between video files, then no timelapse will be created.
  • Any snapshots used in a timelaspe will be removed to save space.
  • Any snapshots that are already covered by a video will also be removed.
  • Video durations will not be calculated for videos that have a timelapse following them as it will be assumed that this video was checked in a previous loop.
  • However, if a blank suffix is supplied, then durations of every video file will need to be calculated to check for gaps (so this is not reccommended).
  • Following processing, a minute's delay will occur before starting again.

⁠Version Tags

This image provides various versions that are available via tags. latest tag usually provides the latest stable motioneye version.

TagDescription
latestLatest stable Motioneye release

⁠Usage

Here are some example snippets to help you get started creating a container.

⁠docker
docker create \
  --name=inter_vid_timelapse \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -e UMASK_SET=022 `#optional` \
  -e TL_FPS=1 `#optional`\
  -e TL_SUFFIX=_TL `#optional`\
  -v <path to media>:/media \
  --restart unless-stopped \
  jennettwheeler/inter_vid_timelapse
⁠docker-compose

Compatible with docker-compose v2 schemas.

---
version: "2"
services:
  inter_vid_timelapse:
    image: jennettwheeler/inter_vid_timelapse
    container_name: inter_vid_timelapse
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - UMASK_SET=022 #optional
      - TL_FPS=1 #optional
      - TL_SUFFIX=_TL #optional
    volumes:
      - <path to media>:/media
    restart: unless-stopped

⁠Parameters

Container images are configured using parameters passed at runtime (such as those above).

ParameterFunction
-e PUID=1000for UserID - see below for explanation
-e PGID=1000for GroupID - see below for explanation
-e TZ=Europe/LondonSpecify a timezone to use EG Europe/London
-e UMASK_SET=022control permissions of files and directories
-e TL_FPS=1the playback fps for the resulting timelapse files (defaults to 1)
-e TL_SUFFIX=_TLthe optional suffix for the resulting timelapse files (defaults to no suffix)
-v /mediaMotioneye media files

⁠Environment variables from files (Docker secrets)

You can set any environment variable from a file by using a special prepend FILE__.

As an example:

-e FILE__PASSWORD=/run/secrets/mysecretpassword

Will set the environment variable PASSWORD based on the contents of the /run/secrets/mysecretpassword file.

⁠User / Group Identifiers

When using volumes (-v flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance PUID=1000 and PGID=1000, to find yours use id user as below:

  $ id username
    uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)

 

⁠Application Setup

N/A, runs in the background with no UI.

⁠Support Info

  • Shell access whilst the container is running: docker exec -it inter_vid_timelapse /bin/bash
  • To monitor the logs of the container in realtime: docker logs -f inter_vid_timelapse

⁠Updating Info

Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (ie. nextcloud, plex), we do not recommend or support updating apps inside the container. Please consult the Application Setup⁠ section above to see if it is recommended for the image.

Below are the instructions for updating containers:

⁠Via Docker Run/Create
  • Update the image: docker pull linuxserver/inter_vid_timelapse
  • Stop the running container: docker stop inter_vid_timelapse
  • Delete the container: docker rm inter_vid_timelapse
  • Recreate a new container with the same docker create parameters as instructed above (if mapped correctly to a host folder, your /config folder and settings will be preserved)
  • Start the new container: docker start inter_vid_timelapse
  • You can also remove the old dangling images: docker image prune
⁠Via Docker Compose
  • Update all images: docker-compose pull
    • or update a single image: docker-compose pull inter_vid_timelapse
  • Let compose update all containers as necessary: docker-compose up -d
    • or update a single container: docker-compose up -d inter_vid_timelapse
  • You can also remove the old dangling images: docker image prune
⁠Via Watchtower auto-updater (especially useful if you don't remember the original parameters)
  • Pull the latest image at its tag and replace it with the same env variables in one run:
    docker run --rm \
    -v /var/run/docker.sock:/var/run/docker.sock \
    containrrr/watchtower \
    --run-once inter_vid_timelapse
    

Note: We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using Docker Compose.

  • You can also remove the old dangling images: docker image prune

⁠Building locally

If you want to make local modifications to these images for development purposes or just to customize the logic:

git clone https://[email protected]/jennett-wheeler/inter_vid_timelapse.git
cd inter_vid_timelapse
docker build \
  --no-cache \
  --pull \
  -t jennettwheeler/inter_vid_timelapse:latest .

⁠Versions

  • 2020-03-04: - Initial Release.

Tag summary

Content type

Image

Digest

Size

26.9 MB

Last updated

over 6 years ago

docker pull jennettwheeler/inter_vid_timelapse