# Live Photo Box CLI — User Guide [![Latest release](https://img.shields.io/github/v/release/lengxiqwq/live-photo-box?style=flat-square&color=0078D7&label=latest%20release)](https://github.com/lengxiqwq/live-photo-box/releases) [![License](https://img.shields.io/badge/license-GPL%203.0-blue?style=flat-square)](https://github.com/lengxiqwq/live-photo-box/blob/main/LICENSE) [![Platform](https://img.shields.io/badge/Platform-Windows%2010%20%7C%2011-0078D7?style=flat-square&logo=windows11)](https://github.com/lengxiqwq/live-photo-box) [![Repository](https://img.shields.io/badge/Repository-GitHub-0078D7?style=flat-square&logo=github)](https://github.com/lengxiqwq/live-photo-box) [![Issues](https://img.shields.io/badge/Issues-Report-red?style=flat-square)](https://github.com/lengxiqwq/live-photo-box/issues) --- ## Overview Live Photo Box is available in two forms — a graphical interface and a command line. The command-line entry point `livephotobox` (alias `lpb`) is designed for scripting, AI, and automation. For everyday interactive use, please use the graphical interface, available on [Microsoft Store](https://apps.microsoft.com/detail/9n3d1qnrtvch?referrer=appbadge&mode=full) and [GitHub Releases](https://github.com/lengxiqwq/live-photo-box/releases). --- ## Installation Four install options are available on the [Releases page](https://github.com/lengxiqwq/live-photo-box/releases): | Method | Install | Contents | PATH | |--------|---------|----------|------| | WinGet | `winget install LengxiQwQ.LivePhotoBox` | CLI only | Added automatically — no manual step | | Installer | Run `*-x64-setup.exe` | GUI + CLI | Optional during install — no manual step | | Portable | Extract `*-x64-portable.zip` | GUI + CLI | Add manually | | CLI-only | Extract `*-x64-cli.zip` | CLI only | Add manually | All packages include the same `livephotobox.exe` and its four aliases. WinGet and installer copies get PATH set up during install — only the portable and CLI-only zips need manual PATH (see below). WinGet-managed copies are updated and uninstalled via WinGet — not `lpb update` (see Updating below). --- ## Adding the CLI to your PATH On Windows, running an executable from the current folder requires a `.\` prefix — e.g. `.\lpb --version`. To call `lpb` (or any alias) from any directory, add the install folder to your **user PATH**. WinGet and installer copies get PATH set up during install — the steps below are only needed for the portable and CLI-only zips. The package includes two helper scripts at its root for one-click setup: - `add-to-path.cmd` — double-click to add this folder to your user PATH (no admin required) - `remove-from-path.cmd` — double-click to remove it from your user PATH again Run the script from the folder that contains `livephotobox-boot.exe` (the portable / CLI package root). Restart your terminal afterwards, then any alias works globally: | Without PATH | With PATH | |--------------|-----------| | `.\lpb merge photo.heic video.mov` — only from the CLI folder | `lpb merge photo.heic video.mov` — from any folder | --- ## Executable Aliases The tool ships under four equivalent names — use whichever is shortest: | Alias | Description | |-------|-------------| | `livephotobox` | Full name | | `livephoto` | Shortened | | `livebox` | Compact | | `lpb` | Short for Live Photo Box | --- ## Updating Updates are **user-triggered**. | Command | Action | |---------|--------| | `lpb update` | Check GitHub; if a newer version exists, download the matching package and install it | | `lpb update-check` | Check only — no install | **Options:** | Option | Applies to | Description | |--------|------------|-------------| | `-y`, `--yes` | `update` | Skip the confirmation prompt and update automatically (required for scripts) | ### WinGet-managed copies A copy installed with WinGet **does not use the built-in update** — WinGet owns installing, upgrading, and uninstalling: - `lpb update` / `update-check` still report newer versions, but `lpb update` does not install — it prints `Update with: winget upgrade LengxiQwQ.LivePhotoBox` and exits. - Update: `winget upgrade LengxiQwQ.LivePhotoBox` · Uninstall: `winget uninstall LengxiQwQ.LivePhotoBox`. - Not sure which channel your copy is? Run `lpb --info` — a WinGet copy reports `Channel: WinGet (CLI-only)`. ### Portable & installer copies `lpb update` performs the update itself, asking `Update now? [Y/n]` first (Enter/`y` proceeds); the matching package is picked automatically. Both commands need internet; on failure they print the reason and a `Manual download: …` link. --- ## Quick Start ```powershell # Show version (single line); `lpb -v` is a shortcut for `lpb --version` lpb --version # Show detailed environment info (install details, bundled tool versions) lpb --info # View protocol × format compatibility matrix lpb protocols # View the shared processing-branch configuration lpb backend # Convert standalone media through the Rebuilt Native pipeline (no external media CLI) lpb convert input.mov -o output.mp4 --codec h264 lpb convert input.heic -o output.jpg # Convert a single pair (iPhone → Google Photos) lpb merge photo.heic video.mov -p motionphoto -y # Batch-convert a folder (→ HUAWEI, auto-confirm; writes ./MyPhotos/MyPhotos_huawei/) lpb merge -d ./MyPhotos -p huawei -y # Split a single-file live photo back into photo + video lpb split photo.jpg -y # Batch-split a folder (folder is auto-detected; -d also works) lpb split ./MyPhotos -y # View current cover position & protocol info of an existing live photo (no changes) lpb cover photo.jpg # Change the cover to 1.5s into the video (writes {name}_cover{frame}.jpg next to the source) lpb cover photo.jpg --at 1.5 -y ``` --- ## Commands | Command | Description | |---------|-------------| | `lpb convert` | Convert a standalone JPEG/HEIC image or MOV/MP4 video through the Rebuilt Native media pipeline | | `lpb protocols` | View protocol × format compatibility and device support | | `lpb merge` | Merge image+video pairs (single pair or batch) | | `lpb split` | Split single-file live photos into separate image and video files | | `lpb cover` | Change the cover frame (Key Photo) of an existing live photo; alias `keyphoto` | | `lpb repair` | Analyze and repair live photo metadata | | `lpb backend` | View or configure the global `rebuilt` / `legacy` branch | | `lpb --info` / `lpb --version` (`-v`) | Show version, environment, and bundled tool versions | The `update` / `update-check` commands are covered in the Updating section above. ### `backend` — Configure the global processing branch The GUI and CLI share `%LOCALAPPDATA%\LivePhotoBox\backend-settings.json`. There is one global switch, not one setting per protocol. It defaults to `rebuilt`. Rebuilt standalone media conversion runs through the Native C++ media library and does not launch FFmpeg or another external media CLI. Vendor protocol writers are not enabled yet, so `merge`, `split`, `cover`, and `repair` still stop before Legacy code is used. Set `legacy` only when you explicitly need the preserved `v2.2.1` compatibility implementation. | Goal | Command | |------|---------| | View configuration path and active branch | `lpb backend` | | Use the preserved compatibility implementation | `lpb backend mode legacy` | | Use the new isolated branch | `lpb backend mode rebuilt` | | Delete the shared configuration and restore the Rebuilt default | `lpb backend reset` | `rebuilt` deliberately does not fall back to Legacy. `lpb convert` and the current rebuilt merge/split media paths use Native probing, conversion, and cleaning. Rebuilt split exports only protocol-free neutral files; Apple/vivo target writers remain isolated for a later phase. Unsupported operations fail clearly and create no guessed output. ### `convert` — Rebuilt Native standalone media conversion `convert` accepts a standalone JPEG/HEIC image or MOV/MP4 video. Image output is selected by the output extension (`.jpg`/`.jpeg` or `.heic`/`.heif`). Video output is selected by the output extension (`.mp4` or `.mov`); use `--codec copy`, `--codec h264`, or `--codec hevc` to select stream copy/remux or a real Native transcode. The source is probed by Native before conversion; a failed probe is an explicit failure and never falls back to caller-supplied guesses. ```powershell lpb convert input.mov -o output.mp4 --codec h264 lpb convert input.mp4 -o output.mov --codec hevc lpb convert input.heic -o output.jpg lpb convert input.jpg -o output.heic --overwrite lpb convert input.jpg -o output.heic ``` --- ### `protocols` — View protocol × format compatibility and device support Run `lpb protocols` to view this interactively, or `lpb protocols --json` for structured output. The command reports the active global backend and the protocol/format matrix. In the default `rebuilt` mode, standalone conversion and the current merge/split media paths use Native; rebuilt split exposes only protocol-free neutral output. Target protocol writers remain isolated for a later phase. Standalone media conversion is available via `lpb convert`. **Compatibility matrix** — which output formats each protocol supports: | Protocol | JPEG + MP4 | JPEG + MOV | HEIC + MP4 | HEIC + MOV | HEIC + MP4 (H.265) | |---|---|---|---|---|---| | Google Micro Video (v1) | ✅ | ✅ | ✖️ | ✖️ | ✖️ | | Google Motion Photo (v2) | ✅ | ✅ | ✖️ | ✅ | ✖️ | | OPPO O-Live Photo | ✅ | ✖️ | ✖️ | ✖️ | ✖️ | | vivo Live Photo | ✅ | ✖️ | ✖️ | ✖️ | ✖️ | | Samsung Motion Photo | ✅ | ✖️ | ✅ | ✖️ | ✖️ | | HUAWEI Moving Photo | ✅ | ✖️ | ✅ | ✖️ | ✅ | `✅` — supported  |  `✖️` — not supported **Merge — device support:** | Protocol | Devices | Status | |---|---|---| | Google Micro Video (v1) | Windows / Xiaomi (legacy MIUI) / Pixel | ✅ Supported | | Google Motion Photo (v2) | Windows / Xiaomi / Pixel | ✅ Supported | | OPPO O-Live Photo | Windows / Xiaomi / OPPO | ✅ Supported | | vivo Live Photo | Windows / vivo (≥ X300) | 🟡 In testing | | Samsung Motion Photo | Windows / Samsung | ✅ Supported | | HUAWEI Moving Photo | HUAWEI / Honor | ✅ Supported | **Split — device support:** | Protocol | Devices | Status | |---|---|---| | Neutral split | Any device | ✅ Supported | **Split — protocol × format compatibility:** | Protocol | Keep | JPG + MOV | HEIC + MOV | JPG + MP4 | |---|---|---|---|---| | None (split only) | ✅ | ✅ | ✅ | ✅ | > In `rebuilt` mode only `none` (neutral split) is enabled. Apple/vivo combinations remain available only in the preserved Legacy compatibility branch and do not indicate rebuilt target-writer support. **JSON output** for scripting: ```powershell lpb protocols --json ``` --- ### `merge` — Merge image+video pairs The primary command. Supports two operating modes: | Mode | Arguments | Use case | |------|-----------|----------| | Single pair | `photo.jpg video.mp4` (auto-detected) | One image and one video | | Batch folder | `` (auto-detected: no extension) or `-d` | Directory of pairs (auto-matched by filename) | #### Examples | Goal | Command | |------|---------| | Batch merge a folder, auto-confirm | `lpb merge ./MyPhotos -p motionphoto -y` (folder auto-detected; `-d` also works) | | HUAWEI native HEVC (single pair) | `lpb merge photo.jpg video.mp4 -p huawei -f heic+mp4-h265 -y` | | Batch → HUAWEI, explicit output folder | `lpb merge -d ./MyPhotos -p huawei -o ./Output -y` | | Recursive batch, keep folder structure | `lpb merge -d ./Photos -r -s -p motionphoto -o ./Output -y` | | Preview without creating folders | `lpb merge -d ./Photos -p motionphoto --dry-run` | | Custom filename template | `lpb merge -d ./Photos -p motionphoto -n "custom:{name}_{protocol}_{date}" -y` | | Overwrite instead of auto-renaming | `lpb merge photo.jpg video.mp4 -p huawei -y -w` | | Set key photo position (2.500 s) | `lpb merge photo.jpg video.mp4 -p huawei --key-timestamp 2.500 -y` | > **Note:** Wildcards (`*.jpg`) are not supported. Pass a folder (`-d`) or list files explicitly. --- #### Full Option Reference **Input** | Option | Description | |--------|-------------| | `