Tencent /libpag
The official rendering library for PAG (Portable Animated Graphics) files that renders After Effects animations natively across multiple platforms.
★ 5,822⑂ 533👁 47⑃ 1,525● 734▤ 73
+1
Daily
5,822
stars
533
forks
47
watchers
1,525
prs
734
issues
73
releases
README
English | 简体中文 | Homepage Introduction libpag is a real-time rendering library for PAG (Portable Animated Graphics) files, capable of rendering both vector-based and raster-based animations across various platforms, including iOS, Android, OpenHarmony, macOS, Windows, Linux, and the Web. PAG is an open-source file format designed for recording animations. You can create and export PAG files from Adobe After Effects using the PAGExporter plugin and preview them in the PAGViewer app, both available on macOS and Windows. PAG is widely used in major Tencent apps like WeChat, Mobile QQ, Honor of Kings, Tencent Video, and QQ Music, as well as in thousands of third-party apps, reaching hundreds of millions of users. Advantages - Highly efficient file format Benefiting from its highly efficient binary format, PAG files decode 10 times faster than JSON files and are about 50% smaller in file size for the same animations. Designers can also easily include beautiful animations with bitmaps or audiovisual media in a single file without needing additional attachments. - All AE features supported While other solutions may only support exporting limited vector-based AE features, PAG combines vector-based and raster-based exporting techniques to support all AE animations in a single file. This means third-party plugin effects in AE can also be exported. - Measurable performance PAG provides a monitoring panel in PAGViewer that displays normalized performance data for PAG files, making it easy for designers to review and optimize performance without needing developers. With numerous automatic optimization techniques from the PAGExporter plugin, you can create animations with impressive visual effects and excellent performance more efficiently. PAGViewer includes a monitoring panel - Runtime editable animations With the flexible editing APIs from the PAG SDK, developers can easily modify the layer structure of a single PAG file, combine multiple PAG files into one composition, or replace text and images with all pre-designed animation effects applied at runtime. This significantly reduces the coding work required for features like video templates. System Requirements - iOS 15.0+ - Android 5.0+ - HarmonyOS Next 5.0.0(12)+ - macOS 12.0+ - Windows 7.0+ - Chrome 69.0+ (Web) - Safari 15.0+ (Web) Getting Started We currently only publish precompiled libraries for iOS, Android, macOS, Web, and OpenHarmony. You can build libraries of other platforms from the source code. The latest releases can be downloaded from here. iOS Integration You can download the framework from the release page or add libpag to your project using CocoaPods. To add the pod to your Podfile, include: pod 'libpag' And then run: pod install After installing the CocoaPod, import libpag into your project with: import Android Integration You can download the AAR from the release page or add libpag to your project using Maven: Edit the build
Top issues
#23224.3.57版本概率出现释放卡死导致进程无响应14 comments · 2024-05-24#2274PAGImageView播放崩溃12 comments · 2024-04-29#2712Android 连续播放报错- ImageDecoderTask::onMakeResource() Failed to decode the image!11 comments · 2025-03-05#2374EXC_BAD_ACCESS libpag pag::PAGVideoDecoder::SetMaxHardwareDecoderCount(int) + 244876 (使用的是Firebase上报的crash)11 comments · 2024-07-16#2705libpag鸿蒙端调用PAGView的getProgress导致应用ANR crash10 comments · 2025-03-03#3780[iOS][4.5.98] HardwareDecoder 析构时 EXC_BAD_ACCESS,调用来自 VideoReader::destroyVideoDecoder9 comments · 2026-10-22#3621iOS 4.5.75崩溃9 comments · 2026-07-23#2668线上崩溃,影响较大8 comments · 2025-01-18
Discussions
#3772鸿蒙视频导出2 comments · 2026-10-20#3749pag 4.5.98 版本异常1 comments · 2026-09-24#3724Android端libpag库harfbuzz版本特殊字符替换ANR1 comments · 2026-09-10#3723鸿蒙使用libpag 最新版本"@tencent/libpag": "4.5.94", 崩溃闪退1 comments · 2026-09-09#3720🙏🏻关于接口上报(https://otheve.beacon.qq.com/analytics/v2_upload)的合规问题建议优化1 comments · 2026-09-08#3714您好,目前看到pag格式在官方顯示是開源的,請問後續會有開源轉收費的可能性嗎?1 comments · 2026-09-02#3705什么时候出AI版啊1 comments · 2026-08-27#3704Android端特定PAG文件在4.5.x版本播放抖动1 comments · 2026-08-26
Latest release
v4.5.102 v4.5.102 2026-11-08主要修改内容: (1)修复鸿蒙平台 PAGView 事件分发器在 release 后写入已释放内存导致的卡死 (3761) (2)更新 tgfx,合入 TaskPool 唤醒问题修复(鸿蒙) (3)修复 Android 与鸿蒙平台 PAGImageView 设置 ScaleMode 为 None 后未恢复合成原始尺寸的问题 (3757) (4)限制 ticker 驱动的异步刷新频率,并对解码失败的渲染增加冷却,避免循环播放时发热 (3793) (5)解码失败时保留最后一帧已解码画面,不再显示透明帧 (3753) (6)修复纹理替换图在图层缩小至低于 mipmap 阈值时渲染空白的问题 (3756) (7)修复 HarfBuzz 构建下 RTL 及双向混排文本导致的 ANR 与字形映射错误 (3752) (8)修复 pag 文件中引用环导致的栈溢出与死循环 (3747) (9)更新 tgfx,修复视频边缘闪烁与 render target 创建时的空指针解引用 Main modifications: (1) Fix OHOS main thread freezes caused by the PAGView event dispatcher writing to freed memory on release (3761) (2) Update tgfx to