player README

README проекта с github.com/livliv-dev/player. Одним файлом markdown: README.md.

LivLiv Player

A lightweight 2.5D character player for the web, with lip sync and webcam face tracking. A few lines of code put a character in a page, a stream overlay or an app.
Comes with 25 featured characters in different styles, ready to use.

English · 中文 · 日本語 · Tiếng Việt

Featured characters breathing, blinking, turning their heads and talking

Try it

Project LivLiv

We want the art of creating characters to belong to everyone.

We're open-sourcing our AI tools for character creation, the player and its playback protocol, and a stage where your characters can meet an audience.

Come say hello on Discord and follow us on X (Twitter).

Use it in your page

npm install @livliv-dev/player
import { Player } from '@livliv-dev/player'

const player = new Player(document.querySelector('canvas'))
await player.load('characters/k01/')   // a folder with model.json and textures/, or a .livliv file

player.setExpression('smile')          // ids are in player.expressions
player.act('nod')
player.params.mouthOpen = 0.6          // 0..1

Lip sync and face tracking:

import { createSpeech } from '@livliv-dev/player/voice'
import { startFaceTracking } from '@livliv-dev/player/tracking'   // needs @mediapipe/tasks-vision

const speech = createSpeech(player)
button.onclick = () => { speech.unlock(); speech.say('/reply.mp3') }

await startFaceTracking(player)

A VRM or a PNGTuber, on the same API:

import { BodyPlayer } from '@livliv-dev/player/body'
import { VrmBody } from '@livliv-dev/player/vrm'    // needs three and @pixiv/three-vrm
import { PngBody } from '@livliv-dev/player/png'

const vrm = new BodyPlayer(canvasA, new VrmBody())
await vrm.load('/avatars/me.vrm')
const png = new BodyPlayer(canvasB, new PngBody())
await png.load({ closed: 'me-closed.png', open: 'me-open.png' })

The whole API is in API.md: options, params, expressions and actions, drivers, recorded poses and attachment points, VRM and PNGTuber characters, the limits on untrusted files, the model package and the format version. The LivLiv package format (.livliv, model.json v4) is in FORMAT.md, with a JSON Schema in schema/; packages exported before v4 are described in FORMAT-v3.md and still play.

The npm package is the player alone. The featured characters are in this repository's characters/: copy the ones you use next to your page, with their licence.

characters/ holds 25 characters, ready to load(). Most were made by LivLiv: use them free with credit ("Characters: LivLiv (livliv.ai)"), commercially too if you are an individual. Don't sell them or merchandise made from them, and don't train AI models on them. They are not covered by the Apache License; the terms are in characters/LICENSE.md. Kujira, Kujira Q and Pen come from other people's work, with their own terms in characters/CREDITS.md.

New in 0.5.0: full-body characters. Drawn head to feet, they stand on the ground: they sway, crouch and dip while their feet stay put. Four featured characters are full-body: Tsubaki, Neve, Juno and Viola (f05–f08). Pick the shot with player.view.fit: 'frame' (default), 'knee' or 'whole'; see Full-body characters in API.md.

Each character has a cover.webp, its first frame: player.load(source, { poster }) shows it until the character is ready, and example/loading.js shows it before any script has run.

Each character is also one file to download, <id>.livliv, at https://livliv-dev.github.io/player/characters/<id>.livliv (the names below link to them). They are served with CORS, so a page on another site can load() one straight from there, and index.json lists them all.

id name id name id name
k01 Sena d01 Yui v01 Aster
k02 Elio d02 Leo v03 Mira
char06 Aoi d03 Nana v04 Kai
char07 Sora d03ft Nana (refined) v05 Lilith
s01 Hana p01 Kujira v06 Usa
q02 Mochi p02 Kujira Q v07 Stella
q03 Kotaro p03 Pen w01 Max
f05 Tsubaki (full-body) f06 Neve (full-body) f07 Juno (full-body)
f08 Viola (full-body)

Characters of your own

You can bring in a PNGTuber's pictures, or a VRM (drawn with three.js); or make a character of your own from one picture on livliv.ai.

About the player and the characters

LivLiv Player and the .livliv format are LivLiv's own work. They use no Live2D software or Cubism SDK and do not read .moc3 or .cmo3 files. "Live2D" is a trademark of Live2D Inc.; LivLiv is not affiliated with it.

Making a character on livliv.ai uses AI. The player itself only plays: it calls no AI service and reads only the files you point it at. Face tracking runs Google's MediaPipe in the browser, and camera images stay on the device; API.md has the networking details.

The featured characters in this repository were made on LivLiv too, also with AI; Kujira, Kujira Q and Pen adapt other people's characters (credits). Refined Nana (d03ft) also has swinging parts and head-turn keyforms added with LivLiv's own tools.

A package's meta.author and meta.license record who made it and on what terms: keep them and follow them. When you show a character made with LivLiv in public, say that AI was used to make it, and don't present it as hand-drawn or hand-rigged.

Embed without code

<iframe src="https://livliv.ai/live/k01" width="480" height="640" allow="camera; microphone"
  style="border:0;background:transparent"></iframe>

The same /live/<id> page has a transparent background and works as an OBS Browser Source.
(Powered by https://livliv.ai)

Develop

git clone https://github.com/livliv-dev/player
cd player
npm install
npm run check          # types
npm run build          # dist/: index.js, tracking.js, voice.js, body.js, png.js, vrm.js (ES modules), chunks/ and types/
npm test               # unit and fuzz tests (Node 22.18 or newer, no browser)
npm run test:browser   # every featured character drawn in headless Chromium; once: npx playwright-core install chromium-headless-shell
npm run test:engines   # a sample on Firefox and WebKit, where WebGL2 starts (a GPU or a software GL); once: npx playwright-core install firefox webkit

src/runtime/ is the renderer and motion code livliv.ai runs; this repository is published from it. See CONTRIBUTING.md. Security reports: SECURITY.md.

Browser support

WebGL2 and ES2023: Chrome / Edge 97+, Firefox 104+, Safari 15.4+. Tested on current desktop browsers, not yet on phones.

License

The code is under the Apache License 2.0 (see also NOTICE). The featured characters have their own licence, characters/LICENSE.md. You may keep the LivLiv name and logo in your own versions, as long as they don't claim to be the official one.

Thanks

Thanks to 上善无形, ZipZipPipe and 贱兔死顺盖, whose characters Kujira, Kujira Q and Pen are based on: see characters/CREDITS.md.

player (livliv-dev/player)

Ищем в базе…

1.6K ·GitHub
Что это такое?Лёгкий 2.5D-плеер анимированных персонажей для веба. Он выводит персонажа на страницу, в оверлей стрима или приложение, с синхронизацией губ и отслеживанием лица через веб-камеру.
Это библиотека, которую я добавляю на свой сайт, или готовое приложение?Это библиотека: npm-пакет только с плеером, который вы вызываете из своей страницы. Также есть готовая страница /live/, которую можно встроить без написания кода.
Как это запустить?Клонируйте репозиторий, выполните 'npm install && npm run build', откройте папку через любой статический сервер и перейдите на /example/demo.html, чтобы попробовать выражения, действия, микрофон и камеру.
Нужно ли что-то особенное?Нужен только браузер с поддержкой WebGL2 и ES2023 (Chrome/Edge 97+, Firefox 104+, Safari 15.4+). Ядро не имеет зависимостей и весит около 30 КБ в сжатом виде gzip; MediaPipe для отслеживания лица загружается только тогда, когда он нужен.
Есть какие-нибудь подводные камни?Работа проверена только в актуальных настольных браузерах, на телефонах пока не тестировалась. Кроме того, у готовых персонажей собственная лицензия, отдельная от Apache 2.0, поэтому продавать их или использовать в коммерческих целях нельзя.
Отправляет ли это мою камеру или голос куда-нибудь?Нет. Плеер не обращается ни к каким ИИ-сервисам и читает только те файлы, которые вы ему указали. Отслеживание лица работает через MediaPipe от Google прямо в браузере, а изображения с камеры остаются на устройстве.
В чём разница между персонажами LivLiv, VRM и PNGTuber?Все три работают через один и тот же API. PNGTuber требует две картинки (рот закрыт и открыт), VRM создаётся в VRoid Studio или любом инструменте, экспортирующем VRM 0.x или 1.0, а модель LivLiv создаётся из одной картинки на livliv.ai.
Поддерживаются ли персонажи в полный рост?Да. Персонажи в полный рост рисуются от головы до ступней и стоят на земле, покачиваясь и приседая, при этом ступни остаются на месте. Ракурс выбирается через view.fit; четыре готовых персонажа (f05–f08) выполнены в полный рост.
Зачем авторы открыли исходный код?Они хотят, чтобы искусство создания персонажей принадлежало всем, поэтому опубликовали свои инструменты для создания персонажей с ИИ, плеер и его протокол воспроизведения, а также сцену, где персонажи могут встретиться с аудиторией.
Использовался ли ИИ для создания персонажей?Да. Готовые персонажи и персонажи, созданные на livliv.ai, сделаны с помощью ИИ, поэтому в README просят об этом сообщать и не выдавать их за нарисованных или выстроенных вручную.
Какие есть похожие проекты?mesh-avatar-studio, toyxyz_RGBMocap, PuppetLoom, natural-disasters, aora-bot, airi, Charakuru, Babylon.js
Автор
livliv-dev
Размер
26 MB
Звёзды
1.6K
Возраст
14 д
Коммиты · 90 дней