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 flitflit 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.
Release files for makelive 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| makelive-0.1.0.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| makelive-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / makelive-0.1.0.tar.gz
| Download URL | makelive-0.1.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11ab84eaff651b80d3ee544bbcaa09eed2365fb36a812ca1f67566466448c018
|
|
BLAKE2b-256 checksum How to use checksums |
d2876bfbde0e90f0909aa78cb9512f51d65f48a0ea2765164abde4c1888d8c5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Release files / makelive-0.1.0-py3-none-any.whl
| Download URL | makelive-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00e6e6664ae00508007279808fb7f15f8e6dc90240b3f02c7be01c643c029ad4
|
|
BLAKE2b-256 checksum How to use checksums |
551602c3a22fb5376a7b814e39147df9d9a855bc9b24d5bb78e6cd48b7c398fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|