Documentation of the core library of GPAC
JavaScript APIs

JavaScript API available in GPAC. More...

+ Collaboration diagram for JavaScript APIs:


 JS Core API for libgpac
 JavaScript API for libgpac core tools.
 JS Filter API
 JavaScript API for filters.
 XMLHttpRequest API
 XMLHttpRequest API.
 Embedded Vector Graphics JavaScript API.
 Compositor API
 GPAC Compositor and Scene API.
 Storage API
 Storage API.
 JS FilterSession API
 JavaScript API for FilterSession.
 JS DASH Adaptation API
 JavaScript API for DASH client adaptation algorithm.
 JS HTTP output API
 JavaScript API for httpout filter.

Detailed Description

Parts of the GPAC code can be modified at run-time using JavaScript. This part of the documentation describes the various APIs used in GPAC.

For SVG and DOM scenegraph API, see

For BIFS and VRML scenegraph, see

SVG and BIFS APIs are automatically loaded when loading an SVG or BIFS scene with script nodes. They cannot be loaded in another way.

The JSFilter API is loaded through a dedicated filter, see gpac -h jsf.

All other APIs shall be loaded by the parent script (scene or JSFilter) as ECMAScript modules using the import directive.

GPAC uses the amazing QuickJS engine for JavaScript support: Although not JIT-enabled, it is small, fast and cross-platform which ensures the same behaviour on all devices.

The module loader is the same as the QuickJS libc module loader (, except that it checks for .so, .dll or .dylib extensions for C modules.

This means that JS C modules as defined in QuickJS could also be used (

support for C modules is still not fully tested

There is currently no support for non-local modules (http, https ...).

The default GPAC compilation includes the following modules from QuickJS:

GPAC constants used in the API (error code, property types, specific flags for functions) are exported:

Unless indicated otherwise, all errors are handled through exceptions. An exception object contains a code (integer) attribute and optionally a message (string) attribute.

Types and interfaces are described using WebIDL, see, with some slight modifications.

These IDL files are only intended to document the APIs, and are likely useless for other purposes.

Notes on QuickJS 'os' module support: