photoprism/pkg/media
2026-06-24 17:20:30 +02:00
..
colors Links: Use canonical trailing-slash form for website URLs 2026-06-24 17:20:30 +02:00
projection Links: Use canonical trailing-slash form for website URLs 2026-06-24 17:20:30 +02:00
video Links: Use canonical trailing-slash form for website URLs 2026-06-24 17:20:30 +02:00
base64.go API: Disable gzip compression for /api/v1/dl endpoint #127 #1090 2025-04-11 14:13:25 +02:00
base64_test.go API: Disable gzip compression for /api/v1/dl endpoint #127 #1090 2025-04-11 14:13:25 +02:00
data_url.go Media: Harden Vision URL fetching against SSRF and DoS 2026-03-03 17:54:03 +01:00
data_url_test.go Media: Harden Vision URL fetching against SSRF and DoS 2026-03-03 17:54:03 +01:00
filename.go Live Photos: Only flag actual Live and Motion Photos as "Live" #5089 2025-07-06 11:07:25 +02:00
filename_test.go Test: Use PascalCase names for all Go subtests in /pkg 2025-10-02 15:03:47 +02:00
formats.go M2TS: Extract embedded metadata with ExifTool #4982 #4892 #5040 2025-06-11 19:22:20 +02:00
headers.go Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
live.go Live Photos: Reset duration and improve type checks when indexing #5089 2025-07-07 11:15:02 +02:00
media.go Links: Use canonical trailing-slash form for website URLs 2026-06-24 17:20:30 +02:00
new.go Download: Add Disabled, Originals, MediaRaw & MediaSidecar Flags #2234 2022-04-15 09:42:07 +02:00
new_test.go Download: Add Disabled, Originals, MediaRaw & MediaSidecar Flags #2234 2022-04-15 09:42:07 +02:00
orientation.go CI: Apply Go linter recommendations to remaining "pkg/..." code #5330 2025-11-22 16:14:43 +01:00
orientation_test.go HEIC: Reset Exif orientation for compatibility with libheif 1.18.1 #4439 2024-08-03 16:31:11 +02:00
preview.go CI: Apply Go linter recommendations to remaining "pkg/..." code #5330 2025-11-22 16:14:43 +01:00
preview_test.go Index: Add experimental EPS and SVG vector graphics support #1177 #2207 2023-02-11 20:18:04 +01:00
README.md Video: Document codec detection and chunk scans in package docs #5617 2026-06-01 18:44:21 +00:00
report.go Media: Replace sort.Slice with slices.Sort for natural ordering (#4981) 2025-06-23 15:38:55 +02:00
report_test.go Videos: Refactor codec, content and file type specifications #4770 2025-02-05 00:30:45 +01:00
source.go CI: Apply Go linter recommendations to remaining "pkg/..." code #5330 2025-11-22 16:14:43 +01:00
type.go Metadata: Improve search filter and media type documentation #5113 2025-07-17 11:55:20 +02:00
type_test.go Metadata: Improve search filter and media type documentation #5113 2025-07-17 11:55:20 +02:00
types.go Metadata: Improve search filter and media type documentation #5113 2025-07-17 11:55:20 +02:00

PhotoPrism — Media Package

Last Updated: June 1, 2026

Apple iPhone & iPad

iOS Live Photos consist of a JPEG/HEIC image and a QuickTime AVC/HEVC video, which are both required for viewing.

We recommend using an app like PhotoSync to upload Live Photos to PhotoPrism, since the iOS web upload usually only submits the HEIC image file without the video.

Android Devices

Some Samsung and Google Android devices support taking "Motion Photos" with the included Camera app. A Motion Photo is a JPEG/HEIC image with a short MP4 video embedded after the image data.

The image part of these files can be opened in any image viewer that supports JPEG/HEIC, but the video part cannot. However, since the MP4 video is simply appended at the end of the image file, it can be easily read by our software and streamed through the API as needed.

How PhotoPrism locates the embedded video offset and detects its codec is described in the video subpackage documentation.

Introductory Tutorials

Title Date URL
How to detect Android motion photos in Flutter May 2023 https://ente.io/blog/tech/android-motion-photos-flutter/
Stripping Embedded MP4s out of Android 12 Motion Photos Oct 2021 https://mjanja.ch/2021/10/stripping-embedded-mp4s-out-of-android-12-motion-photos/
Google Pixel "Motion Photo" Howto Mar 2021 https://linuxreviews.org/Google_Pixel_%22Motion_Photo%22
go-mp4: Golang Library and CLI Tool for MP4 Jul 2020 https://dev.to/sunfishshogi/go-mp4-golang-library-and-cli-tool-for-mp4-52o1
Working with Motion Photos Jan 2019 https://medium.com/android-news/working-with-motion-photos-da0aa49b50c
Google: Behind the Motion Photos Technology in Pixel 2 Mar 2018 https://blog.research.google/2018/03/behind-motion-photos-technology-in.html

Software Libraries & References

Title URL
Web Video Codec Guide https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Video_codecs
Media Container Formats https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Containers
MP4 Signature Format https://www.file-recovery.com/mp4-signature-format.htm
List of file signatures (Wikipedia) https://en.wikipedia.org/wiki/List_of_file_signatures
Go library for reading and writing MP4 files https://github.com/abema/go-mp4
Go library for buffered I/O with io.Seeker interface https://github.com/sunfish-shogi/bufseekio
How to use the io.Reader interface https://yourbasic.org/golang/io-reader-interface-explained/
AV1 Codec ISO Media File Format https://aomediacodec.github.io/av1-isobmff