mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
Videos: Option to automatically transcode videos upfront #920
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#920
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jkgeyti on GitHub (May 3, 2021).
Originally assigned to: @lastzero on GitHub.
Problem: mp4 videos are never transcoded, but lots of MP4 containers use unsupported audio codecs, or are too big to comfortably stream through a browser. Video transcoding is an contentious subject, in particular when it comes to caching [ https://github.com/photoprism/photoprism/issues/1070 ] , and it's not clear what the most appropriate strategy for determining when to convert and store a transcoded video is.
A simpler (intermediate?) approach, could be to introduce a config flag to enable always transcoding videos when requested through the API.
From a UX perspective, this doesn't really change anything. Unlike cached JPEGs that enable fast navigation through libraries, videos are inherently slow to absorb, and photoprism already focuses on a simple flow, where we always serve the full video after clicking a thumbnail. As such, it should make no difference to the end user whether a cached or transcoded video stream is delivered.
The only downside, is when transcoding happens at a lower than 1.0x rate, and hence cause permanent stuttering of videos, whereas caching would only cause a video to stutter the first time it's played back.
If this could be enabled, I'd be happy to extent the documentation with instructions on how to enable hardware-encoding on Intel CPUs (with integrated GPUs).
@lastzero commented on GitHub (May 4, 2021):
Makes sense. There are many other ideas waiting to be implemented, so we can't do it right now. Once funding improves, we can grow our team and deliver feature requests like this faster.
@lastzero commented on GitHub (May 23, 2021):
Our recently published example config shows how to run a background job for this:
https://dl.photoprism.org/docker/scheduler/
This job in
jobs.iniwill runphotoprism convertonce a day to make sure files are transcoded / converted as needed (change this to run the job more often, depending on your requirements):Does this work for you? I'd rather not convert videos while scanning for new / changed files as this may have a huge performance impact.
@wormvortex commented on GitHub (Jul 6, 2021):
where would you put the jobs.ini file and what do you need to do to get it to run?
@lastzero commented on GitHub (Jul 6, 2021):
See example:
https://dl.photoprism.org/docker/scheduler/
@wormvortex commented on GitHub (Jul 6, 2021):
I'm still not understanding exactly what to do with that jobs.ini file listed?
@lastzero commented on GitHub (Jul 6, 2021):
Put it next to the docker-compose.yml file, same directory.
@maximecurioni commented on GitHub (Sep 19, 2021):
I wanted to second @jkgeyti's idea. Having a global flag to always transcode videos would be really useful, especially when one has hardware transcoding working.
My camera uses the following codecs:
h264 (High) (avc1 / 0x31637661)pcm_s16le (sowt / 0x74776F73)Because these videos are sent in passthrough fashion by Photoprism and Firefox/Chrome don't support the audio codec, I have to manually copy the video link and reopen the file in Safari or VLC to hear the audio. This somewhat hinders my Photoprism experience.
I understand that using
photoprism convertis an option for some. I personally do not want to overwrite any of my originals.@lastzero commented on GitHub (Sep 19, 2021):
photoprism convert won't overwrite your originals. PCM is in fact not a supported audio codec for MP4 (at best MOV may be a valid container as it existed before MP4 was standardized). While we can implement a workaround for that, there are lots of existing tools to fix non standard files and convert them to proper MP4. We'll eventually come up with a complete video solution and maybe even live transcoding with variable bitrate depending on your connection speed and hardware - but most likely not this year. Our next goals are facial recognition and batch edit.
@maximecurioni commented on GitHub (Sep 19, 2021):
Thanks for the quick answer, @lastzero!
Indeed, I should have clarified, my camera uses MOV as the container format for videos.
I appreciate the clarification on
photoprism convert. I didn't read the documentation closely enough to understand that sidecar files would be created.I totally understand your prioritization for the year. Thanks again for the team's amazing work.
@graciousgrey commented on GitHub (Nov 2, 2021):
Marked as low-priority as the scheduler can be used for this