{"id":22381925,"url":"https://github.com/googleinterns/libmphoto","last_synced_at":"2025-06-10T22:03:40.394Z","repository":{"id":37519860,"uuid":"285899688","full_name":"googleinterns/libmphoto","owner":"googleinterns","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-12T19:25:08.000Z","size":20447,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T18:50:37.563Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleinterns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-07T18:49:47.000Z","updated_at":"2025-03-12T08:41:19.000Z","dependencies_parsed_at":"2022-08-18T20:31:24.054Z","dependency_job_id":null,"html_url":"https://github.com/googleinterns/libmphoto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleinterns%2Flibmphoto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleinterns%2Flibmphoto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleinterns%2Flibmphoto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleinterns%2Flibmphoto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleinterns","download_url":"https://codeload.github.com/googleinterns/libmphoto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleinterns%2Flibmphoto/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259159622,"owners_count":22814491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T00:11:01.988Z","updated_at":"2025-06-10T22:03:40.362Z","avatar_url":"https://github.com/googleinterns.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libmphoto: A motion photo demuxer and remuxer\n## Overview\n\nThis library provides an implementation for demuxing and remuxing motion photos (and microvideos) produced primarily by Android cameras. This library abstracts the reading/writing of XMP metadata which is used to parse and create these motion photos. \n\n## Terminology\n\n- **Motion Photo** - Describes a Google authored specification for a file that contains both a still and a video. The still must be a JPEG or HEIC, and the video must be an MP4.\n- **Microvideo**  - Describes a now deprecated specification that is replaced by motion photos.\n- **Demuxing** - Splitting a multi-part stream into individual parts (ie. splitting a motion photo into a still and video).\n- **Remuxing** - Combining multiple streams into a single stream (ie. combining a still and a video into a motion photo).\n\n## Usage\n\n### Demuxer\n\nThe demuxer enables the extraction of information and encoded media streams from a motion photo.\n\n#### Support\n| Type               | Supported |\n|--------------------|-----------|\n| JPEG Motion Photo | ✅         |\n| HEIC Motion Photo | ✅         |\n| Microvideo        | ✅         |\n\n#### Example\n```\n// Initalize the demuxer\nDemuxer demuxer;\ndemuxer.Init(motion_photo);\n\n// Extract the information\nImageInfo image_info;\ndemuxer.GetInfo(\u0026image_info);\n\n// Extract the still stream\nstring still;\ndemuxer.GetStill(\u0026still);\n\n// Extract the video stream\nstring video;\ndemuxer.GetVideo(\u0026video)\n```\n*see samples/demux.cc for complete example code*\n\n### Remuxer\n\nThe remuxer enables combining an encoded still and video stream to produce a motion photo. If the still has existing XMP metadata, it will persist into the new motion photo. If the still has existing microvideo XMP metadata, the result will be a microvideo. In all other cases, the resultant stream is a motion photo.\n\n#### Support\n| Type                   | Supported |\n|------------------------|-----------|\n| JPEG Still + Mp4 Video | ✅        |\n| HEIC Still + Mp4 Video | ❌        |\n\n*Due to a limitation of libheif, XMP cannot be added without decoding and re-encoding the HEIC. As such, remuxing with a HEIC still is not currently supported. Related libheif ticket: [libheif/issues/127](https://github.com/strukturag/libheif/issues/127).*\n\n\n#### Example\n```\n// Initalize the remuxer\nRemuxer remuxer;\n\n// Set the media streams\nremuxer.SetStill(still);\nremuxer.SetVideo(video);\n\n// Generate the motion photo\nstring motion_photo;\nremuxer.Finalize(\u0026motion_photo);\n```\n*see samples/remux.cc for complete example code*\n\n## Testing\nThis library has a set of unit tests that verify demuxing and remuxing functionality against a set of golden images. These tests depend on [googletest](http://github.com/google/googletest) and can be run with bazel using `bazel test //tests/...`.\n\n## Fuzzing\nThis library is setup to be fuzz tested with [libfuzzer](https://llvm.org/docs/LibFuzzer.html) through [bazel-rules-fuzzing](https://github.com/googleinterns/bazel-rules-fuzzing). Fuzzing can be run using `bazel test --config=(asan|msan)-libfuzzer //fuzz:(demuxer|remuxer)_fuzz_test`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleinterns%2Flibmphoto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleinterns%2Flibmphoto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleinterns%2Flibmphoto/lists"}