Code Monkey home page Code Monkey logo

agora-electron-faceunity-plugin's Introduction

FaceUnity Plugin for Agora Electron SDK

This repo provide a beauty plugin for Agora Electron SDK. Learn how it works.

How to build - Mac

  • There is a release.sh file under FaceUnityPlugin/mac
  • Run the script, it will automatically download FaceUnity Library and build the dll/dylib for you
  • FaceUnity 6.2.0 will be installed by default, for now you may need to change the script yourself to work with other FaceUnity versions

How to build - Win

  • There is a release.sh file under FaceUnityPlugin/win
  • Run the script, it will automatically download FaceUnity Library
  • Open the .sln file in the same folder and build
  • FaceUnity 6.2.0 will be installed by default, for now you may need to change the script yourself to work with other FaceUnity versions

Get Started

Please take a look at readme in /demo to learn how to integrate this plugin with agora-electron-sdk to realize beauty in your application.

APIs

plugin.fu.authdata

set face unity authdata, please ensure you set this before enable plugin

plugin.setParameter(JSON.stringify({
  "plugin.fu.authdata": []
}))

plugin.fu.bundles.load

load a set of face unity bundle and bundle options, for which options the bundle has, please look at face unity documentation instead

plugin.setParameter(JSON.stringify({"plugin.fu.bundles.load": [{
    bundleName: "face_beautification.bundle",
    bundleOptions: {
    }
}]}))

plugin.fu.bundles.update

update one face unity bundle option, the bundle has to be loaded first. using this api is more efficient if you need to frequently update plugin options. for which options the bundle has, please look at face unity documentation instead

plugin.setParameter(JSON.stringify({"plugin.fu.bundles.update": {
    bundleName: "face_beautification.bundle",
    bundleOptions: {
    }
}}))

agora-electron-faceunity-plugin's People

Contributors

menthays avatar plutoless avatar pplgin avatar zhangtao1104 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

agora-electron-faceunity-plugin's Issues

agora-electron-sdk升级失败

当“agora-electron-sdk”为“2.3.4-hotfix.4”时,是可以运行成功的,尝试升级至当前最新的版本“3.4.6-build.730”会出现“agora_rtc_engine.cpp:4730 ERR| Error :registerPlugin, :4730, GetProcAddress "createAVFramePlugin" Failed”的报错,进而导致加载dylib失败。

提示无法加载 FaceUnity 插件

控制台报错
App.tsx?85c4:167 failed to load plugin at /Users/xx/Documents/AgoraIO-Community/Agora-Electron-FaceUnity-Plugin/demo/static/fu-mac/libFaceUnityPlugin.dylib

libFaceUnityPlugin.dylib 构建失败

xcode 12.4
macOS 11.4 Big Sur

按照releases.sh的步骤进行构建,在 xcodebuild -project FaceUnityPlugin.xcodeproj 这一步失败, 信息如下。有没有直接构建好的libFaceUnityPlugin.dylib可以用呢

note: Using new build system
note: Planning build
note: Constructing build description
warning: OpenGL is deprecated. Consider migrating to Metal instead. (in target 'FaceUnityPlugin' from project 'FaceUnityPlugin')
error: The linked library 'libnama.a' is missing one or more architectures required by this target: arm64. (in target 'FaceUnityPlugin' from project 'FaceUnityPlugin')`

线程频繁切换导致FaceUnity插件频繁创建

问题描述
agora-electron-sdk 3.0+版本调用Faceunity插件,会由于线程切换导致Faceunity插件频繁创建,进而导致应用崩溃(尝试过3.0+的许多版本都存在这个问题)

异常log(红色线程打印为添加日志后重新编译的lib)
image
插件log添加位置
image

预期效果
期待能支持最新版本sdk与Faceunity插件正常结合使用
如果有可用的3.2+版本期待能推荐一下
万分感激!

另附:
在Electron-SDK项目issue中发现有对线程做过一次处理(我不懂C,看不懂哈),可点击此跳转

若无法实现,期待能帮忙解释下现有问题出现的原因

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.