Code Monkey home page Code Monkey logo

tencent / libpag Goto Github PK

View Code? Open in Web Editor NEW
4.7K 48.0 432.0 191.62 MB

The official rendering library for PAG (Portable Animated Graphics) files that renders After Effects animations natively across multiple platforms.

Home Page: https://pag.art

License: Other

CMake 0.82% Python 0.03% Java 5.88% Shell 0.20% JavaScript 1.31% C++ 69.26% C 1.26% Objective-C 5.19% Objective-C++ 4.45% QML 0.01% CSS 0.20% HTML 0.23% TypeScript 11.15%
libpag pag animation keyframes after-effects

libpag's Introduction

PAG Logo

license PRs Welcome codecov Actions Status build GitHub release (latest SemVer)

English | 简体中文 | Homepage

Introduction

libpag is a real-time rendering library for PAG (Portable Animated Graphics) files that renders both vector-based and raster-based animations across most platforms, such as iOS, Android, macOS, Windows, Linux, and Web.

PAG is an open-source file format for recording animations. PAG files can be created and exported from Adobe After Effects with the PAGExporter plugin and previewed in the PAGViewer app, which you can get from pag.art, and both of them are available on both macOS and Windows.

PAG is now being used by 40+ Tencent apps, such as WeChat, Mobile QQ, Honor of Kings Mobile Game, Tencent Video, QQ Music, and so on, reaching hundreds of millions of users.

Advantages

  • Highly efficient file format

intro_1

Benefiting from the highly efficient binary format design, PAG files can be decoded 10x faster than JSON files but also are about 50% smaller in file size when exporting the same animations. Designers can also ship beautiful animations with bitmaps or audiovisual media integrated into a single file easily without other attachments.

  • All AE features supported

intro_2

While other solutions may only support exporting limited vector-based AE features, PAG supports exporting all AE animations into a single file by combining vector-based exporting with raster-based exporting techniques. Therefore, third-party plugin effects in AE can be exported as well.

  • Measurable performance

intro_4

PAG provides a monitoring panel in PAGViewer that shows normalized performance data for PAG files, which helps designers to examine and optimize performance easily without developers. Along with dozens of automatic optimization techniques from the PAGExporter plugin, animations with cool visual effects and excellent performance now can be created more effectively.

  • Runtime editable animations

intro_5

With the flexible editing APIs from PAG SDK, developers can easily change the layer structure of a single PAG file, mix multiple PAG files into one composition, or replace texts and images with all pre-designed animation effects applied at runtime. It reduces tons of coding work for product features like video templates.

System Requirements

  • iOS 9.0 or later
  • Android 4.4 or later
  • macOS 10.15 or later
  • Windows 7.0 or later
  • Chrome 69.0 or later (Web)
  • Safari 11.3 or later (Web)

Getting Started

We currently only publish precompiled libraries for iOS, Android, and Web. You can build libraries of other platforms from the source code. The latest releases can be downloaded from here.

iOS Integration

You can use the framework downloaded from the release page, or add libpag to your project by CocoaPods: Add the pod to your Podfile:

pod 'libpag'

And then run:

pod install

After installing the cocoapod into your project import libpag with

#import <libpag/xxx.h>

Android Integration

You can use the aar downloaded from the release page, or add libpag to your project by Maven:

Edit the build.gradle file in the root of your project, add mavenCentral() to repositories:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

Add libpag to app/build.gradle (4.0.5.10 should be replaced with the latest release version):

dependencies {
    implementation 'com.tencent.tav:libpag:4.0.5.10'
}

Add the following rule to your proguard rules to avoid the wrong obfuscation.

  -keep class org.libpag.** {*;}
  -keep class androidx.exifinterface.** {*;}

Finally, run gradle sync and then build the project.

Web Integration

Simply copy the following code into an HTML file and open it in your browser:

<canvas class="canvas" id="pag"></canvas>
<script src="https://unpkg.com/libpag@latest/lib/libpag.min.js"></script>
<script>
  window.libpag.PAGInit().then((PAG) => {
    const url = 'https://pag.art/file/like.pag';
    fetch(url)
      .then((response) => response.blob())
      .then(async (blob) => {
        const file = new window.File([blob], url.replace(/(.*\/)*([^.]+)/i, '$2'));
        // Do Something.
      });
  });
</script>

More information:Web SDK Guide

Example

Check out the following projects to learn how to use the APIs of libpag:

Documentation

You can find other docs on pag.art

Development

We recommend using CLion IDE on the macOS platform for development.

Branch Management

  • The main branch is our active developing branch which contains the latest features and bugfixes.
  • The branches under release/ are our stable milestone branches which are fully tested. We will periodically cut a release/{version} branch from the main branch. After one release/{version} branch is cut, only high-priority fixes are checked into it.

Note: This repository only contains the latest code since PAG 4.0. To use the legacy PAG 3.0 versions, you can download the precompiled libraries from here.

Build Prerequisites

  • Xcode 11.0+
  • GCC 9.0+
  • Visual Studio 2019+
  • NodeJS 14.14.0+
  • Ninja 1.9.0+
  • CMake 3.13.0+
  • QT 5.13.0+
  • NDK 19.2+ (19.2.5345600 recommended)
  • Emscripten 3.1.20+ (3.1.20 recommended)

Dependency Management

libpag uses depsync tool to manage third-party dependencies.

For macOS platform:

Run the script in the root of the project:

./sync_deps.sh

This script will automatically install the necessary tools and synchronize all third-party repositories.

For other platforms:

First, make sure you have installed the latest version of node.js (You may need to restart your computer after this step). And then run the following command to install depsync tool:

npm install -g depsync

And then run depsync in the root directory of the project.

depsync

Git account and password may be required during synchronizing. Please make sure you have enabled the git-credential-store so that CMakeList.txt can trigger synchronizing automatically next time.

Build

After the synchronization, you can open the project with CLion and build the pag library.

For macOS platform:

There are no extra configurations of CLion required.

For Windows platform:

Please follow the following steps to configure the CLion environment correctly:

  • Make sure you have installed at least the [Desktop development with C++] and [Universal Windows Platform development] components for VS2019.
  • Open the File->Setting panel, and go to Build, Execution, Deployment->ToolChains, then set the toolchain of CLion to Visual Studio with amd64 (Recommended) or x86 architecture.

Note: If anything goes wrong during cmake building, please update the cmake commandline tool to the latest version and try again.

Support Us

If you find libpag is helpful, please give us a Star. We sincerely appreciate your support :)

Star History Chart

License

libpag is licensed under the Apache Version 2.0 License

Privacy Policy

Please comply with the personal information processing rules of PAG SDK while using libpag SDK

Contribution

If you have any ideas or suggestions to improve libpag, welcome to submit an issue / pull request. Before making a pull request or issue, please make sure to read Contributing Guide.

libpag's People

Contributors

alsotang avatar codingingboy avatar domchen avatar fanmingyi avatar fjie avatar fusionxu avatar gaoyuexit avatar h3r3x3 avatar hparty avatar imzc avatar jcyuan avatar katacai avatar kevingpqi123 avatar liu-wanshun avatar luckyzhliu avatar lvpengwei avatar mapleqin avatar newstarchen avatar renzhilan avatar snowhe2017 avatar sovea avatar xndcn avatar zenoslin avatar zhalice2011 avatar zhuangliebin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libpag's Issues

官网下载链接失效

Bug 描述

问题

请告诉我们你遇到了什么问题。预期是什么?实际表现是什么?

重现

请说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 Bug 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:iPhone 7(iOS 12),OnePlus 7(Android 10),iMac 5K(macOS 10.15.3)

Demo(可选)

请给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

如果还有其他信息可以帮助我们定位问题,请添加其他内容。

安装pag之后 ae没有相应的显示

问题描述

问题

告诉我们你遇到了什么问题。

重现

说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 issue 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:iPhone 7(iOS 12),OnePlus 7(Android 10),iMac 5K(macOS 10.15.3)

Demo(可选)

给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

添加其他内容

使用多个PAGView有概率死锁

libpag 版本:libpag-ios(v3.2.4.37)

主线程backtrace如下

  • thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    • frame #0: 0x00000001b83fec10 libsystem_kernel.dylib__psynch_mutexwait + 8 frame #1: 0x00000001b8322808 libsystem_pthread.dylib_pthread_mutex_firstfit_lock_wait + 92
      frame #2: 0x00000001b8322778 libsystem_pthread.dylib_pthread_mutex_firstfit_lock_slow + 260 frame #3: 0x00000001b848510c libc++.1.dylibstd::__1::mutex::lock() + 16
      frame #4: 0x000000010de6410c libpag___lldb_unnamed_symbol182$$libpag + 40 frame #5: 0x000000010dec14dc libpagpag::PAGPlayer::setProgress(double) + 80
      frame #6: 0x000000010decfd88 libpag-[PAGView onAnimationUpdate:] + 40 frame #7: 0x000000010df037f8 libpag___lldb_unnamed_symbol1730$$libpag + 192
      frame #8: 0x000000010df033ac libpag___lldb_unnamed_symbol1725$$libpag + 192 frame #9: 0x0000000111998114 GPUToolsCore-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 172
      frame #10: 0x00000001bf13b354 QuartzCoreCA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 512 frame #11: 0x00000001bf20b1a4 QuartzCoredisplay_timer_callback(__CFMachPort*, void*, long, void*) + 268
      frame #12: 0x00000001b8569584 CoreFoundation__CFMachPortPerform + 176 frame #13: 0x00000001b8593f44 CoreFoundationCFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 60
      frame #14: 0x00000001b85935e8 CoreFoundation__CFRunLoopDoSource1 + 452 frame #15: 0x00000001b858e0e0 CoreFoundation__CFRunLoopRun + 1880
      frame #16: 0x00000001b858d660 CoreFoundationCFRunLoopRunSpecific + 480 frame #17: 0x00000001c299e604 GraphicsServicesGSEventRunModal + 164
      frame #18: 0x00000001bc76215c UIKitCore`UIApplicationMain + 1944

CollectionViewCell中间歇性的连续点击会出现动画错乱

Bug 描述

CollectionViewCell中间歇性的连续点击会出现动画错乱

问题

请告诉我们你遇到了什么问题。预期是什么?实际表现是什么?
CollectionViewCell中间歇性的连续点击会出现动画错乱,预期是只有当前点击的cell有动画,实际表现其他cell也会有动画

重现

间歇性的连续点击cell触发动画

请说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 Bug 上传。

环境

libpag 版本:libpag-ios(v3.2.7.40)
设备:iPhone 12mini(iOS 14.4)

Demo(可选)

请给一个 Demo 项目,我们可以运行并重现这个问题。
PagDemo.zip

其他(可选)

如果还有其他信息可以帮助我们定位问题,请添加其他内容。

Web 端 iOS 省电模式 await PAG.PAGView.init 失败

Bug 描述

问题

Web 端 iOS 省电模式 await PAG.PAGView.init 失败

重现

可以用官方文档里的代码片段重现

// <canvas class="canvas" id="pag"></canvas>
const pagFile = await PAG.PAGFile.load(file);
document.getElementById("pag").width = await pagFile.width();
document.getElementById("pag").height = await pagFile.height();
// 这一步在 iOS 省电模式时 await 不会结束
const pagView = await PAG.PAGView.init(pagFile, "#pag");
pagView.setRepeatCount(0);
await pagView.play();

环境

web 版本:[email protected]
设备:iPhone 12 Pro Max iOS15.2.1

非常好用,希望可以尽快支持web端的使用

问题描述

问题

告诉我们你遇到了什么问题。

重现

说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 issue 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:iPhone 7(iOS 12),OnePlus 7(Android 10),iMac 5K(macOS 10.15.3)

Demo(可选)

给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

添加其他内容

有没有和 lottie 的对比文档?

问题描述

问题

请告诉我们你遇到了什么问题。预期是什么?实际表现是什么?

想要了解下,这个项目和 lottie 之间的区别。

给多边形或星形加圆角,总会有一个角是直角

Bug 描述

问题

  1. 在AE中,给形状图层加圆角(矩形是正常的,出问题的是多边形和星形)

截屏2022-03-21 上午10 30 36

2. AE中显示的是,图形的每个角都有圆角。但是当导出为PAG后,用PAGViewer预览时,总有一个角是直角。

截屏2022-03-21 上午10 30 21

重现

  1. 在AE中新建形状图层
  2. 画一个多边形或者星形
  3. 导出为PAG

环境

libpag 版本:PAGViewer(2.2.1.3 beta)
设备:iMac 5K(macOS 11.6)

10月14日,上传appstore会报错 libpag.framework' contains an invalid value '[iPhoneSimulator]'

问题描述

pod 'libpag', '~>3.2.4.37'

COCOAPODS: 1.11.2

10月13日上传App Store 正常。
10月14日 22:40分上传App Store会报错

ERROR ITMS-90542: "Invalid CFBundleSupportedPlatforms value. The key 'CFBundleSupportedPlatforms' in the Info.plist file in bundle 'Payload/Frameworks/libpag.framework' contains an invalid value '[iPhoneSimulator]'. Consider removing the CFBundleSupportedPlatforms key from the Info.plist. If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue."
100751634223522_ pic_hd

Could not get unknown property 'transformNativeLibsWithStripDebugSymbolForRelease' for project ':app' of type org.gradle.api.Project.

Bug 描述

问题

请告诉我们你遇到了什么问题。预期是什么?实际表现是什么?

重现

请说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 Bug 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:iPhone 7(iOS 12),OnePlus 7(Android 10),iMac 5K(macOS 10.15.3)

Demo(可选)

请给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

如果还有其他信息可以帮助我们定位问题,请添加其他内容。

请问下 ios有没有可以监听动画播放实时进度的API

问题描述

问题

告诉我们你遇到了什么问题。

重现

说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 issue 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:iPhone 7(iOS 12),OnePlus 7(Android 10),iMac 5K(macOS 10.15.3)

Demo(可选)

给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

添加其他内容

对比 Vap

Pag 相比较 Vap,新增了哪些功能吗?视频编辑是不是就是 Vap 中的融合元素?
有没有什么工具能从 Vap 转到 Pap,还是只能在现有 Vap 项目中加入 Pag 的 SDK?

动画一闪一闪

问题描述

动画一闪一闪,android 端有问题,ios 无问题

请问能否在android或者Ios上面,导出成视频格式。

问题描述

问题

告诉我们你遇到了什么问题。

重现

说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 issue 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:iPhone 7(iOS 12),OnePlus 7(Android 10),iMac 5K(macOS 10.15.3)

Demo(可选)

给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

添加其他内容

replaceText方法替换setTextData方法

问题描述

问题

运行下载的demo,把pagView.setTextData替换成pagFile.replaceText发现无效。

重现

环境

libpag 版本:,libpag-android(v3.2.5.1)
设备: pixel 2 api28

请问下 有没有可以监听动画播放实时进度的API

问题描述

问题

告诉我们你遇到了什么问题。

重现

说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 issue 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:iPhone 7(iOS 12),OnePlus 7(Android 10),iMac 5K(macOS 10.15.3)

Demo(可选)

给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

添加其他内容

PAGViewer: 当替换文本中含有空格时,替换后的文本无法显示

Bug 描述

问题

请告诉我们你遇到了什么问题。预期是什么?实际表现是什么?

替换文本中含有空格时,会导致替换后的文本无法显示

重现

请说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 Bug 上传。

打开mac/PAGViewer,将

textData.text = @"运动文字遮罩替换😀文本";

改为

textData.text = @"hello world";

环境

libpag 版本:main branch, mac/PAGViewer
设备:macOS 12.0.1

Demo(可选)

请给一个 Demo 项目,我们可以运行并重现这个问题。

mac/PAGViewer

如果还有其他信息可以帮助我们定位问题,请添加其他内容。

小米MIX2 Render Multiple PAG Files on APAGSuface回退崩溃

Bug 描述

问题

在小米手机上运行PAG-Android demo 中 Render Multiple PAG Files on APAGSuface 快速进入退出页面 崩溃

重现

PAG-Android 自带demo

环境

libpag 版本:libpag-android(v3.2.7.34)
设备:小米MIX 2(Android 9 MIUI 12.0.1稳定版)

Demo(可选)

其他(可选)

如果还有其他信息可以帮助我们定位问题,请添加其他内容。
2022-02-15 09:39:05.527 23254-23263/com.tencent.libpag.sample.libpag_sample A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 23263 (FinalizerDaemon), pid 23254 (e.libpag_sample)
2022-02-15 09:39:05.530 934-12655/? E/OMXNodeInstance: getConfig(0xe4a3b044:qcom.decoder.avc, ??(0x7f000062)) ERROR: UnsupportedSetting(0x80001019)
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: Build fingerprint: 'Xiaomi/chiron/chiron:9/PKQ1.190118.001/V12.0.1.0.PDECNXM:user/release-keys'
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: Revision: '0'
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: ABI: 'arm64'
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: pid: 23254, tid: 23263, name: FinalizerDaemon >>> com.tencent.libpag.sample.libpag_sample <<<
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: Abort message too long: claimed length = 564
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: x0 0000000000000000 x1 0000000000005adf x2 0000000000000006 x3 0000000000000008
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: x4 000024393f4f282a x5 000024393f4f282a x6 000024393f4f282a x7 2a284f3f3924ffff
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: x8 0000000000000083 x9 8d5b735a297cfd6a x10 0000000000000000 x11 fffffffc7ffffbdf
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: x12 0000000000000001 x13 ffffffffffffffff x14 ffff000000000000 x15 ffffffffffffffff
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: x16 00000071db3ad2b0 x17 00000071db2ccbd8 x18 0000000000000010 x19 0000000000005ad6
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: x20 0000000000005adf x21 00000071589bb100 x22 0000000000000000 x23 000000715805d843
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: x24 000000715805d6f7 x25 0000000000000001 x26 000000713b4826a0 x27 0000000000000043
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: x28 00000071589136f0 x29 000000713b482550
2022-02-15 09:39:05.590 23496-23496/? A/DEBUG: sp 000000713b482510 lr 00000071db2c004c pc 00000071db2c0074
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: backtrace:
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #00 pc 0000000000022074 /system/lib64/libc.so (abort+116)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #1 pc 00000000004671c0 /system/lib64/libart.so (art::Runtime::Abort(char const*)+1196)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #2 pc 0000000000008ce0 /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+724)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #3 pc 00000000002e694c /system/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1640)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #4 pc 00000000002e6abc /system/lib64/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+116)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #5 pc 00000000000fe540 /system/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::AbortF(char const*, ...)+148)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #6 pc 00000000000fcf1c /system/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::CheckPossibleHeapValue(art::ScopedObjectAccess&, char, art::(anonymous namespace)::JniValueType)+1152)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #7 pc 00000000000fc288 /system/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::(anonymous namespace)::JniValueType*)+628)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #8 pc 00000000001053e4 /system/lib64/libart.so (art::(anonymous namespace)::CheckJNI::SetField(char const*, _JNIEnv*, _jobject*, _jfieldID*, bool, art::Primitive::Type, art::(anonymous namespace)::JniValueType)+752)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #9 pc 000000000002847c /data/app/com.tencent.libpag.sample.libpag_sample-alNLnmoQrRWcY5dnrZHB8A==/oat/arm64/base.odex (offset 0x25000) (org.libpag.PAGPlayer.nativeFinalize+124)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #10 pc 000000000055d788 /system/lib64/libart.so (art_quick_invoke_stub+584)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #11 pc 00000000000d074c /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #12 pc 0000000000280dbc /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #13 pc 000000000027add0 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #14 pc 000000000052dc18 /system/lib64/libart.so (MterpInvokeDirect+296)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #15 pc 000000000054fe14 /system/lib64/libart.so (ExecuteMterpImpl+14484)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #16 pc 00000000001935f6 /data/app/com.tencent.libpag.sample.libpag_sample-alNLnmoQrRWcY5dnrZHB8A==/oat/arm64/base.vdex (org.libpag.PAGPlayer.finalize)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #17 pc 0000000000254ad4 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1132436365+488)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #18 pc 000000000025a5c8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #19 pc 000000000027adb4 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #20 pc 000000000052c8d8 /system/lib64/libart.so (MterpInvokeVirtual+588)
2022-02-15 09:39:05.601 23496-23496/? A/DEBUG: #21 pc 000000000054fd14 /system/lib64/libart.so (ExecuteMterpImpl+14228)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #22 pc 0000000000178c74 /system/framework/boot-core-libart.vdex (java.lang.Daemons$FinalizerDaemon.doFinalize+22)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #23 pc 0000000000254ad4 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1132436365+488)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #24 pc 000000000025a5c8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #25 pc 000000000027adb4 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #26 pc 000000000052dc18 /system/lib64/libart.so (MterpInvokeDirect+296)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #27 pc 000000000054fe14 /system/lib64/libart.so (ExecuteMterpImpl+14484)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #28 pc 0000000000178d5c /system/framework/boot-core-libart.vdex (java.lang.Daemons$FinalizerDaemon.runInternal+164)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #29 pc 0000000000254ad4 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1132436365+488)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #30 pc 000000000025a5c8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #31 pc 000000000027adb4 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #32 pc 000000000052c8d8 /system/lib64/libart.so (MterpInvokeVirtual+588)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #33 pc 000000000054fd14 /system/lib64/libart.so (ExecuteMterpImpl+14228)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #34 pc 0000000000178af4 /system/framework/boot-core-libart.vdex (java.lang.Daemons$Daemon.run+20)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #35 pc 0000000000254ad4 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1132436365+488)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #36 pc 000000000025a5c8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #37 pc 000000000027adb4 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #38 pc 000000000052d854 /system/lib64/libart.so (MterpInvokeInterface+1392)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #39 pc 000000000054ff14 /system/lib64/libart.so (ExecuteMterpImpl+14740)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #40 pc 00000000000dffac /system/framework/boot-core-oj.vdex (java.lang.Thread.run+12)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #41 pc 0000000000254ad4 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1132436365+488)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #42 pc 000000000051d18c /system/lib64/libart.so (artQuickToInterpreterBridge+1020)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #43 pc 00000000005668fc /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #44 pc 000000000055d788 /system/lib64/libart.so (art_quick_invoke_stub+584)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #45 pc 00000000000d074c /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #46 pc 000000000045f850 /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #47 pc 000000000046090c /system/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+424)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #48 pc 000000000048ed5c /system/lib64/libart.so (art::Thread::CreateCallback(void*)+1092)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #49 pc 00000000000901b0 /system/lib64/libc.so (__pthread_start(void*)+36)
2022-02-15 09:39:05.602 23496-23496/? A/DEBUG: #50 pc 0000000000023930 /system/lib64/libc.so (__start_thread+68)
2022-02-15 09:39:06.020 23496-23496/? E/crash_dump64: cannot open libmiuindbg.so: No such file or directory
2022-02-15 09:39:06.024 984-984/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_01
2022-02-15 09:39:06.038 770-770/? E/lowmemorykiller: Error writing /proc/23254/oom_score_adj; errno=22
2022-02-15 09:39:06.056 934-12655/? E/OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything...
2022-02-15 09:39:06.056 934-10209/? E/OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything...
2022-02-15 09:39:06.056 934-10486/? E/OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything...
2022-02-15 09:39:06.060 1628-1975/? E/InputDispatcher: channel '3294b1b com.tencent.libpag.sample.libpag_sample/com.tencent.libpag.sample.libpag_sample.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

组件多次渲染销毁,pagView显示失败

Bug 描述

组件中包含pag时,多次渲染销毁后。pagView.init失败;
组件销毁时pagView.destroy()报错:
message: "Cannot pass deleted object as a pointer of type _PAGPlayer*"
name: "BindingError"
stack: "BindingError: Cannot pass deleted object as a pointer of type _PAGPlayer*\n at BindingError. (http://localhost:3000/node_modules/.vite/libpag.js?v=f9aa5be6:5052:21)

问题

请告诉我们你遇到了什么问题。预期是什么?实际表现是什么?

重现

请说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 Bug 上传。

环境

npm libpag 0.0.5

Demo(可选)

请给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

如果还有其他信息可以帮助我们定位问题,请添加其他内容。

PAGSurface readPixels失败

Discussed in #77

Originally posted by krislyy January 26, 2022

private void pagToGif() {
        // pag player
        PAGComposition composition = makeComposition();
        int height = composition.height();
        int width = composition.width();
        PAGSurface surface = PAGSurface.MakeOffScreen(width, height);
        if (surface == null) return;
        PAGPlayer player = new PAGPlayer();
        player.setComposition(composition);
        player.setSurface(surface);
        player.setProgress(0);
        // byte buffer
        ByteBuffer buffer = ByteBuffer.allocateDirect(width * height * 4)
                .order(ByteOrder.nativeOrder());
        buffer.clear();
        // 开始导出
        int totalFrames = (int) (composition.duration() * composition.frameRate() / 1000000);
        for (int i = 0; i < totalFrames; i++) {
            generateSurfaceFrame(player, composition, i);
            surface.readPixels(buffer);
            Bitmap bitmap = BitmapFactory.decodeByteArray(buffer.array(), 0, buffer.capacity());
            buffer.clear();
        }
    }

PAGSurface的readPixels函数返回的buffer一直空的,想问下Android需要特殊设置什么才能拿到当前渲染的到surface上图片呢?

android手机web端,chrome浏览器UC浏览器,微信浏览器等大尺寸不显示

Bug 描述

问题

1、 当一个pag本身的size>900x1700整个动画就不会加载出来,换成小尺寸(600左右x1500)就显示出来。2、而且在web端的渲染像看PPT一样的,很卡很慢不流畅。

重现

[就用的一个很600K的pag文件,就2个text和2个img,pag本身尺寸1080x1920,这个尺寸web端不会显示出来,换成更小的尺寸700x1500左右又显示出来了]
PAG 素材可以在压缩之后,随这个 Bug 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:红米note 9 5G android-10,可以加我qq421160896联系

Demo(可选)

请给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

如果还有其他信息可以帮助我们定位问题,请添加其他内容。

bug-最新版本(0730)sdk在Android 5.1.1 rk3288主板无法渲然动画页面

问题描述

问题

告诉我们你遇到了什么问题。

重现

说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 issue 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:iPhone 7(iOS 12),OnePlus 7(Android 10),iMac 5K(macOS 10.15.3)

Demo(可选)

给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

添加其他内容

建议在微信小程序中内置

非常感谢 pag 团队分享这么棒的开源项目,建议 pag 团队可以考虑添加微信小程序支持。
微信小程序目前已经支持 wasm 的引入和执行,也支持 W3C 标准的 Canvas 2D WebGL API,在技术上应该没什么障碍。
对于 wasm 包大小等问题,目前看在 br 压缩后大约占 500K,可以考虑作为微信小程序内置库引入,避免增加小程序的包大小,这需要与微信团队合作推进。

缺少 libpag.so

Bug 描述

问题

请告诉我们你遇到了什么问题。预期是什么?实际表现是什么?
在SystemUI使用PAG实现充电动画,出现crash
02-21 12:09:35.745 27182 27182 I LibraryLoadUtils: loadLibrary libpag fail! Error: dlopen failed: library "liblibpag.so" not found
02-21 12:09:35.745 27182 27182 I LibraryLoadUtils: load fail! Error: dlopen failed: library "/data/user_de/0/com.android.systemui/lib/liblibpag.so" not found
02-21 12:09:35.747 27182 27182 E ndroid.systemu: No implementation found for void org.libpag.PAGPlayer.nativeInit() (tried Java_org_libpag_PAGPlayer_nativeInit and Java_org_libpag_PAGPlayer_nativeInit__)
02-21 12:09:35.747 27182 27182 D AndroidRuntime: Shutting down VM
02-21 12:09:35.748 27182 27182 E AndroidRuntime: FATAL EXCEPTION: main
02-21 12:09:35.748 27182 27182 E AndroidRuntime: Process: com.android.systemui, PID: 27182
02-21 12:09:35.748 27182 27182 E AndroidRuntime: java.lang.RuntimeException: Unable to create service com.android.systemui.keyguard.KeyguardService: android.view.InflateException: Binary XML file line #54 in com.android.systemui:layout/super_notification_shade: Binary XML file line #119 in com.android.systemui:layout/status_bar_expanded: Error inflating class org.libpag.PAGView

重现

请说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
直接在layout添加<org.libpag.PAGView>
PAG 素材可以在压缩之后,随这个 Bug 上传。

环境

libpag 版本:libpag-ios(v3.2.4.37),libpag-android(v3.2.5.1),PAGViewer(2.1.33 beta)
设备:iPhone 7(iOS 12),OnePlus 7(Android 10),iMac 5K(macOS 10.15.3)

Demo(可选)

请给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

如果还有其他信息可以帮助我们定位问题,请添加其他内容。

插件更新后(之前是ok的),渲染动画只支持1:1,其他比例不支持,只能渲染出部分画面,且上下会有空白区域,尺寸也被强行渲染为1:1

<script> const canvas = document.querySelector('#pag') const script = document.createElement('script') script.src = 'https://cdn.jsdelivr.net/npm/libpag@latest/lib/libpag.min.js' script.async = true script.onload = function() { window.libpag .PAGInit({}) .then(function(PAG) { const url = 'https://filmora.wondershare.com/assets/animations/Home_Banner_filmora11.pag' fetch(url) .then(function(response) { return response.blob()}) .then(function(blob) { const file = new window.File([blob], url.replace(/(.*\/)*([^.]+)/i, '$2')) PAG.PAGFile.load(file).then( pagFile => { console.log(pagFile.width()) console.log(pagFile.height()) PAG.PAGView.init(pagFile, '#pag').then(pagView => { pagView.setRepeatCount(0) pagView.play() canvas.parentElement.style.backgroundImage = 'none' }) }) }) }) } document.body.appendChild(script) </script>

渲染出来宽高是 300 * 300 ; 但实际原尺寸是 810 * 599

打包时使用 Terser 压缩失败,自己 clone 仓库后 build 的版本可以正常使用。

Bug 描述

问题

打包时使用 Terser 压缩失败,自己 clone 仓库后 build 的版本可以正常使用。

重现

使用代码压缩工具 Terser 时失败

🙅   Failed to compile.

js/11.cd37e1af.js from Terser
TypeError: t.replace is not a function
    at Array.forEach (<anonymous>)

自己在本地用 main 分支打包链接后,使用正常。猜测 npm 发布的代码有问题

环境

  • libpag@^0.1.0:
  • @tarojs/[email protected]
  • terser-webpack-plugin "^3.0.5"
  • terser "^4.8.0"

Demo(可选)

请给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

如果还有其他信息可以帮助我们定位问题,请添加其他内容。

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.