Versioner sammenlignet

Nøgle

  • Linjen blev tilføjet.
  • Denne linje blev fjernet.
  • Formatering blev ændret.
Kommentar: Gliffy mass diagram converter

...

Tip

Personally I have abandoned Plex totally for Jellyfin after this article as I find it clumsy and wierd. But - there are clients for many devices, including Samsung TVs.

Update Marts 2025 - I have actually used plex for it - again - due to having Plex elsewhere, and the being able to share the Camera Libraries with my normal Plex account.

But as a stand-alone solution JellyFin is the best.

Again, very easy to spin up an Jellyfin server in a docker container:

Kodeblok
version: '3.4'
services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Copenhagen
      - JELLYFIN_PublishedServerUrl=https://camera.mos-eisley.dk/ #optional
    volumes:
      - /data/jellyfin/library:/config
      - /data/jellyfin//tvseries:/data/tvshows
      - /ftp:/data/movies
    ports:
      - 8096:8096
      - 8920:8920 #optional
      - 7359:7359/udp #optional
      - 1900:1900/udp #optional
    restart: unless-stopped

Or a Emby:

Kodeblok
version: '3.4'
services:
  emby:
    image: lscr.io/linuxserver/emby:latest
    container_name: emby
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Copenhagen
    volumes:
      - /data/emby/library:/config
      - /tvshows:/data/tvshows
      - /ftp:/data/movies
    ports:
      - 8096:8096
      - 8920:8920 #optional
    restart: unless-stopped

Or a Plex:

Kodeblok
languageshell
version: '3.4'services:  plex:    container_name: plex    restart: unless-stopped    image: plexinc/pms-docker    volumes:      - /etc/localtime:/etc/localtime:ro      - /data/plex/config:/config      - /data/plex/temp:/transcode      - /ftp:/data    ports:      - "32400:32400"    environment:      TZ: "Europe/Copenhagen"      PLEX_UID: "1000"      PLEX_GID: "1000"

Where /ftp is where my cameres cameras drops the movies via FTP:

Kodeblok
❯ ls -l
total 68
drwxrltotal 68drwxr-xr-x 3 camera www-data  4096 Jan 26 17:24 behindhouse
drwxrbehindhousedrwxr-xr-x 3 camera www-data  4096 Jan 26 17:04 bigshed
drwxrbigsheddrwxr-xr-x 4 camera www-data  4096 Feb  6 14:29 carport
drwxrcarportdrwxr-xr-x 3 camera www-data  4096 Jan 26 17:23 frontdoor
drwxrfrontdoordrwxr-xr-x 3 camera www-data  4096 Jan 26 13:05 garden

Start Jellyfin (or Emby), create a user and create 5 Libraries (one pr. cam) to the folders. make sure to select content type: Home videos and photos - to avoid Jellyfin trying to get IMDB metadata etc:

...

Now, the above pictures is a little different, as the cameraes drops files in a filenaming as: Carport_Cam_00_20250210120044.mp4 - which is not so fantastic for the human eyes and readbility, so I created a script that does take each dropped camerafile and moves it to a new directory with a better filename:

Kodeblok
#!/bin/bash
  
IFS=$'\n'

for f in $(find /ftp/carport -type f -name "Carport*.mp4"); do

THEPATHdoTHEPATH=$(dirname "${f}")
NAME=$(basename "${f}")

IFS='_'
read -ra strarr <<< "$NAME"
CAMNAME=${strarr[0]}

IFS=' '
read -ra strarr <<< "$NAME"
NAME1=${strarr[1]}
DATETIME=$(echo $NAME1 | sed 's/Cam_00_//g')

YEAR=$(echo $DATETIME | cut -c 1-4 )
MONTH=$(echo $DATETIME | cut -c 5-6 )
DAY=$(echo $DATETIME | cut -c 7-8 )
HOUR=$(echo $DATETIME | cut -c 9-10 )
MINUTE=$(echo $DATETIME | cut -c 11-12 )

mkdir -p /ftp/emby/carport/$MONTH
mkdir$MONTHmkdir -p /ftp/emby/carport/$MONTH/$DAY

NEWNAME$DAYNEWNAME="$CAMNAME $DAY-$MONTH-$YEAR $HOUR:$MINUTE.mp4"

mv "${f}" /ftp/emby/carport/$MONTH/$DAY/"${NEWNAME}"

done

chowndonechown -R camera:www-data /ftp/emby

...

Tip

The lines:

Kodeblok
mkdir -p /ftp/emby/carport/$MONTH
mkdir$MONTHmkdir -p /ftp/emby/carport/$MONTH/$DAY

NEWNAME$DAYNEWNAME="$CAMNAME $DAY-$MONTH-$YEAR $HOUR:$MINUTE.mp4"

mv "${f}" /ftp/emby/carport/$MONTH/$DAY/"${NEWNAME}"

Enforces a folder structure; - if You want to click less around $MONTH could be skipped (as we only have 10 days retention). 

...

Also I have a cleanup script:

Kodeblok
#!/bin/bash

cdbashcd /ftp/emby
findembyfind /ftp/emby -name "*.mp4" -type f -mtime +10 -delete
finddeletefind /ftp/emby -type d -mtime +11 -exec rm -rf {} \;

...