immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
48.85k stars 2.56k forks source link

Video length is always incorrect #8244

Closed mio-19 closed 2 months ago

mio-19 commented 6 months ago

The bug

image It was displayed as 78 min. After putting the mouse hovering on the play button, the correct length is shown (2 min) image

The OS that Immich Server is running on

Arch

Version of Immich Server

1.99.0

Version of Immich Mobile App

N/A

Platform with the issue

Your docker-compose.yml content

https://github.com/immich-app/immich/releases/download/v1.99.0/docker-compose.yml

Your .env content

https://github.com/immich-app/immich/releases/download/v1.99.0/example.env

Reproduction steps

1. Upload videos
2. Many videos got incorrect length

Additional information

No response

Asmhoa commented 6 months ago

+1, seeing the same

nghduc97 commented 6 months ago

I tried to reproduce by using videos downloaded from Youtube and some short camera recording but it didn't happen :(

mio-19 commented 6 months ago

I checked my library and saw some videos with minutes length were listed as zero length Screenshot_20240419_175527

lamuyang commented 5 months ago

I try to reproduce it using Mac and safari, but it didn't happen.

mio-19 commented 5 months ago

What should I do to debug or fix on the immich instance that experienced this issue?

nghduc97 commented 5 months ago

What should I do to debug or fix on the immich instance that experienced this issue?

Use some exifdata viewer tool to check the Duration tag on the video if it matches the real duration.

On the server you run your Immich server:

sudo docker compose exec database psql -U postgres -c "SELECT id, \"fileModifiedAt\",
 duration FROM assets WHERE type='VIDEO'" immich

Check if the durations are correct. If they are, the problem should be on the client side, you can start looking around web/src/lib/components/assets/thumbnail/video-thumbnail.svelte file.

If they are not correct, you can look around server/src/services/metadata.service.ts.

mio-19 commented 4 months ago

maybe https://github.com/immich-app/immich/issues/4349

rohitsaini81 commented 4 months ago

Can i work on this

bo0tzz commented 2 months ago

@hixxey can you open the full size viewer for your asset (where the duration is displayed correctly in the player), then replace /photos/ in the URL with /api/assets/? For example https://demo.immich.app/photos/ffc1dc67-8faa-4ea0-9bf4-8c3378271d07 -> https://demo.immich.app/api/assets/ffc1dc67-8faa-4ea0-9bf4-8c3378271d07, and then post the output here.

Please redact sensitive info that ends up in there. I mostly care about what the duration is in the api response.

Hixxey commented 2 months ago

@Hixxey can you open the full size viewer for your asset (where the duration is displayed correctly in the player), then replace /photos/ in the URL with /api/assets/? For example https://demo.immich.app/photos/ffc1dc67-8faa-4ea0-9bf4-8c3378271d07 -> https://demo.immich.app/api/assets/ffc1dc67-8faa-4ea0-9bf4-8c3378271d07, and then post the output here.

Please redact sensitive info that ends up in there. I mostly care about what the duration is in the api response.

{"id":"02cb6c9b-abb7-4f7f-9b19-f648da601b2a","deviceAssetId":"22-03-03-14-501.MP4","ownerId":"e5ade690-06a3-4d2c-923d-d66661e5e21c","owner":{"id":"e5ade690-06a3-4d2c-923d-d66661e5e21c","email":"","name":"","profileImagePath":"upload/profile/e5ade690-06a3-4d2c-923d-d66661e5e21c/637c7ea0-2b06-4b33-9561-41d1eb952504.jpg","avatarColor":"gray"},"deviceId":"Library Import","libraryId":"52ea2355-5dda-4fe2-9c7b-53aaeba87539","type":"VIDEO","originalPath":"/photos/Videos/2022/03/03/22-03-03-14-50 1.MP4","originalFileName":"22-03-03-14-50 1.MP4","originalMimeType":"video/mp4","resized":true,"thumbhash":"GwgGBIAod6p5llqAbYQwhQmxiQ==","fileCreatedAt":"2022-03-03T14:50:05.000Z","fileModifiedAt":"2022-03-03T14:51:38.000Z","localDateTime":"2022-03-03T14:50:05.000Z","updatedAt":"2024-06-21T17:16:28.984Z","isFavorite":false,"isArchived":false,"isTrashed":false,"duration":"00:38:24.000","exifInfo":{"make":null,"model":null,"exifImageWidth":3840,"exifImageHeight":2160,"fileSizeInByte":701439388,"orientation":"1","dateTimeOriginal":"2022-03-03T14:50:05.000Z","modifyDate":"2022-03-03T14:50:05.000Z","timeZone":"UTC","lensModel":null,"fNumber":null,"focalLength":null,"iso":null,"exposureTime":null,"latitude":null,"longitude":null,"city":null,"state":null,"country":null,"description":"","projectionType":null},"smartInfo":{"tags":null,"objects":null},"livePhotoVideoId":null,"tags":[],"people":[],"unassignedFaces":[],"checksum":"FQlAI2t03zH6sv4IAAksbekBO0o=","stackCount":null,"isOffline":false,"hasMetadata":true,"duplicateId":null}

bo0tzz commented 2 months ago

If you rerun metadata extraction (top right menu in the viewer), does that change anything? Are you able to share one of the files that exhibit this behaviour in a .zip?

Hixxey commented 2 months ago

If you rerun metadata extraction (top right menu in the viewer), does that change anything? Are you able to share one of the files that exhibit this behaviour in a .zip?

It doesn't change anything unfortunately. They're all large files and home videos so I'd prefer to send a link via email if possible?

bo0tzz commented 2 months ago

That's fine, you'll find me at boet@immich.app.

Hixxey commented 2 months ago

That's fine, you'll find me at boet@immich.app.

I've sent a WeTransfer link, let me know if you have any troubles.