Videos: Transcoding of old MJPEG files not working #574

Closed
opened 2026-02-19 23:11:29 -05:00 by deekerman · 28 comments
Owner

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

  • Software: CanonMVI06
    Codec tab
  • Stream 0
  • Codec: Motion JPEG Video (MJPG)
  • Type: Video
  • Video resolution: 640x480
  • Buffer dimensions: 640x480
  • Frame rate: 30.000300
  • Decoded format: Planar 4:2:2: YUV full scale
  • Orientation: Top left
  • Color space: ITU-R BT.601 Range
  • Chroma location: Center
    Steam 1
  • Codec: araw
  • Type: Audio
  • Channels: Mono
  • Sample rate: 44100 Hz
  • Bits per sample: 16

Any suggestions how to make them play? Is this codec supported in Photoprism right now?

Any other information required, please let me know.

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 - Software: CanonMVI06 Codec tab - Stream 0 - Codec: Motion JPEG Video (MJPG) - Type: Video - Video resolution: 640x480 - Buffer dimensions: 640x480 - Frame rate: 30.000300 - Decoded format: Planar 4:2:2: YUV full scale - Orientation: Top left - Color space: ITU-R BT.601 Range - Chroma location: Center Steam 1 - Codec: araw - Type: Audio - Channels: Mono - Sample rate: 44100 Hz - Bits per sample: 16 Any suggestions how to make them play? Is this codec supported in Photoprism right now? Any other information required, please let me know.
deekerman 2026-02-19 23:11:29 -05:00
Author
Owner

@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?

@lastzero commented on GitHub (Dec 13, 2020): We use [ffmpeg](https://ffmpeg.org/) for transcoding - support for MJPEG might have been droppped: * [Can no longer read mjpeg from Mobotix camera](https://trac.ffmpeg.org/ticket/5023?cversion=1&cnum_hist=15) Can you do a little bit of research on this for us?
Author
Owner

@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

@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](https://ffmpeg.org/ffmpeg-formats.html#mpjpeg). **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
Author
Owner

@lastzero commented on GitHub (Dec 14, 2020):

Doesn't seem to be a general MJPG issue, I can play them:

Screenshot 2020-12-14 at 23 50 53
@lastzero commented on GitHub (Dec 14, 2020): Doesn't seem to be a general MJPG issue, I can play them: <img width="655" alt="Screenshot 2020-12-14 at 23 50 53" src="https://user-images.githubusercontent.com/301686/102145381-63b08b00-3e67-11eb-9612-7eddc2a08bf0.png">
Author
Owner

@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.

@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.
Author
Owner

@tootbrute commented on GitHub (Dec 15, 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.

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.

@tootbrute commented on GitHub (Dec 15, 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. 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.
Author
Owner

@lastzero commented on GitHub (Dec 15, 2020):

To get a bash terminal in our Docker container:

docker-compose exec photoprism bash

The 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.AVC

Another 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.

@lastzero commented on GitHub (Dec 15, 2020): To get a bash terminal in our Docker container: `docker-compose exec photoprism bash` The 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.AVC` Another 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.
Author
Owner

@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.

@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.
Author
Owner

@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): 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.
Author
Owner

@lastzero commented on GitHub (Dec 15, 2020):

My own library and demo.photoprism.org look good to me... dates are properly indexed for videos.

@lastzero commented on GitHub (Dec 15, 2020): My own library and demo.photoprism.org look good to me... dates are properly indexed for videos.
Author
Owner

@tootbrute 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.

In my docker-compose.yml file I have it set.

  PHOTOPRISM_SIDECAR_JSON: "true" 

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

@tootbrute 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. In my docker-compose.yml file I have it set. PHOTOPRISM_SIDECAR_JSON: "true" 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
Author
Owner

@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 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.
Author
Owner

@lastzero commented on GitHub (Dec 30, 2020):

Is this working now, or do we need to take action before officially announcing a release?

@lastzero commented on GitHub (Dec 30, 2020): Is this working now, or do we need to take action before officially announcing a release?
Author
Owner

@tootbrute commented on GitHub (Jan 1, 2021):

Just seen this. Tricky to test this.

A. First I tried this...

  1. Moved some of the 'bad' files out of Review
  2. Re indexed the files of that month
  3. Files not there. They are still hidden.

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.

2021-01-01 10:08:22 INFO Import completed in 16 s
2021-01-01 10:08:16 INFO import: added related jpg file /photoprism/storage/sidecar/2020/12/20201213_142803_8B764724.avi.jpg
2021-01-01 10:08:09 INFO import: added main avi file 2020/12/20201213_142803_8B764724.avi
2021-01-01 10:08:06 INFO media: 11 thumbnails created for 20201213_142803_8B764724 [344.404399ms]
2021-01-01 10:08:06 INFO import: moving main avi file 20090414-190802-Unknown-2009-j35.avi to 2020/12/20201213_142803_8B764724.avi
2021-01-01 10:08:06 INFO media: 20090414-190802-Unknown-2009-j35.avi was taken at 2020-12-13 14:28:03 +0000 UTC (file mod time)
2021-01-01 10:08:05 INFO import: no .ppignore file found
2021-01-01 10:08:05 INFO Moving files from import

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.

@tootbrute commented on GitHub (Jan 1, 2021): Just seen this. Tricky to test this. A. First I tried this... 1. Moved some of the 'bad' files out of Review 2. Re indexed the files of that month 3. Files not there. They are still hidden. 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. ``` 2021-01-01 10:08:22 INFO Import completed in 16 s 2021-01-01 10:08:16 INFO import: added related jpg file /photoprism/storage/sidecar/2020/12/20201213_142803_8B764724.avi.jpg 2021-01-01 10:08:09 INFO import: added main avi file 2020/12/20201213_142803_8B764724.avi 2021-01-01 10:08:06 INFO media: 11 thumbnails created for 20201213_142803_8B764724 [344.404399ms] 2021-01-01 10:08:06 INFO import: moving main avi file 20090414-190802-Unknown-2009-j35.avi to 2020/12/20201213_142803_8B764724.avi 2021-01-01 10:08:06 INFO media: 20090414-190802-Unknown-2009-j35.avi was taken at 2020-12-13 14:28:03 +0000 UTC (file mod time) 2021-01-01 10:08:05 INFO import: no .ppignore file found 2021-01-01 10:08:05 INFO Moving files from import ``` 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.
Author
Owner

@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 the photoprism reset command 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.

@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 the `photoprism reset` command 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.
Author
Owner

@tootbrute 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 the photoprism reset command 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.

  1. 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

  2. Ran "docker-compose exec photoprism photoprism reset" and deleted everything in the storage folder.

  3. Running index again on whole library. ~50,000 files. This may take a while...

  4. Waiting...will update you when that's done.

@tootbrute 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 the `photoprism reset` command 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. 1. 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 2. Ran "docker-compose exec photoprism photoprism reset" and deleted everything in the storage folder. 3. Running index again on whole library. ~50,000 files. This may take a while... 4. Waiting...will update you when that's done.
Author
Owner

@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.

@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](https://drive.google.com/file/d/1K6qoW_7A4koQRq_Ne4wr92Q2dNRhq4JB/view). 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.
Author
Owner

@graciousgrey commented on GitHub (Jan 5, 2021):

For me this one can be played

@graciousgrey commented on GitHub (Jan 5, 2021): For me this one can be played
Author
Owner

@tootbrute commented on GitHub (Jan 5, 2021):

Odd. Well thank you for investigating this problem.

@tootbrute commented on GitHub (Jan 5, 2021): Odd. Well thank you for investigating this problem.
Author
Owner

@graciousgrey commented on GitHub (Jan 5, 2021):

Is this the only file that is not working for you?

@graciousgrey commented on GitHub (Jan 5, 2021): Is this the only file that is not working for you?
Author
Owner

@tootbrute commented on GitHub (Jan 5, 2021):

Is this the only file that is not working for you?
No there were ~70 files that can be indexed and recognized as videos, but don't play when I click on them - AVI files with MJPG codec.

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.

@tootbrute commented on GitHub (Jan 5, 2021): > Is this the only file that is not working for you? No there were ~70 files that can be indexed and recognized as videos, but don't play when I click on them - AVI files with MJPG codec. 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.
Author
Owner

@graciousgrey commented on GitHub (Jan 8, 2021):

Do you still have trouble with some videos? Should we reopen this?

@graciousgrey commented on GitHub (Jan 8, 2021): Do you still have trouble with some videos? Should we reopen this?
Author
Owner

@tootbrute commented on GitHub (Jan 9, 2021):

Do you still have trouble with some videos? Should we reopen this?
Yes I do. I made a new Photoprism docker installation on another computer, imported 2 different representative types of movies that don't work. These ones don't still don' work in this new Photoprism installation.

Should we repopen this?
I don't know. You tried one of my files on your systems and it works so it seems I'm the only person using Photoprism that is having this problem? How can that be?

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

@tootbrute commented on GitHub (Jan 9, 2021): > Do you still have trouble with some videos? Should we reopen this? Yes I do. I made a new Photoprism docker installation on another computer, imported 2 different representative types of movies that don't work. These ones don't still don' work in this new Photoprism installation. >Should we repopen this? I don't know. You tried one of my files on your systems and it works so it seems I'm the only person using Photoprism that is having this problem? How can that be? 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
Author
Owner

@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:

  1. Open the terminal
  2. Go to the directory a not working video is located in
  3. Run ffmpeg -i test.avi -c:v libx264 -f mp4 transcodedTest --> Replace test.avi with the name of a file that is not working for you and transcodedTest with the name you want to have for the transcoded file
  4. Let us know if that works and in case it does not what error is shown
@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: 1. Open the terminal 2. Go to the directory a not working video is located in 2. Run `ffmpeg -i test.avi -c:v libx264 -f mp4 transcodedTest` --> Replace `test.avi` with the name of a file that is not working for you and transcodedTest with the name you want to have for the transcoded file 3. Let us know if that works and in case it does not what error is shown
Author
Owner

@tootbrute commented on GitHub (Jan 13, 2021):

3\. ffmpeg -i test.avi -c:v libx264 -f mp4 transcodedTest
  1. Did that command on this file: https://drive.google.com/file/d/1K6qoW_7A4koQRq_Ne4wr92Q2dNRhq4JB/view
sudo ffmpeg -i 20060403_012408_18C9C7A5.avi -c:v libx264 -f mp4 20060403_012408_transcodetest.avi
ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from '20060403_012408_18C9C7A5.avi':
  Metadata:
    creation_time   : 2006-04-02 15:04:04
    encoder         : CanonMVI01
  Duration: 00:00:06.20, start: 0.000000, bitrate: 5057 kb/s
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 5045 kb/s, 10 fps, 10 tbr, 10 tbn, 10 tbc
    Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 11024 Hz, mono, u8, 88 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_u8 (native) -> aac (native))
Press [q] to stop, [?] for help
[aac @ 0x556a684d9fc0] Too many bits 6408.707483 > 6144 per frame requested, clamping to max
[libx264 @ 0x556a684db580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x556a684db580] profile High 4:2:2, level 2.2, 4:2:2 8-bit
[libx264 @ 0x556a684db580] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '20060403_012408_transcodetest.avi':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj422p(pc), 640x480, q=-1--1, 10 fps, 10240 tbn, 10 tbc
    Metadata:
      encoder         : Lavc58.35.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 11025 Hz, mono, fltp, 66 kb/s
    Metadata:
      encoder         : Lavc58.35.100 aac
frame=   62 fps= 18 q=-1.0 Lsize=     901kB time=00:00:06.22 bitrate=1185.7kbits/s speed=1.76x    
video:855kB audio:42kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.329059%
[libx264 @ 0x556a684db580] frame I:1     Avg QP:20.67  size: 34720
[libx264 @ 0x556a684db580] frame P:16    Avg QP:21.94  size: 26213
[libx264 @ 0x556a684db580] frame B:45    Avg QP:24.25  size:  9356
[libx264 @ 0x556a684db580] consecutive B-frames:  3.2%  0.0%  0.0% 96.8%
[libx264 @ 0x556a684db580] mb I  I16..4:  1.3% 96.8%  1.8%
[libx264 @ 0x556a684db580] mb P  I16..4:  0.4% 25.9%  0.9%  P16..4: 30.6% 25.3% 15.4%  0.0%  0.0%    skip: 1.5%
[libx264 @ 0x556a684db580] mb B  I16..4:  0.1%  7.2%  0.1%  B16..8: 41.3% 13.4%  3.7%  direct:10.3%  skip:23.9%  L0:35.7% L1:35.2% BI:29.1%
[libx264 @ 0x556a684db580] 8x8 transform intra:96.4% inter:64.9%
[libx264 @ 0x556a684db580] coded y,uvDC,uvAC intra: 91.4% 91.7% 32.2% inter: 36.6% 55.4% 6.6%
[libx264 @ 0x556a684db580] i16 v,h,dc,p: 18% 19% 12% 51%
[libx264 @ 0x556a684db580] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 16% 57%  2%  2%  2%  4%  3%  4%
[libx264 @ 0x556a684db580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 20% 16%  3%  6%  6%  8%  4%  5%
[libx264 @ 0x556a684db580] i8c dc,h,v,p: 53% 18% 25%  4%
[libx264 @ 0x556a684db580] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x556a684db580] ref P L0: 46.3% 13.4% 29.2% 11.1%
[libx264 @ 0x556a684db580] ref B L0: 81.7% 15.4%  3.0%
[libx264 @ 0x556a684db580] ref B L1: 93.6%  6.4%
[libx264 @ 0x556a684db580] kb/s:1129.23
[aac @ 0x556a684d9fc0] Qavg: 18097.295
  1. Reindexed that directory
2021-01-13 19:23:57 INFO Indexing completed in 36 s
2021-01-13 19:23:49 INFO purge: searching index for hidden media files
2021-01-13 19:23:48 INFO index: added related jpg file 20060403_012408_transcodetest.avi.jpg
2021-01-13 19:23:47 INFO media: 20060403_012408_transcodetest.avi.jpg was taken at 2021-01-13 11:23:38.106424732 +0000 UTC (file mod time)
2021-01-13 19:23:40 INFO index: added main avi file 2006/04/20060403_012408_transcodetest.avi
2021-01-13 19:23:39 INFO media: 11 thumbnails created for 20060403_012408_transcodetest [1.026790956s]
  1. Video doesn't play

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

_ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 22.100 / 56. 22.100
libavcodec     58. 35.100 / 58. 35.100
libavformat    58. 20.100 / 58. 20.100
libavdevice    58.  5.100 / 58.  5.100
libavfilter     7. 40.101 /  7. 40.101
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  3.100 /  5.  3.100
libswresample   3.  3.100 /  3.  3.100
libpostproc    55.  3.100 / 55.  3.100_
@tootbrute commented on GitHub (Jan 13, 2021): > 3\. ffmpeg -i test.avi -c:v libx264 -f mp4 transcodedTest 1. Did that command on this file: https://drive.google.com/file/d/1K6qoW_7A4koQRq_Ne4wr92Q2dNRhq4JB/view ``` sudo ffmpeg -i 20060403_012408_18C9C7A5.avi -c:v libx264 -f mp4 20060403_012408_transcodetest.avi ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Guessed Channel Layout for Input Stream #0.1 : mono Input #0, avi, from '20060403_012408_18C9C7A5.avi': Metadata: creation_time : 2006-04-02 15:04:04 encoder : CanonMVI01 Duration: 00:00:06.20, start: 0.000000, bitrate: 5057 kb/s Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 5045 kb/s, 10 fps, 10 tbr, 10 tbn, 10 tbc Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 11024 Hz, mono, u8, 88 kb/s Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (pcm_u8 (native) -> aac (native)) Press [q] to stop, [?] for help [aac @ 0x556a684d9fc0] Too many bits 6408.707483 > 6144 per frame requested, clamping to max [libx264 @ 0x556a684db580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [libx264 @ 0x556a684db580] profile High 4:2:2, level 2.2, 4:2:2 8-bit [libx264 @ 0x556a684db580] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to '20060403_012408_transcodetest.avi': Metadata: encoder : Lavf58.20.100 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj422p(pc), 640x480, q=-1--1, 10 fps, 10240 tbn, 10 tbc Metadata: encoder : Lavc58.35.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1 Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 11025 Hz, mono, fltp, 66 kb/s Metadata: encoder : Lavc58.35.100 aac frame= 62 fps= 18 q=-1.0 Lsize= 901kB time=00:00:06.22 bitrate=1185.7kbits/s speed=1.76x video:855kB audio:42kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.329059% [libx264 @ 0x556a684db580] frame I:1 Avg QP:20.67 size: 34720 [libx264 @ 0x556a684db580] frame P:16 Avg QP:21.94 size: 26213 [libx264 @ 0x556a684db580] frame B:45 Avg QP:24.25 size: 9356 [libx264 @ 0x556a684db580] consecutive B-frames: 3.2% 0.0% 0.0% 96.8% [libx264 @ 0x556a684db580] mb I I16..4: 1.3% 96.8% 1.8% [libx264 @ 0x556a684db580] mb P I16..4: 0.4% 25.9% 0.9% P16..4: 30.6% 25.3% 15.4% 0.0% 0.0% skip: 1.5% [libx264 @ 0x556a684db580] mb B I16..4: 0.1% 7.2% 0.1% B16..8: 41.3% 13.4% 3.7% direct:10.3% skip:23.9% L0:35.7% L1:35.2% BI:29.1% [libx264 @ 0x556a684db580] 8x8 transform intra:96.4% inter:64.9% [libx264 @ 0x556a684db580] coded y,uvDC,uvAC intra: 91.4% 91.7% 32.2% inter: 36.6% 55.4% 6.6% [libx264 @ 0x556a684db580] i16 v,h,dc,p: 18% 19% 12% 51% [libx264 @ 0x556a684db580] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 16% 57% 2% 2% 2% 4% 3% 4% [libx264 @ 0x556a684db580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 20% 16% 3% 6% 6% 8% 4% 5% [libx264 @ 0x556a684db580] i8c dc,h,v,p: 53% 18% 25% 4% [libx264 @ 0x556a684db580] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 @ 0x556a684db580] ref P L0: 46.3% 13.4% 29.2% 11.1% [libx264 @ 0x556a684db580] ref B L0: 81.7% 15.4% 3.0% [libx264 @ 0x556a684db580] ref B L1: 93.6% 6.4% [libx264 @ 0x556a684db580] kb/s:1129.23 [aac @ 0x556a684d9fc0] Qavg: 18097.295 ``` 2. Reindexed that directory ``` 2021-01-13 19:23:57 INFO Indexing completed in 36 s 2021-01-13 19:23:49 INFO purge: searching index for hidden media files 2021-01-13 19:23:48 INFO index: added related jpg file 20060403_012408_transcodetest.avi.jpg 2021-01-13 19:23:47 INFO media: 20060403_012408_transcodetest.avi.jpg was taken at 2021-01-13 11:23:38.106424732 +0000 UTC (file mod time) 2021-01-13 19:23:40 INFO index: added main avi file 2006/04/20060403_012408_transcodetest.avi 2021-01-13 19:23:39 INFO media: 11 thumbnails created for 20060403_012408_transcodetest [1.026790956s] ``` 3. Video doesn't play **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 ```ffmpeg -version _ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100_ ```
Author
Owner

@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.

Screenshot_20210113_202157

@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.** ![Screenshot_20210113_202157](https://user-images.githubusercontent.com/47593393/104451864-1a299c00-55dd-11eb-99a3-b3914ff31f2a.png)
Author
Owner

@lastzero commented on GitHub (Jan 13, 2021):

Trying a different browser is always a good idea 🤗

@lastzero commented on GitHub (Jan 13, 2021): Trying a different browser is always a good idea 🤗
Author
Owner

@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.

@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.
Author
Owner

@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!

@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!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#574
No description provided.