Giter Site home page Giter Site logo

latex-to-video's Introduction

latex-to-video

Installation

System requirements:

  • sox
  • ffmpeg
  • 'convert' from imagemagick
  • conda, not mandatory

Download the weights:

$ wget https://github.com/kidanger/latex-to-video/releases/download/v1/data.tar.gz
$ tar xvf data.tar.gz

Tested from a fresh conda with python 3.7:

$ conda create -n tts2 python=3.7
$ conda activate tts2
$ git clone https://github.com/mozilla/TTS
$ cd TTS
$ git checkout b1935c97
$ pip install -r requirements.txt
$ python setup.py install
$ cd ..
$ pip install inflect fire mutagen iio ffmpeg-python

Try the TTS:

$ python tts.py 'bla bla bla' out.wav
$ play out.wav

Try the demo:

$ cd demo
$ latexmk -pdf main.tex
$ python ../process.py main.tex main.pdf main.mp4
$ vlc main.mp4

Installation (docker)

Build the docker image locally:

$ docker build . --tag latex-to-video

Try the demo: (recommended)

$ cd demo
$ latexmk -pdf main.tex
$ docker run --rm -u (id -u) -v (pwd):/data latex-to-video main.tex main.pdf main.mp4
$ vlc main.mp4

Usage

Try on your slides:

$ cd somewhere
$ latexmk main.tex -pdf
$ conda activate tts2
# remove --fast for the final build
$ python /path/to/latex-to-video/process.py main.tex main.pdf main.mp4 --fast
$ vlc main.mp4
syntax:
    %>next        -> go to next slide
    %>pause       -> 500ms pause
    %>shortpause  -> 100ms pause
    %> <text to be speeched>

Warning: do not use sentence that would be too long or the TTS might fail. It works on a line per line basis, so put each sentence in its own line.

Credits

TTS engine by Mozilla

Code and weights of the tts taken from colab

PDF to mp4 conversion by Charles Hessel

latex-to-video's People

Contributors

kidanger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mnhrdt

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.