Comments (14)
I have the same issue. (iphone 13, 1.92.1 server/client) But I use firefox on MacOS. Attached screenshots.
Files were uploaded via the CLI.
from immich.
@AngelPone how did you upload those LivePhotos, is it from the mobile app upload or from the CLI?
from immich.
@AngelPone how did you upload those LivePhotos, is it from the mobile app upload or from the CLI?
from the CLI @alextran1502
from immich.
@ndewijer @AngelPone Those LivePhotos are probably edited. Once LivePhotos is edited, it is saved under a different "link" ID, so we don't have any trace to link it back if you are uploading using the CLI, since the two files are uploaded individually.
Uploading from the mobile app, the payload contains both the motion and the still parts, so they will always linked correctly.
This is how Apple handles editing LivePhotos and I don't think there is anything we can do here
from immich.
@ndewijer @AngelPone Those LivePhotos are probably edited. Once LivePhotos is edited, it is saved under a different "link" ID, so we don't have any trace to link it back if you are uploading using the CLI, since the two files are uploaded individually.
Uploading from the mobile app, the payload contains both the motion and the still parts, so they will always linked correctly.
This is how Apple handles editing LivePhotos and I don't think there is anything we can do here
Hi @alextran1502 I fully hear what you’re saying, but why are they merged when viewed via the browser, though? That would imply to me they are linked.
I did just check the pictures on my iPhone, and they are not edited. As you say, when you edit them, the live photo gets removed.
from immich.
@ndewijer Ah your case might be different. Can you try logout and log back in?
from immich.
@ndewijer Ah your case might be different. Can you try logout and log back in?
Done, no effect. I can also do you one better. We see the same effect on my wife’s phone which is a Pixel 7a with Android 13 which is fully up to date.
from immich.
Same here. The pictures are original. Actually, none of the live photos correctly display on my phone.
I also tried to reinstall the app and didn't work.
from immich.
@AngelPone Do you mind share one set of example for troubleshooting?
from immich.
@alextran1502
The original photo: https://1drv.ms/f/s!AsbsRMJoB2Ryi9hrGZlZHBr4oIYSfg?e=7pdfay
The view on Chrome:
The View on iPhone:
from immich.
Hi, I have the same problem.
Initially, I thought that the photo and video are displayed separately, but I have noticed that I have a play button and I can play the video while looking at the photo.
However, the video from this photo is also shown separately. So it seems that the photo+video is displayed correctly, and the same video is displayed separately once more.
Of course I have this problem only in iOS app. In the browser it is ok. It doesn't matter if I upload it trough web browser or directly from iOS. There is same problem. I am using latest version of server and iOS. Running on Raspberry Pi 5.
Is there any solution how to fix this?
from immich.
After digging into this, I figured out the problem.
First note that this problem only happens for part of my previous photos. Recent photos don't have this problem.
In my immich, there are two sources that make this problem happen:
- the live photos are not identified as live photos (livePhotoVideoId is empty in the database)
- the live photo is identified as live photo, but the video part (.mov) was accidently added into an album when the image part was added into the album. (which I think should not?)
For example, if I add a live photo into an album and this problem happen, call the /album/:albumId api will return 2 items in the assets field of the response (which I think should be 1?).
Why it causes the bug view on Mobile?
Mobile code calls the album API to update album. For the second case, the api returns two items(original asset in image + video) for the same asset. But the mobile client does not check it, and upserts them into the database. This exactly causes the problem @cipisek9 and I have encountered. This also explains the two wierd things I encountered:
- When I first open the app, the live videos actually do not show up in the timeline. But after immich finishs querying the album in background, they show up in the time line.
- The item count for the album on the Web client is bigger than number of items actually showing up in the album view.
The only thing I can't understand is why Web client does not display these motion videos as they are using the same api.
Here is how I fix it
- For the first case, I update the liveVideoPhotoId field of the image asset of the live photos by directly updating the database.
- For the second case, I first filtered out all the VIDEO part of live photos and check it if added into the albums_assets_assets. Then I call the removeAssetFromAlbum api to remove these live VIDEOs from the album.
from immich.
@AngelPone Mind sharing what queries you ran against postgres and against the API? I'm not afraid to get my hands dirty but I'd prefer not to reinvent the wheel
from immich.
Here is the python code I wrote, ugly but work for me.
Use it in caution! @ndewijer
import requests
import pandas as pd
import numpy as np
from sqlalchemy import create_engine
from sqlalchemy.sql import text
ownerId = "your-id"
api_endpoint = "http://immich_api:port/api"
api_key = 'your api key'
# Create an engine instance
engine = create_engine(f'postgresql://immich:immich@databaseip/immich')
def get_album_id(album_name):
return str(pd.read_sql(f"""
select * from albums where "albumName" = '{album_name}' and "ownerId" = '{ownerId}'
""",engine)["id"][0])
def remove_redundent_motion_video(album_name):
album_id = get_album_id(album_name)
album_assets = pd.read_sql(f"""
select * from albums_assets_assets where "albumsId" = '{album_id}'
""", engine)
print(f"{album_assets.shape[0]} items in Album")
allAssets = pd.read_sql(f"""
select * from assets where "ownerId" = '{ownerId}'
""", engine)
allAssets.rename(columns={"id": "assetsId"}, inplace=True)
merged = pd.merge(album_assets, allAssets, how="left", on="assetsId")
merged = merged.loc[merged["deletedAt"].isna(),]
print(f"{merged.shape[0]} is not deleted")
print(f"{merged['type'].isna().sum()} assets missing in assets table")
print("updating Live Photos without livePhotoVideoID")
count = 0
for i in merged["originalFileName"].unique():
if i is np.nan:
continue
if sum(merged["originalFileName"] == i) == 1:
continue
else:
assert sum(merged["originalFileName"] == i) == 2
currentAsset = allAssets.loc[allAssets["originalFileName"] == i,]
try:
imageId = currentAsset.loc[currentAsset["type"] == "IMAGE",]["assetsId"].tolist()[0]
videoId = currentAsset.loc[currentAsset["type"] == "VIDEO",]["assetsId"].tolist()[0]
livePhotoId = currentAsset.loc[currentAsset["type"] == "IMAGE",]["livePhotoVideoId"].tolist()[0]
if livePhotoId is None:
count += 1
SQL3 = text(f"""
UPDATE assets
SET "livePhotoVideoId" = '{videoId}'
where "id" = '{imageId}'
""")
with engine.connect() as connection:
result = connection.execute(SQL3)
connection.commit()
except:
continue
print(f"updating {count} assets")
merged_motion = merged.loc[~merged["livePhotoVideoId"].isna(),]["livePhotoVideoId"].tolist()
merged_motion = [str(i) for i in merged_motion]
print(f"{len(merged_motion)} live photos")
allIds = [str(i) for i in merged["assetsId"]]
merged_motion_in_album = list(filter(lambda x: x in allIds, merged_motion))
print(f"{len(merged_motion_in_album)} videos of live photo in the album")
print(f"There should be {merged.shape[0] - len(merged_motion_in_album) - merged['type'].isna().sum()} items in the album. Check it in your web")
print("removing Live VIDEOS from the album")
requests.delete(f"{api_endpoint}/album/{album_id}/assets", json={ "ids": merged_motion_in_album}, headers = {
"Content-Type": "application/json",
'x-api-key': api_key
})
if __name__ == "__main__":
remove_redundent_motion_video("album name")
from immich.
Related Issues (20)
- Map not showing in image details in album shared via link HOT 3
- Video on android not working HOT 11
- bug(mobile): asset description is not shown HOT 3
- Pictures don't get added to albums, when uploading through cli HOT 4
- Pictures recently added to external library cannot be dowloaded form the app HOT 20
- Opening panorama image as shared link displays "Failed to load asset" (asset actually loads)
- I cannot turn off automatic deduplication, and I am unable to upload all images. HOT 2
- OAuth immich_quota claim does not updates user quota on login HOT 1
- docker-compose .yml whether it is a mistake to
- Immich cli import error HOT 6
- Cannot clear immich data
- Machine Learning CUDA error cudaErrorNoKernelImageForDevice
- Android Monochrome Icon Broken HOT 6
- [Help Updating] - Unknown error HOT 1
- DELETE requests on the API doesn't work HOT 2
- Live Photo Viewer Resizes Video in Web UI and has Static Sections on Each Side on iPhone App HOT 2
- Slideshow does not pause when video is played HOT 1
- Mobile app - preload issue in gallery view
- Update to 1.99.0 appears to have a theme issue with alignment
- iOS App keeps crashing - local backup to server HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immich.