Skip to main content

Add the necessary metadata to photo + video pair so Photos recognizes them as Live Photos when imported

Project description

MakeLive

Convert an photo + video pair into a Live Photo.

This is a simple command line tool that will apply the necessary metadata to a photo + video pair so that when they are imported into the Apple Photos, they will be treated as a Live Photo.

Usage

makelive photo.jpg video.mov

Requirements

  • macOS (Tested on 13.5.1; should work on 10.15+)
  • Python 3.9+

Installation

  • pip install flit
  • flit install

API

from makelive import make_live_photo

photo_path = "test.jpg"
video_path = "test.mov"
asset_id = make_live_photo(photo_path, video_path)
print(f"Wrote Asset ID: {asset_id} to {photo_path} and {video_path}")

Note: XMP metadata in the QuickTime movie file is not preserved by this function which may result in metadata loss.

Metadata including EXIF, IPTC, and XMP are preserved in the image file but will be rewritten and the Core Graphics API may change the order of the metadata and normalize the values. For example, the tag XMP:TagsList will be rewritten as XMP:Subject and the value will be normalized to a list of title case strings.

If you must preserve the original metadata completely, it is recommended to make a copy of the metadata using a tool like exiftool before calling this function and then restore the metadata after calling this function. (But take care not to delete the ContentIdentifier metadata.)

How it works

In order for Photos to treat a photo + video pair as a Live Photo, the video file must contain a Content Identifier metadata tag set to a UUID. The associated photo must contain a Content Identifier metadata tag set to the same UUID. Unfortunately, these tags cannot be written with the standard exiftool utility if they do not already exist in the file as the metadata is stored in Maker Notes which exiftool cannot create.

This tool uses the Core Graphics and AV Foundation frameworks to modify the metadata of the photo and video files.

Caution

This tool has not yet been extensively tested. It is recommended that you make a backup of your photo and video files before using this tool as it will overwrite the files.

Source Code

The source code is available here.

License

MIT License, see LICENSE for details.

Credits

The Live-Photo-master project by GUIYIVIEW was helpful for understanding how to set the asset ID in the QuickTime file. Copyright (c) 2017 GUIYIVIEW and published under the MIT License.

Thank you to Yorian who proposed this project and provided the test images. For more information, see this discussion.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

makelive-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

makelive-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file makelive-0.1.0.tar.gz.

File metadata

  • Download URL: makelive-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for makelive-0.1.0.tar.gz
Algorithm Hash digest
SHA256 11ab84eaff651b80d3ee544bbcaa09eed2365fb36a812ca1f67566466448c018
MD5 5f2f820f4be9fb477a03de98cf59938d
BLAKE2b-256 d2876bfbde0e90f0909aa78cb9512f51d65f48a0ea2765164abde4c1888d8c5b

See more details on using hashes here.

File details

Details for the file makelive-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: makelive-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for makelive-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00e6e6664ae00508007279808fb7f15f8e6dc90240b3f02c7be01c643c029ad4
MD5 3529039bfafc34ae95a17e5bfe994940
BLAKE2b-256 551602c3a22fb5376a7b814e39147df9d9a855bc9b24d5bb78e6cd48b7c398fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page