Inconsistent treatment of Live Photos

Hello - I’ve imported some of my Google photos library with Immich-Go. My library has a great deal of iOS Live Photos and I’ve noticed that in most cases the video and image files get paired up and presented correctly in Immich but in other cases they do not. Firstly - is there a way to run a job to look for identical file names & timestamps and match up the Live Photos automatically? I see the web app allows for this to be done manually but that would take me ages and ages. Secondarily - I see in some cases the time zone of the video file does not match the time zone of the video file which I suspect throws off the matching process. Is there any easy way to correct this?
57 Replies
Immich
Immich2mo ago
:wave: Hey @Special Extended Edition, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
bo0tzz
bo0tzz2mo ago
The matching is done purely on a shared id in the exif data I think immich-go might also have its own matching process but not sure
Special Extended Edition
That’s interesting… so the photos that aren’t matching are somehow missing this shared ID?
bo0tzz
bo0tzz2mo ago
Probably
Daniel
Daniel2mo ago
This is a google takeout, right?
Special Extended Edition
Correct
Daniel
Daniel2mo ago
In which case all files probably don't have that flag, so Immich cannot do anything and immich-go has to figure it out alone based on the json metadata files Sooo, it's probably something to ask in #immich-go - ideally with an example that doesn't work
Special Extended Edition
I checked in to that channel but the dev indicated that it's probably an immich thing and not an immich-go thing. Example attached if helpful. These should be linked but in my immich timeline show as separate.
Special Extended Edition
bump - anyone have any tips on joining unlinked live photos? I've got thousands to go through but I feel like there's got to be a way to automate linking them up - they all have the same name and creation time, etc. manually scrolling the timeline and clicking "link motion video" will take an eternity :/
Mraedis
Mraedis2mo ago
Could've sworn I read about some script to do this recently here somewhere https://github.com/JacobBumgarner/immich-live-photo-linker @Jacob had a similar issue and made this script
Jacob
Jacob2mo ago
@Special Extended Edition let me know if you have any trouble with this script. Per the instructions…. Make sure you have a backup! Several people have used it successfully, but it’s still worth the precaution to make a backup just in case.
Special Extended Edition
Oh nice! I will check this out thank you so much for posting I actually did some investigation into the root cause of these files being unlinked and I think I’ve narrowed down the reasons: * every unlinked photo is not one that I’ve personally taken but rather one that was added into a shared Google album by someone else * as far as I can tell, this only occurs when the account doing the sharing has “share photo location” unchecked in the album settings. There must be something that Google does to the exif data when that box is unchecked that destroys the field that Immich uses to link Live Photos
Daniel
Daniel2mo ago
Oh that actually makes a lot of sense. The live content/video id is part of the exif metadata, so presumably GPhotos just overlooked that and strips all metadata, including that id
Special Extended Edition
I had my wife scroll through like 127 albums and check the "share location" box on each one... lol wondering if re-doing the takeout is a quicker path than figuring out how to run the script I am getting an error when I run it... probably doing something dumb. File "/home/username/Downloads/immich-live-photo-linker/utils.py", line 158, in load_config raise KeyError(f"Missing required API configuration keys: {', '.join(missing)}") KeyError: 'Missing required API configuration keys: api_key' I have input a valid API key into config.yaml in the same directory...
Mraedis
Mraedis2mo ago
Did you pay attention to the amount of spaces @Special Extended Edition ? YAML is sensitive to that
Special Extended Edition
I think so? 1 space after the colon api: # You can generate an Immich API key by following the documentation link: # https://immich.app/docs/features/command-line-interface#obtain-the-api-key api-key: "blabla" url: "http://192.168.88.15:8276"
Mraedis
Mraedis2mo ago
You could try to explicitely link the config file with the --config /path/to/config.yaml flag
Special Extended Edition
same error. weird. python link_livephoto_videos.py --dry-run --config ~/Downloads/immich-live-photo-linker/config.yaml Traceback (most recent call last): File "/home/user/Downloads/immich-live-photo-linker/link_livephoto_videos.py", line 360, in <module> config = load_config(args.config) File "/home/user/Downloads/immich-live-photo-linker/utils.py", line 158, in load_config raise KeyError(f"Missing required API configuration keys: {', '.join(missing)}") KeyError: 'Missing required API configuration keys: api_key'
Mraedis
Mraedis2mo ago
ah, blind old me it says missing api_key and the sample has api-key so just change the config to api_key
Special Extended Edition
lol I knew it was going to be something dumb still no dice... but it's at least a different kind of error now
Mraedis
Mraedis2mo ago
uhhh something something datetime conversion
Special Extended Edition
¯\_(ツ)_/¯
Mraedis
Mraedis2mo ago
I think it's complaining these functions are missing the utc=True flag:
unlinked_photo_assets_df["photo_dt"] = pd.to_datetime(
unlinked_photo_assets_df["photo_filedate"]
)
unlinked_photo_assets_df["video_dt"] = pd.to_datetime(
unlinked_photo_assets_df["video_filedate"]
)
unlinked_photo_assets_df["photo_dt"] = pd.to_datetime(
unlinked_photo_assets_df["photo_filedate"]
)
unlinked_photo_assets_df["video_dt"] = pd.to_datetime(
unlinked_photo_assets_df["video_filedate"]
)
cc @Jacob :p
Jacob
Jacob2mo ago
Will add this! Thanks for the catch 🙂
Mraedis
Mraedis2mo ago
I don't know what the consequences are*
Jacob
Jacob2mo ago
@Mraedis I'm running into another issue that I didn't consider when I made this script. I previously wrote it for single-user accounts (which mine was at the time). Now I have my partner on the account, and my API key won't work for her assets. My Q: Is there an easy way via the API to filter out assets that don't have access with the specific API key? I could of course just look for the 400 error:
{'message': 'Not found or no asset.read access',
'error': 'Bad Request',
'statusCode': 400,
'correlationId': 'aztfkxlr'}
{'message': 'Not found or no asset.read access',
'error': 'Bad Request',
'statusCode': 400,
'correlationId': 'aztfkxlr'}
But if there's an actual way to test, that would be preferrable 🙂 @Special Extended Edition I'm going to get this cleaned up will ping you again once it's fixed for your account. This is a side project so please give it a few days 🙂 And, please don't manually link all of the photos, thiscan definitely be automated. I created the original script because I needed to link ~3k pics due to a corrupted photolibrary import. I just need to fix up a few minor things, it should work for you afterward.
Mraedis
Mraedis2mo ago
I don't know personally, best ask in #contributing or #immich @Jacob it sure sounds like it's something that exists 😛
Special Extended Edition
Thanks for the help Jacob. Question: would there be any reason that a Live Photo appears normal in the web UI but appears unlinked in the iOS application?
Special Extended Edition
Just to illustrate the above: here are two views of my immich timeline. One from the web and one from iOS.
No description
No description
Special Extended Edition
in the iOS app if I click any of the images, it does indeed have a live component. so it's not like it's displaying separated images from videos. more like it's displaying combined image+video, and then a phantom duplicate video
Jacob
Jacob2mo ago
Hi @Special Extended Edition , can you give this updated script a go? https://github.com/JacobBumgarner/immich-live-photo-linker You'll need to update the config.yaml, as there is a new username section.
Special Extended Edition
hmm - gave it a shot but still hitting an error Traceback (most recent call last): File "/home/jimmy/Downloads/immich-live-photo-linker/link_livephoto_videos.py", line 406, in <module> config = load_config(args.config) File "/home/jimmy/Downloads/immich-live-photo-linker/utils.py", line 173, in load_config validate_config(config) ~~~^^^^^^^^ File "/home/jimmy/Downloads/immich-live-photo-linker/utils.py", line 26, in validate_config raise KeyError( f"Configuration must contain {', '.join(required_sections)} sections. Missing: {', '.join(missing_sections)}" ) KeyError: 'Configuration must contain user-info, database, api sections. Missing: user-info'
Jacob
Jacob2mo ago
Sorry, that’s a config issue that I just fixed!! You can either “pull” the repo to get the update, or change “user_info” to “user-info” in the config.yaml file Sorry for the typo on my end 🙂 I have a local config file that I use for security reasons, and that update didn’t get added.
Special Extended Edition
good old dashes and underscores hmm now I'm getting a user not found error hmm maybe it wants the nickname and not like the actual email I log in with
Jacob
Jacob2mo ago
Nope not email. The name you have on your account Will try to make that clearer .
Special Extended Edition
got it. 1/2: Identifying unlinked Live Photo assets... No unlinked Live Photos identified. Ending script.
Jacob
Jacob2mo ago
Try manually unlinking one to verify it works?
Special Extended Edition
there are definitely unlinked live photos... but perhaps there's some issue that occured on import that broke the fields this script uses to identify what "should" be linked ah good call still none identified
Jacob
Jacob2mo ago
What are the two file names for the one you unlinked? Sorry it’s not working :/ will keep trying to help you with this
Special Extended Edition
IMG_7154.HEIC IMG_7154.MOV and no worries man I appreciate the help
Jacob
Jacob2mo ago
And the API key is correct for the username you put in?
Special Extended Edition
yep. I can try generating and pasting a new one I guess no change
Jacob
Jacob2mo ago
Ok let me double check everything on my end again. Will get back here shortly What are the dates and times for those files? The ones you manually unlinked
Special Extended Edition
March 23rd, 2025, 1:25AM GMT-4 for both of them
Jacob
Jacob2mo ago
I downloaded your files above and was able to link them, although I had to manually set the time because the date was updated for the video when I downloaded it. 1. Can you try uploading those two files you shared in the chat, and manually set their times to be the exact same? Then run the script and see if it identifies them. 2. If that doesn't work, please go to line 128 of the link_livephoto_videos.py file and add:
print(unlinked_photo_assets_df)
print(unlinked_photo_assets_df)
What does it say? 3. I'm wondering if you have duplicate file names across your library, and that's causing your error. E.g., if you search the IMG_7154.HEIC filename, does only one asset appear? I'm just looking at this. ... is this still happening for you?
Special Extended Edition
Yes this is happening, and I'm 90% certain it's due to this issue: https://github.com/immich-app/immich/discussions/7557 or this one https://github.com/immich-app/immich/issues/2665 basically - I created albums using immich-go which uploaded not just the image file but also the video file components of live photos to the album. the web app is apparently smart enough to merge them but there's a bug where the mobile app does not. the fix is to remove all the .mp4 files from the album, which seems to magically fix not just the album view but also the timeline. unfortunately I've got like thousands of affected photos so manually clicking on every gray exclamation point will take a while the first link has a python script that apparently automates this but I'm having trouble getting it to work for me and feel a bit iffy on modifying the database
Jacob
Jacob2mo ago
I see I see. So this seems like an entirely different problem than what my script was built for. To clarify, all of your photos are already correctly linked in the web, right? Does logging in and out on your phone fix it 😆
Special Extended Edition
I have both issues some photos are legitimately unlinked other photos are linked, but not displaying as linked in iOS so it's a bit of a mess
Jacob
Jacob2mo ago
Ugh that is frustrating. Have you just considered rebuilding your library.?
Special Extended Edition
the import process took so long and I've already done a lot of massaging to other issues (incorrect timestamps etc) so I'm a bit loath to restart the good news is I've got these 2 python scripts that solve each issue. just need to get them to work for your points above - I pasted your print function into line 128 (indented in line with the prior print function, if that matters) and got the same output as before. and yes I would for sure have some duplicate file names in certain cases (new phones etc). IMG 7154 is one such example
Jacob
Jacob2mo ago
Drop the indent by one level so it’s printed, need to see if it’s finding files The duplicate file names poses a problem, I designed the script to remove those to prevent multiple photos being linked to the same file. I can think about the implications of adding a flag to disable this. I can understand that… but don’t let sunk cost prevent a cleaner overall solution. Food for thought, but you do you 🙂
Special Extended Edition
here's the output after I added the print function
Jacob
Jacob2mo ago
How many assets do you have in your library? It’s saying it found potentially 67k unlinked photos before the duplicate removal process. I’m just hesitant to get rid of the duplicate removal process. The script finds photo and video base file name matches, removes photos with duplicate base file names, filters the remaining photo/video pairs to only include those captured at a similar time, and then links the remaining photos/videos. The risk of keeping duplicate base file names is that we would end up linking multiple photos to one video, which I don’t know is safe?
Special Extended Edition
67k feels right - that's roughly the total # of assets in my library I thought what the script does is look for files - one image and one video, with identical name and identical timestamp, and then link those? so wouldn't 2 identically named images still be treated separately based on time stamp Happy to say I fixed this so now iOS is displaying the library correctly
Jacob
Jacob2mo ago
That’s great. It’s not that smart 🤣 it’s currently built on just a bunch of table joining behavior. I could build an iterative process though if needed. But it sounds like you have it fixed?
Special Extended Edition
I fixed the bulk of my unlinked files but still have a few. I may just tackle them manually at this point or else adapt your python script later if I feel ambitious. Appreciate the help!

Did you find this page helpful?