Reputation: 995
On a computer with Python 3 and Ubuntu 16.04, I'm trying to use the autosub (https://github.com/agermanidis/autosub)
I installed FFmpeg on Ubuntu (command example - http://www.codebind.com/linux-tutorials/install-ffmpeg-ubuntu-16-04/) and then pip install autosub
On the Terminal I went to a directory with this file: video1.wmv
It is a video in Brazilian Portuguese, that I want to obtain a file with the transcriptions of the lines
Please, is this command what I should type?
autosub -S pt -D pt video1.wmv
And then how to save in a .TXT file?
Detail: I typed the:
autosub -S pt -D pt video1.wmv
But this error appeared:
File "/home/reinaldo/Documentos/Code/ti/bin/autosub", line 136
print "The given file does not exist: {0}".format(filename)
^
SyntaxError: invalid syntax
Upvotes: 2
Views: 2323
Reputation: 21
pip install git+https://github.com/agermanidis/autosub.git
will install the latest version from github master which already handled this issue.
Upvotes: 2
Reputation: 15881
print "The given file does not exist: {0}".format(filename)
^ SyntaxError:invalid syntax
(1) "invalid syntax" because you gave wrong instruction. Try as:
print ( "The given file does not exist: {0}".format(filename) )
(2) Regarding "Please, is this command what I should type?":
Your autosub -S pt -D pt video1.wmv
has no API key for Google Translate.
The app says it makes "requests to Google Web Speech API
to generate transcriptions (subs)"
usage: autosub [-h] [-C CONCURRENCY] [-o OUTPUT] [-F FORMAT] [-S SRC_LANGUAGE]
[-D DST_LANGUAGE] [-K API_KEY] [--list-formats]
[--list-languages]
[source_path]
positional arguments:
source_path Path to the video or audio file to subtitle
optional arguments:
-h, --help show this help message and exit
-C CONCURRENCY, --concurrency CONCURRENCY
Number of concurrent API requests to make
-o OUTPUT, --output OUTPUT
Output path for subtitles (by default, subtitles are
saved in the same directory and name as the source
path)
-F FORMAT, --format FORMAT
Destination subtitle format
-S SRC_LANGUAGE, --src-language SRC_LANGUAGE
Language spoken in source file
-D DST_LANGUAGE, --dst-language DST_LANGUAGE
Desired language for the subtitles
-K API_KEY, --api-key API_KEY
The Google Translate API key to be used. (Required for
subtitle translation)
--list-formats List all available subtitle formats
--list-languages List all available source/destination languages
Upvotes: 1