Skip to content

Commit

Permalink
Merge branch 'dev' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
BingLingGroup committed Dec 30, 2019
2 parents db231d8 + dd5b3d5 commit e50e080
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 85 deletions.
33 changes: 25 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## TOC

- [[0.5.2-alpha] - 2019-11-05](#052-alpha---2019-11-05)
- [Unreleased](#unreleased)
- [0.5.3-alpha - 2019-12-30](#053-alpha---2019-12-30)
- [Changed](#changed053-alpha)
- [0.5.2-alpha - 2019-11-05](#052-alpha---2019-11-05)
- [Added](#added052-alpha)
- [Changed](#changed052-alpha)
- [[0.5.1-alpha] - 2019-08-02](#051-alpha---2019-08-02)
- [0.5.1-alpha - 2019-08-02](#051-alpha---2019-08-02)
- [Added](#added051-alpha)
- [Changed](#changed051-alpha)
- [[0.5.0-alpha] - 2019-07-27](#050-alpha---2019-07-27)
- [0.5.0-alpha - 2019-07-27](#050-alpha---2019-07-27)
- [Added](#added050-alpha)
- [Changed](#changed050-alpha)
- [[0.4.1-alpha] - 2019-07-11](#041-alpha---2019-07-11)
- [0.4.1-alpha - 2019-07-11](#041-alpha---2019-07-11)
- [Added](#added041-alpha)
- [Changed](#changed041-alpha)
- [[0.4.0-alpha] - 2019-02-17](#040-alpha---2019-02-17)
- [0.4.0-alpha - 2019-02-17](#040-alpha---2019-02-17)
- [Changed](#changed040-alpha)

Click up arrow to go back to TOC.

### [Unreleased]

### [0.5.3-alpha] - 2019-12-30

#### Changed(0.5.3-alpha)

- Fix excessive transcoding time issue. [pull request #66](https://github.com/BingLingGroup/autosub/pull/66)
- Fix Auditok option issues. [issue #70](https://github.com/BingLingGroup/autosub/issues/70)
- Fix output option issue. [issue #73](https://github.com/BingLingGroup/autosub/issues/73)

### [0.5.2-alpha] - 2019-11-05

### Added(0.5.2-alpha)
#### Added(0.5.2-alpha)

- Add issue templates.

### Changed(0.5.2-alpha)
#### Changed(0.5.2-alpha)

- Fix last row of empty translation text missing issue. [issue #62](https://github.com/BingLingGroup/autosub/issues/62)
- Fix executable file detection problem in the current directory.

<escape><a href = "#TOC">&nbsp;&nbsp;</a></escape>

### [0.5.1-alpha] - 2019-08-02

#### Added(0.5.1-alpha)
Expand Down Expand Up @@ -141,7 +156,9 @@ Click up arrow to go back to TOC.

<escape><a href = "#TOC">&nbsp;&nbsp;</a></escape>

[Unreleased]: https://github.com/BingLingGroup/autosub/compare/0.5.1-alpha...HEAD
[Unreleased]: https://github.com/BingLingGroup/autosub/compare/0.5.3-alpha...HEAD
[0.5.3-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.2-alpha...0.5.3-alpha
[0.5.2-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.1-alpha...0.5.2-alpha
[0.5.1-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.0-alpha...0.5.1-alpha
[0.5.0-alpha]: https://github.com/BingLingGroup/autosub/compare/0.4.1-alpha...0.5.0-alpha
[0.4.1-alpha]: https://github.com/BingLingGroup/autosub/compare/0.4.0-alpha...0.4.1-alpha
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Autosub

<escape><a href="https://travis-ci.org/BingLingGroup/autosub"><img src="https://travis-ci.org/BingLingGroup/autosub.svg?branch=alpha"></img></a> <a href="https://app.fossa.io/projects/git%2Bgithub.com%2FBingLingGroup%2Fautosub"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2FBingLingGroup%2Fautosub.svg?type=shield"></img></a> <a href="https://t.me/autosubs"><img src="https://img.shields.io/badge/Channel-Telegram-blue"></img></a></escape>
<escape><a href="https://travis-ci.org/BingLingGroup/autosub"><img src="https://travis-ci.org/BingLingGroup/autosub.svg?branch=alpha"></img></a> <a href="https://app.fossa.io/projects/git%2Bgithub.com%2FBingLingGroup%2Fautosub"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2FBingLingGroup%2Fautosub.svg?type=shield"></img></a></escape>

[简体中文](docs/README.zh-Hans.md)

Expand Down Expand Up @@ -713,11 +713,20 @@ Bugs and suggestions can be reported at [issues](https://github.com/BingLingGrou

I only write the scripts for building standalone executable files on windows, [Nuitka script](scripts/nuitka_build.bat) and [pyinstaller script](scripts/pyinstaller_build.bat).

Nuitka build is pretty tricky. I use anaconda as the package manager because [Nuitka readme](https://github.com/Nuitka/Nuitka#id6) recommends using it. I use anaconda Python3.5 and [m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) to build. [m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) perhaps is the stablest 64bit C compiler on this specific case. Other C compiler or Python environment may fail to compile due to unknown reasons. And for those whose os language is not `en_US`, please set it to `en_US` and then start to build. Otherwise you will encounter this [known issue](https://github.com/Nuitka/Nuitka/issues/193).
Nuitka build is pretty tricky. These two environments I tried and worked.

1. Anaconda recommended by [Nuitka readme](https://github.com/Nuitka/Nuitka#id6).
- Python version 3.5
- mingw-w64 package [m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) (No need to set the environment variables separately if you run it on Anaconda Prompt)
2. Use other C Compiler rather than the [m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) by setting the value of environment variable `CC` which is the path to the C Compiler, including the executable name. For example, you install [MingW-W64-builds](http://mingw-w64.org/doku.php/download/mingw-builds) somewhere on your storage and you want Nuitka to use it. In this case, Python 3.5 is still recommended.

And for those whose os language is not `en_US`, please set it to `en_US` and then start to build. Otherwise you may encounter this [known issue](https://github.com/Nuitka/Nuitka/issues/193).

Pyinstaller build is more robust. No issues encountered when the spec file is written in the proper way.

[create_release.py](scripts/create_release.py) is used to make the two release packages. You need to create a `binaries` folder containing ffmpeg and ffmpeg-normalize executable files if you want to create a "fully" standalone release like the one I release. `ffmpeg.exe` and `ffprobe.exe` are from [Zeranoe ffmpeg windows build](https://ffmpeg.zeranoe.com/builds/). It should have the directory structure like this below.
[create_release.py](scripts/create_release.py) is used to make the two release packages. You need to create a `binaries` folder containing ffmpeg and ffmpeg-normalize executable files if you want to create a "fully" standalone release like the one I release. `ffmpeg.exe` and `ffprobe.exe` are from [Zeranoe ffmpeg windows build](https://ffmpeg.zeranoe.com/builds/). `ffmpeg-normalize.exe` built in the same way as I mentioned [above](#install-on-windows).

It should have the directory structure like this below.

```
binaries\ffmpeg.exe
Expand Down
11 changes: 6 additions & 5 deletions autosub/cmdline_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ def validate_io( # pylint: disable=too-many-branches, too-many-statements
# get format from default
args.format = constants.DEFAULT_SUBTITLES_FORMAT
else:
output_name = os.path.splitext(args.output)
if not args.format:
# get format from output
args.format = input_ext.strip('.')
args.format = output_name[-1].strip('.')
# format = output name extension without dot
args.output = input_path
args.output = output_name[0]
# output = output name without extension

if args.format not in constants.OUTPUT_FORMAT:
Expand Down Expand Up @@ -831,9 +832,9 @@ def audio_or_video_prcs( # pylint: disable=too-many-branches, too-many-statemen
regions = core.auditok_gen_speech_regions(
audio_wav=audio_wav,
energy_threshold=args.energy_threshold,
min_region_size=constants.MIN_REGION_SIZE,
max_region_size=constants.MAX_REGION_SIZE,
max_continuous_silence=constants.DEFAULT_CONTINUOUS_SILENCE,
min_region_size=args.min_region_size,
max_region_size=args.max_region_size,
max_continuous_silence=args.max_continuous_silence,
mode=mode
)
os.remove(audio_wav)
Expand Down
3 changes: 2 additions & 1 deletion autosub/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
"ffmpeg-normalize -v \"{in_}\" -ar 44100 -ofmt flac -c:a flac -pr -p -o \"{out_}\""
]

DEFAULT_AUDIO_CVT = "ffmpeg -hide_banner -y -i \"{in_}\" -ac {channel} -ar {sample_rate} \"{out_}\""
DEFAULT_AUDIO_CVT = \
"ffmpeg -hide_banner -y -i \"{in_}\" -vn -ac {channel} -ar {sample_rate} \"{out_}\""

DEFAULT_AUDIO_SPLT = \
"ffmpeg -ss {start} -t {dura} -y -i \"{in_}\" -c copy -loglevel error \"{out_}\""
Expand Down
Binary file modified autosub/data/locale/zh_CN/LC_MESSAGES/autosub.cmdline_utils.mo
Binary file not shown.
Loading

0 comments on commit e50e080

Please sign in to comment.