Git Product home page Git Product logo

livephotoparser's Introduction

LivePhotoParser

A C#/.Net library that can parse live photos from various smartphone brands.

一个可以解析各个品牌手机拍摄的实况照片(动态照片、Live Photo)的C#/.Net库。

Supported Brands

  • Meizu
  • Xiaomi

Usage

General usage:

using LivePhotoParser;

// register parsers. This step is required cause the library doesn't know specific parsers by default.
MeizuLivePhotoParser meizuParser = new();
XiaomiLivePhotoParser xiaomiParser = new();
LivePhotoParser.RegisterParser(Brand.Meizu, meizuParser);
LivePhotoParser.RegisterParser(Brand.Xiaomi, xiaomiParser);

LivePhotoParser parser = new();
// auto detect brand
LivePhoto livePhoto = parser.Parse("path/to/live/photo");
// specify brand
// LivePhoto livePhoto = parser.Parse("path/to/live/photo", Brand.Xiaomi);

// infos
Console.WriteLine(livePhoto.Brand);
List<SubFile> subFiles = livePhoto.SubFiles;
Console.WriteLine(livePhoto);

// get photo and video streams
MemoryStream photoStream = livePhoto.ExtractMainPic();
MemoryStream videoStream = livePhoto.ExtractMainVideo();

// save to file
livePhoto.SaveMainPic("path/to/save/photo.jpg");
livePhoto.SaveMainVideo("path/to/save/video.mp4");
livePhoto.SaveAllSubFiles("path/to/save/subfiles/directory");

Specific usage:

using LivePhotoParser.Meizu;

MeizuLivePhotoParser parser = new();
// ILivePhotoParser parser = new MeizuLivePhotoParser();
MeizuLivePhoto livePhoto = parser.Parse("path/to/live/photo");
LivePhoto aLivePhoto = livePhoto;

License

This project is licensed under the LGPL v3 License - see the LICENSE file for details.

livephotoparser's People

Contributors

hhaowang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.