Code Monkey home page Code Monkey logo

lip-sync's Introduction

Lip Sync

Simple CLI tool to lip sync based on an audio file.

Dependencies

You will need to have ffmpeg and rhubarb installed to be able to generate the lip sync.

The tool will use rhubarb to generate the phonemes from the audio file, then it will use your defined mapping of mouth positions for each phoneme to render a video file with ffmpeg. The video will contain the audio and it also allows you to choose a background image (optional). Another optional feature is to add blinking using a blink mapping. For example you should have the mouth positions as PNG files with alpha background, and/or blink position, then you should have your character as a background image.

Quickstart

For the minimal usage (just the lips)

poetry run lip-sync -- --lipsync sync.csv --audio narration.wav --output output.mkv

For the full experience

poetry run lip-sync -- --lipsync sync.csv --blink blink.csv --background bg.png --audio narration.wav --output output.mkv

You need to provide the mapping as a csv file. The mapping will contain the alphabetical order of the phonemes. For example

A,mouth-mbp.png
B,mouth-sczdntgj.png
C,mouth-kgh.png
...

You can check https://github.com/DanielSWolf/rhubarb-lip-sync for more information.

The blink positions are similar. You need to define the following positions:

  • A (open)
  • B (half)
  • C (closed)

You can also set the background, which should be your character (to put the mouth and blinks on).

The audio file can be in any format. The tool will use ffmpeg to convert it to wav if it is not wav or ogg. See rhubarb for more information on audio format.

Finally you have to set the output file, the video that will be generated.

lip-sync's People

Contributors

alexjercan avatar

Stargazers

 avatar

Watchers

 avatar

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.