Giter Site home page Giter Site logo

videomachine's Introduction

VideoMachine

Generate videos from simple XML playbooks.

<?xml version="1.0" encoding="utf-8"?>
<playbook class_name="CodingScene" w="1920" h="1080">
<scene>
	<code>
	#!/usr/bin/python3
	print('Hello World!')
	</code>
	<tts>
	This line prints "Hello World!" to console.
	</tts>
	<wait sec="0.5"/>
</scene>

This project uses moviepy module. This is a work in progress. Intended to be an extensible library/framework-like thing. Now only generates silly TTS coding tutorials. Example output: https://youtu.be/6MR3L0AecE8

Status

In Progress

Installation

git clone https://github.com/overengineer/VideoMachine.git
cd VideoMachine
pip3 install -r requirements.txt

Dependencies

You should have installed one of TTS tools below to generate TTS tracks.

  • flite
  • espeak-ng
  • gTTS

Alternatively, you can write TTS wrapper for other TTS engines/APIs. See extending.

Usage

python3 main.py path/to/playbook.xml

Playbook Syntax

playbooks consist of scenes. scenes contains actions (e.g. <code> tag for code snippets). tags may have attributes. This attributes override some default settings.

Playbook Attributes

class_name : it globally sets default class_name for scene instances. (e.g. CodingScene) w, h: width & height of the canvas

CodingScene class

This class is the build-in example sub-class of the Scene class. It can be used to render coding tutorials.

CodingScene: supported action tags & their attributes

  • code: Renders syntax highlighted code snippets using Pygments.
    • lang: Programming language. ("python", "java" etc.)
    • escape: Allow HTML escape sequences. (set "true" when <![CDATA used.)
  • tts: Generates text-to-speech. Self closing tags overrides default voice.
    • voice: Name of TTS class. Look voice/tts.py
    • lang: Language of the text.
    • ... : Each TTS class have their own special attributes.
  • wait: insert silence for the given seconds. (or default). This tag should be self closing.

Extending

Extend render.Scene class for new types of Scenes. New tag handler method names should match corresponding tag name.

New voice subclasses should inherit voice.tts.Voice class and should implement say(self, txt) method.

videomachine's People

Contributors

overengineer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.