photoprism/pkg/video
Michael Mayer 3e924b70c7 API: Move handling of HTTP auth headers to pkg/header #808 #3943 #3959
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-09 10:58:47 +01:00
..
testdata Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
brands.go Live Photos: Add support for playing videos embedded in HEIC images #439 2023-09-23 11:27:20 +02:00
brands_test.go Live Photos: Add support for playing videos embedded in HEIC images #439 2023-09-23 11:27:20 +02:00
chunk.go Live Photos: Add support for playing videos embedded in HEIC images #439 2023-09-23 11:27:20 +02:00
chunks.go Live Photos: Add support for playing videos embedded in HEIC images #439 2023-09-23 11:27:20 +02:00
chunks_test.go Live Photos: Add support for playing videos embedded in HEIC images #439 2023-09-23 11:27:20 +02:00
codecs.go Map VP09 to codec vp9 (#3792) 2023-10-06 04:09:07 +02:00
codecs_test.go Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
content_type.go Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
content_type_test.go Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
info.go Live Photos: Default to MP4 for Google HVC1 Motion Photos Playback #3814 2023-10-12 15:20:54 +02:00
info_test.go Videos: Cache embedded media to allow streaming and transcoding #3764 2023-09-24 17:13:06 +02:00
live.go Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
probe.go Live Photos: Default to MP4 for Google HVC1 Motion Photos Playback #3814 2023-10-12 15:20:54 +02:00
probe_test.go Live Photos: Default to MP4 for Google HVC1 Motion Photos Playback #3814 2023-10-12 15:20:54 +02:00
reader.go Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
reader_test.go Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
README.md API: Move handling of HTTP auth headers to pkg/header #808 #3943 #3959 2024-01-09 10:58:47 +01:00
standards.go Videos: Stream OGV, VP8, VP9, AV1, WebM, and HEVC if supported #2461 2022-06-24 06:59:22 +02:00
type.go Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
types.go Index: Add native support for MP4 and Samsung/Google Motion Photos #439 2023-09-22 23:59:56 +02:00
types_test.go Download: Add Disabled, Originals, MediaRaw & MediaSidecar Flags #2234 2022-04-15 09:42:07 +02:00
video.go Docs: Update year in backend and frontend package file headers 2024-01-05 16:38:36 +01:00

Video File Support

Codecs and Containers

For maximum browser compatibility, PhotoPrism can transcode video codecs and containers supported by FFmpeg to MPEG-4 AVC.

Running the following command in a terminal displays a list of supported codecs:

ffmpeg -decoders

See our advanced setup guide to learn how to configure hardware video transcoding.

Please Note:

  1. Not all video and audio formats can be played with every browser. For example, AAC - the default audio codec for MPEG-4 AVC / H.264 - is supported natively in Chrome, Safari, and Edge, while it is only optionally supported by the OS in Firefox and Opera.
  2. HEVC/H.265 video files can have a .mp4 file extension too, which is often associated with AVC only. This is because MP4 is a container format, meaning that the actual video content may be compressed with H.264, H.265, or something else. The file extension doesn't really tell you anything other than that it's probably a video file.
  3. In case FFmpeg is disabled or not installed, videos cannot be indexed because still images cannot be created. You should also have Exiftool enabled to extract metadata such as duration, resolution, and codec.

Hybrid Photo/Video Formats

For more information on hybrid photo/video file formats, e.g. Apple Live Photos and Samsung/Google Motion Photos, see github.com/photoprism/photoprism/tree/develop/pkg/media and docs.photoprism.app/developer-guide/media/live.

Standard Resolutions

The PHOTOPRISM_FFMPEG_SIZE config option allows to limit the resolution of transcoded videos. It accepts the following standard sizes, while other values are automatically adjusted to the next supported size:

Size Usage
720 SD TV, Mobile
1280 HD TV, SXGA
1920 Full HD
2048 DCI 2K, Tablets
2560 Quad HD, Notebooks
3840 4K Ultra HD
4096 DCI 4K, Retina 4K
7680 8K Ultra HD 2

Technical References and Tutorials

Title URL
Web Video Codec Guide https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_codecs
Web Video Content-Type Headers https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter
Media Container Formats https://developer.mozilla.org/en-US/docs/Web/Media/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
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

PhotoPrism® is a registered trademark. By using the software and services we provide, you agree to our Terms of Service, Privacy Policy, and Code of Conduct. Docs are available under the CC BY-NC-SA 4.0 License; additional terms may apply.