Self-hosted photo albums with PhotoPrism®
PhotoPrism® is an AI-Powered Photos App for the Decentralized Web I heard some good comments about. I tried it on my other Kubernetes cluster and here are impressions so far.
Deployment
The following deployment is based on the PhotoPrism® Setup Using Docker Compose:
Kubernetes deployment: photoprism.yaml
| photoprism.yaml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
In addition to the deployment, I create a .ppignore file at the top
level directory of the photo collection, to leave out (for now) some
of the largest parts of my photo collection, to save time on indexing,
as well as several directories of no interest:
After starting the deployment with the usual
kubectl apply -f photoprism.yaml the service is ready to use at:
$ kubectl -n photoprism get all
NAME READY STATUS RESTARTS AGE
pod/photoprism-0 1/1 Running 9 (4h14m ago) 12m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/photoprism LoadBalancer 10.108.135.112 192.168.0.220 80:31202/TCP 103m
NAME READY AGE
statefulset.apps/photoprism 1/1 103m
To make my life a little easier, I add an entry to /etc/hosts
so that I can directly visit http://photoprism.rapture.uu.am
Performance
Before using the web application, PhotoPrism® needs some time to scan and index the images. In this case, it was a good half hour:
The second CPU-intensive task was a rather lengthy preprocessing of a
movie. I tried to watch it simply because I was surprised to find that
a few videos were indexed, but then was even more surprised how long it
took to even start playing. PhotoPrism® spent a good 20 minutes running
ffmpeg; in particular this command:
/usr/bin/ffmpeg \
-i /photoprism/originals/Videos/Fan.Films/Troll.Bridge.2018/Troll.Bridge.2018.avi \
-c:v libx264 \
-map 0:v:0 \
-map 0:a:0? \
-c:a aac \
-vf scale='if(gte(iw,ih), min(4096, iw), -2):if(gte(iw,ih), -2, min(4096, ih))',format=yuv420p \
-max_muxing_queue_size 1024 \
-crf 23 \
-r 30 \
-b:v 50M \
-f mp4 \
-movflags +faststart \
-y /photoprism/storage/sidecar/Videos/Fan.Films/Troll.Bridge.2018/Troll.Bridge.2018.avi.avc
Eventually this lead to a 1.5G sidecar .avc file, for a video
that was originally 5.9G. That was taking up nearly 10% of the 17G
under /photoprism/storage and all the while all I cold see was
Big Problem
But the most surprising, and eventually frustrating of all, was that only a small portion of the overall photo library appears to have been indexed.
The library, that is the set of images not ignored by .ppignore,
is made of 14,762 65,276 JPEG files in 2,599 directories (not including a
large number of RAW files and a few stray videos).
The final scan was very incomplete, finding only 436 folders, 35 videos and 14,178 photos. Even after disabling the Quality filter only 14,762 images are found.
Going through the checklist in
Missing Pictures
the only relevant step seems to be checking .ppignore, nothing else
seems to apply here and nothing at all explains why
only 22.6% of images are found.
Even disabling all the options to Stack photos, and then forcing a full reindex.
More Problems
Additional (significant) issues:
- Images cannot be found by their file name; despite the file name
being stored in the EXIF
DocumentNametag (0x010d). - Stacks includes 351 images (stacks) despite all my attempts at disabling that feature, purging and reindexing.
- Images missing EXIF
DateTimeOriginal(0x9003) get a Taken on date of January 1st in the current year. - Only 2 out of 1,854 images geotagged in Australia are recognized.
- None of the 25 folder under
/photoprism/originals/Travel/Australiashow up under Folders. - All the folders show under Library > Originals but there is no easy to even re-index a single folder.
Other (not so minor) issues:
- All 3 layouts use square thumbnails.
- Some images without GPS tags are somehow geolocated in Canada.
Other (really minor) issues:
- Monochrome includes a few images with quite a bit of color.
- Panoramas are essentially any images with an aspect ratio beyond some threshold (e.g. 21:9), including small screenshots and cropped photos.
- Scans includes just one photo, even though there are hundreds of scanned film photos.

