Skip to content

Commit

Permalink
added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Szymaniak committed Jan 5, 2019
1 parent 398e2b8 commit 0cda10a
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -3,3 +3,5 @@ This is an automatic movie subtitle synchronization tool.
Synchronization is done by listening to the audio track, translating it if necessary.

For more information see [https://sc0ty.github.io/subsync](https://sc0ty.github.io/subsync)

[Documentation](doc/index.md)
12 changes: 12 additions & 0 deletions doc/architecture.md
@@ -0,0 +1,12 @@
# SubSync architecture overview
SubSync is composed of two main modules:
- main module written in Python;
- _gizmo_ written in C++ and compiled to Python binary module.

Main module is responsible for displaying GUI, asset downloading and installation and contains business logic, whereas gizmo is doing heavy lifting such as speech recognition, audio and subtitle extraction and synchronization.

## Main module
Written in Python (3.5 or never).

## Gizmo
Written in C++11 with [pybind11](https://github.com/pybind/pybind11), compiled as Python binary module. Uses [ffmpeg](https://ffmpeg.org) libraries for media extraction and [pocketsphinx](https://cmusphinx.github.io) for speech recognition.
6 changes: 6 additions & 0 deletions doc/index.md
@@ -0,0 +1,6 @@
# Documentation
See also [https://sc0ty.github.io/subsync](https://sc0ty.github.io/subsync).

## Topics
1. [Architecture overview](architecture.md)
2. [Compilation](install.md)
70 changes: 70 additions & 0 deletions doc/install.md
@@ -0,0 +1,70 @@
# SubSync installation
You could download release builds from [download page](https://sc0ty.github.io/subsync/en/download.html).

Building SubSync is two step process. First you need to build _gizmo_ module (in folder `gizmo`), then you could build (or run under interpreter) SubSync itself.
There are several ways to build and run SubSync, it is due to significant differences in supported platforms.

## Prerequisites
For _gizmo_ module:
- C++11 compatible compiler (or better C++14);
- pybind11;
- ffmpeg libraries (4.0 or newer);
- sphinxbase and pocketsphinx.

For main module:
- Python interpreter (supporting Python 3.5 or newer);
- Python modules listed in `requirements.txt` file;
- compiled _gizmo_ module.

## POSIX platforms
For POSIX compatibile platforms (e.g. Linux), standard Python `setup.py` scripts are provided.

It is advised to build under Python virtualenv. To do that, go to project main directory and type:
```
pip install virtualenv
virtualenv venv
```
You could also specify different version of Python interpreter, for details see [the docs](https://docs.python-guide.org/dev/virtualenvs/#lower-level-virtualenv).

Then activate your virtualenv and install required packages:
```
source venv/bin/activate
pip install -r requirements.txt
```

If you have ffmpeg, sphinxbase and pocketsphinx libraries installed and avaiable via `pkg-config`, you could now build _gizmo_:
```
cd gizmo
python setup.py build
```

If you don't want to use `pkg-config` (or you can't), you must provide paths to these libraries manually using following options:
```
--ffmpeg-dir=PATH
--sphinxbase-dir=PATH
--pocketsphinx-dir=PATH
--use-pkg-config=yes|no
```
Or env variables:
```
FFMPEG_DIR=PATH
SPHINXBASE_DIR=PATH
POCKETSPHINX_DIR=PATH
USE_PKG_CONFIG=yes|no
```

And then install it under virtualenv, e.g.:
```
export FFMPEG_DIR=~/projects/ffmpeg
export SPHINXBASE_DIR=~/projects/sphinxbase
export POCKETSPHINX_DIR=~/projects/pocketsphinx
export USE_PKG_CONFIG=no
python setup.py build
python setup.py install
```

Now you could run SubSync from your virtualenv
```
python subsync.py
```

0 comments on commit 0cda10a

Please sign in to comment.