mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
Videos: Transcoding of old MJPEG files not working #574
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#574
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 @tootbrute on GitHub (Dec 13, 2020).
Originally assigned to: @lastzero on GitHub.
Many videos taken with my old Canon Powershot camera from ~2007ish do not play in Photoprism.
They seem to be using the MJPG codec. Photoprism does correctly identify them as movies.
I can download them to my computer and play them with VLC, so they aren't corrupt.
Information below from an example video that doesn't play from VLC using Media Information (CTRL+I).
Current Media Information
Metadata tab
Codec tab
Steam 1
Any suggestions how to make them play? Is this codec supported in Photoprism right now?
Any other information required, please let me know.
@lastzero commented on GitHub (Dec 13, 2020):
We use ffmpeg for transcoding - support for MJPEG might have been droppped:
Can you do a little bit of research on this for us?
@tootbrute commented on GitHub (Dec 13, 2020):
At the end of that thread, it seems they patched ffmpeg.
https://ffmpeg.org/pipermail/ffmpeg-devel/2019-October/251081.html
I just installed ffmpeg on my server, but since this is in docker, not sure that would help Photoprism out much.
According to ffmpeg documentation, it seems supported.
EDIT:
I see errors in the log. Is there a transcoding string I should try with ffmpeg to test it out? or a suggested format that is good for Photoprism to handle?
Error
December 14, 2020, 12:36:00 AM GMT+8
video: failed transcoding 2007/10/20071005_001348_45493FA2.avi
@lastzero commented on GitHub (Dec 14, 2020):
Doesn't seem to be a general MJPG issue, I can play them:
@lastzero commented on GitHub (Dec 14, 2020):
We use the version that comes with Ubuntu 20.04 - should be easy to test manually e.g. by running the command inside our Docker container or using a separate Ubuntu VM.
@tootbrute commented on GitHub (Dec 15, 2020):
Ok, great to hear it isn't an issue for all MJPGs.
What command should I run instead of docker? I'm not very good at this whole Docker thing.
It sounds like it might be easier for me to just transcode the movies (if I can do that without losing metadata) into a format that is more compatible with Photoprism, reimport them, and archive the garbage files.
I only have 74 MJPG movies that are giving me problems.
@lastzero commented on GitHub (Dec 15, 2020):
To get a bash terminal in our Docker container:
docker-compose exec photoprism bashThe command parameters can be found here:
https://github.com/photoprism/photoprism/blob/develop/internal/photoprism/convert.go#L299
ffmpeg -i FILE.MJPG -c:v libx264 -f mp4 FILE.AVCAnother reason the command may fail is that the target file already exists. You can avoid this by adding
-y. Should not be needed in practice as we check the existence twice.@tootbrute commented on GitHub (Dec 15, 2020):
Thank you for the information.
As a test, I transcoded one file, and re-imported into Photoprism.
2020-12-15 22:25:22 INFO media: 20201215_141508_EDF47235.avc.jpg was taken at 2020-12-15 14:25:11.522803889 +0000 UTC (file mod time)It seems to take the date for the movie from the file modification time. This means I'd have to manually modify the dates after importing. For now I'll leave it as is.
@lastzero commented on GitHub (Dec 15, 2020):
Interesting, do you have JSON sidecar files enabled? Dates for videos and raw should be taken from the main file (or their JSON sidecar files), not the JPEG preview. Might be a bug since we started creating JSON sidecar files for all media files, not just the main one.
@lastzero commented on GitHub (Dec 15, 2020):
My own library and demo.photoprism.org look good to me... dates are properly indexed for videos.
@tootbrute commented on GitHub (Dec 15, 2020):
In my docker-compose.yml file I have it set.
Also shows it is turned on using: docker-compose exec photoprism photoprism config
EDIT: The transcoded MJPG to MP4 (AVC1) still doesn't play when imported into Photoprism. So odd. I guess Canon Powershot has some weird encoding.
Not related (or maybe it is) is the mystery of about 200 of my photos having the wrong date.
Example:
Under the Files tab: Name: 2017/07/20170718_073055_7A78A8EE.jpg
Date added: Dec 14, 2020, 6:04 AM in 1,271 ms
but in the Details tab: says the date is 2020-12-13
@lastzero commented on GitHub (Dec 17, 2020):
There was a potential issue with the date we get from the file / folder name vs other sources such as metadata. A priority lookup table is used for this now, so the date issue might be fixed in our latest build.
@lastzero commented on GitHub (Dec 30, 2020):
Is this working now, or do we need to take action before officially announcing a release?
@tootbrute commented on GitHub (Jan 1, 2021):
Just seen this. Tricky to test this.
A. First I tried this...
B. Next thing I tried - re-imported a bad file, but it deleted the import file because it is the same as one already there.
C. Finally, I deleted a bad file, and then re-imported it again.
It messed up the date of the file (probably taking the creation date, from when I downloaded it from Photoprism), and still doesn't play. This is baffling. It must be related to the MJPEG codec by the Canon Powershot I used circa ~2007-2009.
@lastzero commented on GitHub (Jan 1, 2021):
Would you mind testing this again with our stable release (
docker pull photoprism/photoprism:latest), a fresh database and no sidecar files? You may use thephotoprism resetcommand for this, so that it's less work, and then manually delete the sidecar and cache folders as well to be sure absolutely nothing is left - or set up a second instance for testing.@tootbrute commented on GitHub (Jan 1, 2021):
Image looks up to date. I am using watchtower.
$ docker pull photoprism/photoprism:latest
latest: Pulling from photoprism/photoprism
Digest: sha256:37cb936cbbbefa903ba47e859a3b9533f3b07ee872d24d138d216a2ddf193691
Status: Image is up to date for photoprism/photoprism:latest
Ran "docker-compose exec photoprism photoprism reset" and deleted everything in the storage folder.
Running index again on whole library. ~50,000 files. This may take a while...
Waiting...will update you when that's done.
@tootbrute commented on GitHub (Jan 1, 2021):
Ok so it's not finished doing whole Index, but some MJPG files have been indexed. They still don't play.
Here is a small 3.5 MB sample MPJEG that doesn't play. Maybe easier to see what's happening if you import it at your end. It must be a very unique codec :(
Note: this isn't the file I was playing around with before.
@graciousgrey commented on GitHub (Jan 5, 2021):
For me this one can be played
@tootbrute commented on GitHub (Jan 5, 2021):
Odd. Well thank you for investigating this problem.
@graciousgrey commented on GitHub (Jan 5, 2021):
Is this the only file that is not working for you?
@tootbrute commented on GitHub (Jan 5, 2021):
I'm still indexing (had issues with docker IP conflict with new VPN, long story! but...
Now I'm trying even more of the videos I have and I see that the problem is not only all AVIs with MJPG codec.
I am finding a few MP4 files with MP4V codec that also don't play. For example, I have two videos from the same event, one works, and one doesn't. My friends video taken with her CanonShot G12 works, but the one I took with my camera doesn't.
My MOV files with AVC1 codec all seem to play.
After my collection indexes again, I am going to make a new photoprism installation to troubleshoot those files. Takes to long to keep reindexing to test things.
@graciousgrey commented on GitHub (Jan 8, 2021):
Do you still have trouble with some videos? Should we reopen this?
@tootbrute commented on GitHub (Jan 9, 2021):
I'm not sure what logs, or information I can give to you to debug this. Any ideas?
====
Test installation:
On Kubuntu, Macbook Pro 2010. Used 4 files: some MOV, JPEG codec, some AVI, MJPEG codec. Videos taken in 2006 and 2007.
sudo docker version
Client: Docker Engine - Community
Version: 20.10.2
API version: 1.41
Go version: go1.13.15
Git commit: 2291f61
Built: Mon Dec 28 16:17:43 2020
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.2
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 8891c58
Built: Mon Dec 28 16:15:19 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0
====================
Original installation:
Debian 10
docker version
Client: Docker Engine - Community
Version: 20.10.2
API version: 1.41
Go version: go1.13.15
Git commit: 2291f61
Built: Mon Dec 28 16:17:34 2020
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.2
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 8891c58
Built: Mon Dec 28 16:15:28 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0
@graciousgrey commented on GitHub (Jan 11, 2021):
As the videos you sent work on our machines it might be that your mac cannot transcode some videos.
Could you try the following:
ffmpeg -i test.avi -c:v libx264 -f mp4 transcodedTest--> Replacetest.aviwith the name of a file that is not working for you and transcodedTest with the name you want to have for the transcoded file@tootbrute commented on GitHub (Jan 13, 2021):
Info on my system:
Linux arkadi.one 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux
FFMPEG Version
@tootbrute commented on GitHub (Jan 13, 2021):
So....for some reason I decided to try things in Chromium...and it magically works!
So certain video files, looks like specifically MJPEG, won't play in Firefox. The performance of all of Photoprism works much better in Chromium, especially speed of opening videos.
Firefox 84.0.2 (64bit) Mozilla Firefox for Ubuntu does not work.
Chromium Version 87.0.4280.141 (Official Build) snap (64-bit) does work.
@lastzero commented on GitHub (Jan 13, 2021):
Trying a different browser is always a good idea 🤗
@graciousgrey commented on GitHub (Jan 13, 2021):
@tootbrute good to hear that it works in chromium. Thanks for letting us know! I will have a look at firefox and different video fomats later this week.
@tootbrute commented on GitHub (Jan 13, 2021):
Yes, at least I found a new obscure bug for you! :S
Note to self: check both browsers before submitting and Issue.
Sorry guys!