# glb-mp4

> Based from @shopify/screenshot-glb and puppeteer-screen-recorder, a command line utility for screen recording a glTF 2.0 binary file rotating using Google's component and convert the output to GIF.

Latest version **0.0.6** (published 2023-02-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install glb-mp4
pnpm add glb-mp4
yarn add glb-mp4
bun add glb-mp4
```

Provides the command `glb-mp4`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2023-02-09 |
| First published | 2023-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 39.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Stephan Leroux |
| Maintainers | tomcodedthis |

## Links

- npm: https://www.npmjs.com/package/glb-mp4
- npm.io page: https://npm.io/package/glb-mp4

## Dependencies (3)

- [yargs](https://npm.io/package/yargs.md) ^17.6.2
- [puppeteer](https://npm.io/package/puppeteer.md) ^19.6.0
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.35

## Recent versions

- 0.0.6 (latest) — 2023-02-09
- 0.0.5 — 2023-02-09
- 0.0.4 — 2023-02-09
- 0.0.3 — 2023-01-31
- 0.0.2 — 2023-01-30
- 0.0.1 — 2023-01-30

## README

# 📸 glb-mp4

Easily screenrecord, screenshot and create an mp4 recording and PNG for glTF 2.0 Binary (GLB) files.

## Install

Use npm to install this tool:

`npm install glb-mp4`

## Usage

To start taking screenshots of GLB files

```sh
$ screenshot-glb
Options:
  --help         Show help                                              [boolean]
  --version      Show version number                                    [boolean]
  -i, --input    Input glTF 2.0 binary (GLB) filepath                  [required]
  -o, --output   Output MP4 screenshot filepath                        [required]
  -t, --timeout  Timeout length
  -w, --width    Output image width
  -h, --height   Output image height
  -c, --color    Change the background color of the rendered image
  -@, --model_viewer_version
                 Pass the version of Model Viewer which should be used .eg 1.9
  -m, --model_viewer_attributes
                 Pass <model-viewer> attributes as a URL search param string
  -q, --image_quality
                 Change the image quality of the rendered JPG default 0.92
```

## Dependencies

The module relies on using [puppeteer](https://www.npmjs.com/package/puppeteer) to spawn a headless instance of Chrome to render Google's [<model-viewer>](https://github.com/GoogleWebComponents/model-viewer) web component with the GLB model loaded.

## Development

- `yarn install`
- `yarn link`
- `screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT_IMAGE>`

## Examples

```
// Simply render a GLB to MP4
$ screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT>

// Change the width and height of the render
$ screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT> --width 600 --height 1200

// Change the exposure and environment-image
$ screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT> -m "environment-image=neutral&exposure=0.92"

// Use a specific version of Model Viewer to create the screenshot
$ screenshot-glb -i <PATH_TO_MODEL> -o <PATH_TO_OUTPUT> -@ 1.9
```

### Linux

You may need to install the following packages in order for the headless Chrome instance to work on headless Linux VM machines:

```
gconf-service
libasound2
libatk1.0-0
libatk-bridge2.0-0
libc6
libcairo2
libcups2
libdbus-1-3
libexpat1
libfontconfig1
libgcc1
libgconf-2-4
libgdk-pixbuf2.0-0
libglib2.0-0
libgtk-3-0
libnspr4
libpango-1.0-0
libpangocairo-1.0-0
libstdc++6
libx11-6
libx11-xcb1
libxcb1
libxcomposite1
libxcursor1
libxdamage1
libxext6
libxfixes3
libxi6
libxrandr2
libxrender1
libxss1
libxtst6
ca-certificates
fonts-liberation
libappindicator1
libnss3
lsb-release
xdg-utils
wget
```

---
_Source: https://npm.io/package/glb-mp4 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
