Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install AutoSub Step to Step in Windows with Translate subtitle #31

Open
JeanDown123 opened this issue Aug 8, 2016 · 122 comments
Open

Install AutoSub Step to Step in Windows with Translate subtitle #31

JeanDown123 opened this issue Aug 8, 2016 · 122 comments

Comments

@JeanDown123
Copy link
Contributor

JeanDown123 commented Aug 8, 2016

Requeriments
Windows 32 or 64 bits.
Connection Internet.
Links Downloads
Python
FFMPEG
AutoInstall autosub_app 0.3.12.zip
SampleVideos Spanish - English.zip
Subtitle Editor Aegisub
For Version autosub 0.3.9
Note: Uninstall Python 3.x
Tutorial Video Youtube

  1. Install Python 2.7 (32 bits)
    https://www.python.org/ftp/python/2.7.12/python-2.7.12.msi
    python
    ## Note: Check Add Python.exe to Path

  2. Run cmd (Win+R)
    C:\Python27\Scripts\pip.exe install autosub
    Or
    C:\Python27\Scripts\pip.exe install https://pypi.python.org/packages/35/7b/9d5361c0f7abfcc6d826a5279b1c4501f7616505629f6c54857587ec6e37/autosub-0.3.9.tar.gz
    or
    (Download Last version autosub https://pypi.python.org/pypi/autosub)
    C:\Python27\Scripts\pip.exe install "c:\youdownloaded\autosub-0.3.9.tar.gz"

    Message Output Normal

    Installing collected packages: autosub
    Successfully installed autosub-0.3.9
    
    
  3. Change Name File "autosub" to "autosub_app.py"
    Rename C:\Python27\Scripts\autosub autosub_app.py

  4. Modify with notepad.exe or Notepad++(Edit Text) autosub_app.py
    4.1 In line 48 add ", delete=False"
    temp = tempfile.NamedTemporaryFile(suffix='.flac')
    by
    temp = tempfile.NamedTemporaryFile(suffix='.flac', delete=False)
    4.2 Eliminate line 53 os.system('stty sane'). (Optional)
    UPDATE For last Version Autosub (23 May 2017)
    In Windows xp,7,8,10
    With Program Notepad change lines :
    Line 127 change
    exe_file = os.path.join(path, program)
    exe_file = os.path.join(path, program + ".exe")
    Line 47 change
    temp = tempfile.NamedTemporaryFile(suffix='.flac')
    temp = tempfile.NamedTemporaryFile(suffix='.flac', delete=False)

  5. Download(https://ffmpeg.zeranoe.com/builds/) and
    Copy ffmpeg.exe to C:\Python27\

  6. Restart Windows

  7. Test Script C:\Python27\python.exe C:\Python27\scripts\autosub_app.py --list-languages

SampleVideos Spanish - English.zip
autosub_app 0.3.12.zip

Auto-generating subtitles for any video file

Spanish
C:\Python27\python.exe C:\Python27\scripts\autosub_app.py -S es -D es TuVideo.mp4
English
C:\Python27\python.exe C:\Python27\scripts\autosub_app.py -S en -D en YouVideo.mp4
Japanese
C:\Python27\python.exe C:\Python27\scripts\autosub_app.py -S ja -D ja YouAnimeVideo.mp4
cmd

Optional
Compile script Python(Exe Executable)
C:\Python27\python.exe -m compileall C:\Python27\scripts\autosub_app.py
Run
C:\Python27\scripts\autosub_app.pyc YouVideo.mp4 (English Default)
Upgrade Pip
python -m pip install --upgrade pip

One-Click EASY with SENDTO.

autosub_app.zip
Create batch by language (JA) AutoSub_Jap.bat and copy to directory SendTo
"shell:sendto"
"%APPDATA%\Microsoft\Windows\SendTo"
AutoSub_Jap.bat
C:\Python27\python.exe C:\Python27\Scripts\autosub_app.py -C 2 -S ja -D ja %1
sendto
sendto

http://www.howtogeek.com/howto/windows-vista/customize-the-windows-vista-send-to-menu/
7.- Translate your Subtitles
Download Subtitle Edit https://github.com/SubtitleEdit/subtitleedit/releases
SubtitleEdit-3.4.13-Setup.zip Or VersionPortable SE3413PL.zip

  • Run SubtitleEdit.exe
  • Open Subtitle (TuVideo.srt,YouAnimeVideo.srt,YouVideo)
  • Menu-Auto-Translate-(PowerbyGoogle)
  • From(Japanese) To:English
  • Translate
    SUBTITLEEdit

Or

https://sourceforge.net/projects/srt-tran/
SRTTRANSLATOR

Results:

Link Video Youtube Test

Comparison

Auto-Generated by Youtube
President Obama Addresses the Nation on the BP Oil Spill (inglés).Youtube.srt.txt
Generated by Script AutoSub
President Obama Addresses the Nation on the BP Oil Spill (inglés).AutoSub.srt.txt
Time Process: 01:15 Abot Minute
Times are best generated by AUTOSUB.

Errors Commons in Windows

-Error install pip
"python setup.py egg_info"
Solution
Install Python 2.7 uninstall 3.x

"WindowsError [Error 2]"

C:\Python27>python.exe C:\Python27\scripts\autosub_app.py -S en -D en test.mp4
Traceback (most recent call last):
  File "C:\Python27\scripts\autosub_app.py", line 284, in <module>
    sys.exit(main())
  File "C:\Python27\scripts\autosub_app.py", line 210, in main
    audio_filename, audio_rate = extract_audio(args.source_path)
  File "C:\Python27\scripts\autosub_app.py", line 120, in extract_audio
    subprocess.check_output(command)
  File "C:\Python27\lib\subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "C:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2]

Solution.
Copy ffmpeg.exe to C:\Python27\
or
Or ADD Path (Directory) File ffmpeg.
Examples: c:\ffmpeg\ , c:\Program Files\ffmpeg, c:\Mydownloads
Link Help Add Path(Directory)
http://www.computerhope.com/issues/ch000549.htm
python

Error infinite loop

"File "C:\Python27\lib\multiprocessing\forking.py", line 380"
"File "C:\Python27\lib\multiprocessing\forking.py", line 503"
ImportError : prepare(preparation_data)

Solution
Change name script C:\Python27\Scripts\autosub autosub_app.py

Error Permission denied Files Flac
c:...local\temp\tmpksjd.flac Permission denied
Solution:
Modify Script, close file. Link
#15

----------------------Before - Original-------------------------

class FLACConverter(object):
    def __init__(self, source_path, include_before=0.25, include_after=0.25):
        self.source_path = source_path
        self.include_before = include_before
        self.include_after = include_after

    def __call__(self, region):
        try:
            start, end = region
            start = max(0, start - self.include_before)
            end += self.include_after
            temp = tempfile.NamedTemporaryFile(suffix='.flac')
            command = ["ffmpeg", "-y", "-i", self.source_path,
                       "-ss", str(start), "-t", str(end - start),
                       "-loglevel", "error", temp.name]
            subprocess.check_output(command)
            os.system('stty sane')
            return temp.read()

----------------------After - Modified Option 1 ------------------------

class FLACConverter(object):
    def __init__(self, source_path, include_before=0.25, include_after=0.25):
        self.source_path = source_path
        self.include_before = include_before
        self.include_after = include_after

    def __call__(self, region):
        try:
            start, end = region
            start = max(0, start - self.include_before)
            end += self.include_after
            temp = tempfile.NamedTemporaryFile(suffix='.flac')      
            temp.close()
            command = ["ffmpeg", "-y", "-i", self.source_path,
                       "-ss", str(start), "-t", str(end - start),
                       "-loglevel", "error", temp.name]
            subprocess.check_output(command)
            return open(temp.name, "rb").read()

----------------------after - Modified Option 2 ------------------------

class FLACConverter(object):
    def __init__(self, source_path, include_before=0.25, include_after=0.25):
        self.source_path = source_path
        self.include_before = include_before
        self.include_after = include_after

    def __call__(self, region):
        try:
            start, end = region
            start = max(0, start - self.include_before)
            end += self.include_after
            temp = tempfile.NamedTemporaryFile(suffix='.flac', delete=False)
            command = ["ffmpeg", "-y", "-i", self.source_path,
                       "-ss", str(start), "-t", str(end - start),
                       "-loglevel", "error", temp.name]
            subprocess.check_output(command)
            return temp.read()

        except KeyboardInterrupt:
            return

Message Normal Output Pip install autosub

Collecting autosub
  Downloading autosub-0.3.9.tar.gz
Collecting google-api-python-client>=1.4.2 (from autosub)
  Downloading google_api_python_client-1.5.1-py2.py3-none-any.whl (50kB)
Collecting requests>=2.3.0 (from autosub)
  Downloading requests-2.11.0-py2.py3-none-any.whl (514kB)
Collecting pysrt>=1.0.1 (from autosub)
  Downloading pysrt-1.1.1.tar.gz (104kB)
Collecting progressbar>=2.3 (from autosub)
  Downloading progressbar-2.3.tar.gz
Collecting six<2,>=1.6.1 (from google-api-python-client>=1.4.2->autosub)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting uritemplate<1,>=0.6 (from google-api-python-client>=1.4.2->autosub)
  Downloading uritemplate-0.6.tar.gz
Collecting httplib2<1,>=0.8 (from google-api-python-client>=1.4.2->autosub)
  Downloading httplib2-0.9.2.zip (210kB)
Collecting oauth2client (from google-api-python-client>=1.4.2->autosub)
  Downloading oauth2client-3.0.0.tar.gz (77kB)
Collecting chardet (from pysrt>=1.0.1->autosub)
  Downloading chardet-2.3.0.tar.gz (164kB)
Collecting simplejson>=2.5.0 (from uritemplate<1,>=0.6->google-api-python-client>=1.4.2->autosub)
  Downloading simplejson-3.8.2-cp27-cp27m-win32.whl (65kB)
Collecting pyasn1>=0.1.7 (from oauth2client->google-api-python-client>=1.4.2->autosub)
  Downloading pyasn1-0.1.9-py2.py3-none-any.whl
Collecting pyasn1-modules>=0.0.5 (from oauth2client->google-api-python-client>=1.4.2->autosub)
  Downloading pyasn1_modules-0.0.8-py2.py3-none-any.whl
Collecting rsa>=3.1.4 (from oauth2client->google-api-python-client>=1.4.2->autosub)
  Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
Installing collected packages: six, simplejson, uritemplate, httplib2, pyasn1, pyasn1-modules, rsa, oauth2client, google-api-python-client, requests, chardet, pysrt, progressbar, autosub
  Running setup.py install for uritemplate: started
    Running setup.py install for uritemplate: finished with status 'done'
  Running setup.py install for httplib2: started
    Running setup.py install for httplib2: finished with status 'done'
  Running setup.py install for oauth2client: started
    Running setup.py install for oauth2client: finished with status 'done'
  Running setup.py install for chardet: started
    Running setup.py install for chardet: finished with status 'done'
  Running setup.py install for pysrt: started
    Running setup.py install for pysrt: finished with status 'done'
  Running setup.py install for progressbar: started
    Running setup.py install for progressbar: finished with status 'done'
  Running setup.py install for autosub: started
    Running setup.py install for autosub: finished with status 'done'
Successfully installed autosub-0.3.9 chardet-2.3.0 google-api-python-client-1.5.1 httplib2-0.9.2 oauth2client-3.0.0 progressbar-2.3 pyasn1-0.1.9 pyasn1-modules-0.0.8 pysrt-1.1.1 requests-2.11.0 rsa-3.4.2 simplejson-3.8.2 six-1.10.0 uritemplate-0.6


For Version autosub 0.3.9
File For Windows Modified. Rename autosub_app.py.txt to autosub_app.py, and copy

C:\Python27\Scripts

autosub_app.py.txt
SampleVideos Spanish - English.zip
autosub_app 0.3.12.zip

@SvenErik1968
Copy link

I have installed autosub as described above, but I get the following error message:

E:\Completed>C:\Python27\python.exe C:\Python27\scripts\autosub_app.py --list-la
nguages
Traceback (most recent call last):
  File "C:\Python27\scripts\autosub_app.py", line 17, in <module>
    from autosub.constants import LANGUAGE_CODES, \
  File "C:\Python27\Scripts\autosub.py", line 17, in <module>
ImportError: No module named constants

I can find the constanst.py file under C:\Python27\Lib\site-packages\autosub\constants.py

@JeanDown123
Copy link
Contributor Author

Try cmd
pip uninstall autosub
What is your message? output?
install autosub
What is your message? output?

---------Message Normal install-------

Collecting autosub
Requirement already satisfied (use --upgrade to upgrade): pysrt>=1.0.1 in c:\python27\lib\site-packages (from autosub)
Requirement already satisfied (use --upgrade to upgrade): requests>=2.3.0 in c:\python27\lib\site-packages (from autosub)
Requirement already satisfied (use --upgrade to upgrade): google-api-python-client>=1.4.2 in c:\python27\lib\site-packages (from autosub)
Requirement already satisfied (use --upgrade to upgrade): progressbar>=2.3 in c:\python27\lib\site-packages (from autosub)
Requirement already satisfied (use --upgrade to upgrade): chardet in c:\python27\lib\site-packages (from pysrt>=1.0.1->autosub)
Requirement already satisfied (use --upgrade to upgrade): uritemplate<1,>=0.6 in c:\python27\lib\site-packages (from google-api-python-client>=1.4.2->autosub)
Requirement already satisfied (use --upgrade to upgrade): httplib2<1,>=0.8 in c:\python27\lib\site-packages (from google-api-python-client>=1.4.2->autosub)
Requirement already satisfied (use --upgrade to upgrade): six<2,>=1.6.1 in c:\python27\lib\site-packages (from google-api-python-client>=1.4.2->autosub)
Requirement already satisfied (use --upgrade to upgrade): oauth2client in c:\python27\lib\site-packages (from google-api-python-client>=1.4.2->autosub)
Requirement already satisfied (use --upgrade to upgrade): simplejson>=2.5.0 in c:\python27\lib\site-packages (from uritemplate<1,>=0.6->google-api-python-client>=1.4.2->autosub)
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.7 in c:\python27\lib\site-packages (from oauth2client->google-api-python-client>=1.4.2->autosub)
Requirement already satisfied (use --upgrade to upgrade): pyasn1-modules>=0.0.5 in c:\python27\lib\site-packages (from oauth2client->google-api-python-client>=1.4.2->autosub)
Requirement already satisfied (use --upgrade to upgrade): rsa>=3.1.4 in c:\python27\lib\site-packages (from oauth2client->google-api-python-client>=1.4.2->autosub)
Installing collected packages: autosub
Successfully installed autosub-0.3.9

---------Message Normal uninstall-------

Uninstalling autosub-0.3.9:
  c:\python27\lib\site-packages\autosub-0.3.9.dist-info\description.rst
  c:\python27\lib\site-packages\autosub-0.3.9.dist-info\installer
  c:\python27\lib\site-packages\autosub-0.3.9.dist-info\metadata
  c:\python27\lib\site-packages\autosub-0.3.9.dist-info\metadata.json
  c:\python27\lib\site-packages\autosub-0.3.9.dist-info\pbr.json
  c:\python27\lib\site-packages\autosub-0.3.9.dist-info\record
  c:\python27\lib\site-packages\autosub-0.3.9.dist-info\top_level.txt
  c:\python27\lib\site-packages\autosub-0.3.9.dist-info\wheel
  c:\python27\lib\site-packages\autosub\__init__.py
  c:\python27\lib\site-packages\autosub\__init__.pyc
  c:\python27\lib\site-packages\autosub\constants.py
  c:\python27\lib\site-packages\autosub\constants.pyc
  c:\python27\lib\site-packages\autosub\formatters.py
  c:\python27\lib\site-packages\autosub\formatters.pyc
  c:\python27\scripts\autosub
Proceed (y/n)? y
  Successfully uninstalled autosub-0.3.9

@SvenErik1968
Copy link

The message output were the same as you put above, but something must have changed, because it started working after I uninstalled and then installed it again.

@TTonyWang
Copy link

TTonyWang commented Aug 24, 2016

Hi, there! I stuck on the generating step. The --list-language operation works right, I can see there are lots of choices. But it seems no matter where I put the test.mp4, autosub will not be able to find it, or maybe I've got wrong elsewhere. Would you please help me with this? The error message is down below.

C:\Python27>python.exe C:\Python27\scripts\autosub_app.py -S en -D en test.mp4
Traceback (most recent call last):
  File "C:\Python27\scripts\autosub_app.py", line 284, in <module>
    sys.exit(main())
  File "C:\Python27\scripts\autosub_app.py", line 210, in main
    audio_filename, audio_rate = extract_audio(args.source_path)
  File "C:\Python27\scripts\autosub_app.py", line 120, in extract_audio
    subprocess.check_output(command)
  File "C:\Python27\lib\subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "C:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2]

@JeanDown123
Copy link
Contributor Author

Try with path in video
C:\Python27\python.exe C:\Python27\scripts\autosub_app.py -S es -D es "c:\mypathdownload\test.mp4"

@TTonyWang
Copy link

Thx, JeanDown123! I move the ffmpeg.exe to C:\Python and it worked, it's true that the path caused the problem.

@Hansdevr
Copy link

Hansdevr commented Sep 2, 2016

I installed everything like you said, but - at first - I couldn't find where any output went to. Later I did the script in a cmd window and then it said that I needed to provide the Google API key.. Any idea what I might have done wrong?

@JeanDown123
Copy link
Contributor Author

Hansdevr:
"(optionally) translates them to a different language,", Need API KEY(Price).link
Free only transcriptions (For Time Limited) not Translates.
Use Languaje spoken = Language Desired
Example
-S es -D es For Spanish
-S ja -D ja For Japanese
For Translate your Subtitles use other programs, example Subtitle Edit.

@Hansdevr
Copy link

Hansdevr commented Sep 4, 2016

Okay, so french to french, dutch to dutch etcetera.. Right? I'll try that!

@Hansdevr
Copy link

Hansdevr commented Sep 4, 2016

It worked! But.. I lost a lot of sentences in the translation. It seems like AutoSub has trouble "hearing" some parts. (Damn, these French speak quik..) Would it help to 'normalize" audio (bring it to a higher and more equal level) before translating it?

@JeanDown123
Copy link
Contributor Author

A "audio clean" help.
Other option, modify code:

For length chunk or segment
frame_width=4096 (2000 - 12000)

threshold = percentile(energies, 0.2)
0.2 - 0.7 (for lever noise)

Try "frame_width = 8000"

@Hansdevr
Copy link

Hansdevr commented Sep 4, 2016

Thanks Jean, much appreciated! :)
I'll let you know what worked best,

@Hansdevr
Copy link

Hansdevr commented Sep 6, 2016

Well, to be honest, it didn't make much of a difference.. :(
Next, I'm going to try to do normalizing with a copy of the audio track, along with some eq-ing of the highs (low bitrate mp3 audio needs some sooping up...)

@BigGreatGrandAwesomeWei
Copy link

Thank you for you work!
But after completing speech recognition and the .srt file generated, there is no any text in the .srt file, so sad about it.
I checked it once then I corrected the language options, but still nothing.(using a video in Chinese)
Then I change a video source which's speech is in English, still nothing.
Looks like I have to generate the subtitles manually, still.
Just some feed back, thanks!

@JeanDown123
Copy link
Contributor Author

JeanDown123 commented Sep 9, 2016

What is the duration of the videos you tried?
which was the duration of the process?
Which gave the console messages?
Check the audio files (flac) that are in C:\Users%username%\AppData\Local\Temp*.flac, these are the files that are sent to the translator,.

@ghost
Copy link

ghost commented Sep 11, 2016

@JeanDown123 I'm having the same problem and i checked *.flac files they were all 0KB files. Any solution. Thanks In Advance!

@JeanDown123
Copy link
Contributor Author

Try: https://www.youtube.com/watch?v=Ya6Av7uecbg
Attach File Subtitles Generated By Autosub.
Time Process: 01:15 - about a minute
President Obama Addresses the Nation on the BP Oil Spill (inglés).AutoSub.srt.txt

@MrNobdy
Copy link

MrNobdy commented Oct 6, 2016

After setting up the path to ffmpeg and after testing if ffmpeg is working or not and it did worked, i keep getting this error message: (knowin that i've a file called px.mp4 in the directory)

px.mp4: No such file or directory
Traceback (most recent call last):
  File "C:\Python27\scripts\autosub_app.py", line 284, in <module>
    sys.exit(main())
  File "C:\Python27\scripts\autosub_app.py", line 210, in main
    audio_filename, audio_rate = extract_audio(args.source_path)
  File "C:\Python27\scripts\autosub_app.py", line 120, in extract_audio
    subprocess.check_output(command)
  File "C:\Python27\lib\subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['ffmpeg', '-y', '-i', 'px.mp4', '-ac', '1', '-ar', '16000', '-loglevel', 'error', 'c:\\users\\otto\\appdata\\local\\temp\\tmpuj0j75.wav']' returned non-zero exit status 1

I think the trick is the last two lines, maybe.

Help appreciated, thanks!

@JeanDown123
Copy link
Contributor Author

MrNobdy , think path file px.mp4.
C:\Python27\scripts\autosub_app.py -S en -D en "c:\mydownloads\px.mp4"

@ghost
Copy link

ghost commented Oct 21, 2016

Greetings.
In trying to translate a video (Japanese) I get this error.

programa o archivo por lotes ejecutable.
"stty" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
"stty" no se reconoce como un comando interno o externo,####### | ETA: 0:00:00
programa o archivo por lotes ejecutable.
Converting speech regions to FLAC files: 100% |#################| Time: 0:00:11
Performing speech recognition: 100% |###########################| Time: 0:05:10
Error: Subtitle translation requires specified Google Translate API key. See --help for further information.

Please help me

@ghost
Copy link

ghost commented Nov 11, 2016

I had try video
https://www.youtube.com/watch?v=Ya6Av7uecbg

Converting speech regions to FLAC files: 100% Time 00:00:12
Performing speech recognition: 100% Time 00:00:00

Flac files is okay (not null size), but .sqr file size is 0 kb :(
Please, help!

@ghost
Copy link

ghost commented Nov 12, 2016

Found via debugger that script need connection internet. Now it's work! :)

@Mistursmiley
Copy link

Okay so i copied ffmpeg.exe to C:\python27

but cmd is telling it cant find it.

C:\Users"NAME">C:\Python27\python.exe C:\Python27\scripts\autosub_app.p
y -S en -D en c:\1.ZBrush_Introduction.mkv
ffmpeg: Executable not found on machine.
Traceback (most recent call last):
File "C:\Python27\scripts\autosub_app.py", line 304, in
sys.exit(main())
File "C:\Python27\scripts\autosub_app.py", line 230, in main
audio_filename, audio_rate = extract_audio(args.source_path)
File "C:\Python27\scripts\autosub_app.py", line 140, in extract_audio
raise Exception("Dependency not found: ffmpeg")
Exception: Dependency not found: ffmpeg

@dezea
Copy link

dezea commented Dec 16, 2016

Mistursmiley, I had the same issue - you can make the script work directly with the .wav file (convert it yourself with ffmpeg or something else) and then patch the python script so that it uses the wav file directly. To do this, make the extract_audio function look like this:

def extract_audio(filename, channels=1, rate=16000): return filename, rate

Make sure to adjust the sample rate accordingly (I had a 44100 sample rate) and that it has only one channel (mono). Good luck, it did some pretty decent work for me in french.

@huyanh10tin
Copy link

how to make it work auto in a forder?I mean make sub for all file in a folder

@dezea
Copy link

dezea commented Dec 17, 2016

@huyanh10tin you could modify the script so it would make a loop with all the files in the folder, or you could make a batch file wich would pass the files to the app one by one (imho it is not a good idea to process all the files at once since the google speech recognition api will probably block your access)

@huyanh10tin
Copy link

@dezea sorry,but i dont know python language,please help me,or you could change it for me,thank

@JeanDown123
Copy link
Contributor Author

To Install Python: Check "Add Python.exe to Path"?
python
Or ADD Path (Directory) of File ffmpeg.exe.
http://www.computerhope.com/issues/ch000549.htm

@stringtheory178
Copy link

@dezea autosub couldn't find ffmpeg for me either despite being in the same folder. I tried inserting your change to extract_audio, converting the format of the file to .wav, and setting the sample rates the same. However the following error keeps coming up.

Traceback (most recent call last):files:   0% |                | ETA:  --:--:--
  File "C:\Python27\scripts\autosub_app.py", line 295, in <module>
    sys.exit(main())
  File "C:\Python27\scripts\autosub_app.py", line 235, in main
    for i, extracted_region in enumerate(pool.imap(converter, regions)):
  File "C:\Python27\lib\multiprocessing\pool.py", line 668, in next
    raise value
NameError: global name 'false' is not defined

@ghost
Copy link

ghost commented Mar 30, 2019

Does the same languages srt converter need google api ?
I don't use translate different languages services.

@BingLingGroup
Copy link

Does the same languages srt converter need google api ?
I don't use translate different languages services.

如果你指的是语音识别是否需要翻译api,这个答案是不需要,具体语音识别和翻译api的区别和来源参考 #111
至于只输入源语言选项却提示要翻译api的情况,是一个已知的bug,可以参考 #136

@ghost
Copy link

ghost commented Apr 2, 2019

Does the same languages srt converter need google api ?
I don't use translate different languages services.

如果你指的是语音识别是否需要翻译api,这个答案是不需要,具体语音识别和翻译api的区别和来源参考 #111
至于只输入源语言选项却提示要翻译api的情况,是一个已知的bug,可以参考 #136

音频是 EN, 从 EN 导出EN 字幕。不翻译成ZH。 因为翻译工作可以用字幕软件翻译,不需要autosub翻译。但是就是EN to EN ,也是空文件。原因是因为相同语言也要调用Google Api 吧?所以还是要翻墙。

@BingLingGroup
Copy link

Does the same languages srt converter need google api ?
I don't use translate different languages services.

如果你指的是语音识别是否需要翻译api,这个答案是不需要,具体语音识别和翻译api的区别和来源参考 #111
至于只输入源语言选项却提示要翻译api的情况,是一个已知的bug,可以参考 #136

音频是 EN, 从 EN 导出EN 字幕。不翻译成ZH。 因为翻译工作可以用字幕软件翻译,不需要autosub翻译。但是就是EN to EN ,也是空文件。原因是因为相同语言也要调用Google Api 吧?所以还是要翻墙。

那肯定的,这必须要先能连上google。

@ghost
Copy link

ghost commented Jun 30, 2019

The English language which it auto-captions looks like Indian English because of I Indian words in it. I tried to change the regional language in my PC to English (united states) as well speech language to English (united states) which earlier was English (India). I then reinstalled the autosub but still gives me the same wrong captions for the video. Here are the Auto captions for the same OBAMA VIDEO which yo put the link in the description.
President Obama Addresses the Nation on the BP Oil Spill - Copy.srt.txt

@BingLingGroup
Copy link

BingLingGroup commented Jun 30, 2019

The English language which it auto-captions looks like Indian English because of I Indian words in it. I tried to change the regional language in my PC to English (united states) as well speech language to English (united states) which earlier was English (India). I then reinstalled the autosub but still gives me the same wrong captions for the video. Here are the Auto captions for the same OBAMA VIDEO which yo put the link in the description.
President Obama Addresses the Nation on the BP Oil Spill - Copy.srt.txt

Just exactly what I mentioned in #136 . Perhaps you need to switch your IP or find some universal lang codes to use.

@ghost
Copy link

ghost commented Jun 30, 2019

The English language which it auto-captions looks like Indian English because of I Indian words in it. I tried to change the regional language in my PC to English (united states) as well speech language to English (united states) which earlier was English (India). I then reinstalled the autosub but still gives me the same wrong captions for the video. Here are the Auto captions for the same OBAMA VIDEO which yo put the link in the description.
President Obama Addresses the Nation on the BP Oil Spill - Copy.srt.txt

Just exactly what I mentioned in #136 . Perhaps you need to switch your IP or find some universal lang code to use.

Please help me out, what should I do now for changing the IP address and whats the universal english code? it would be great if you could give me some stepby step instructions. Thanks

@BingLingGroup
Copy link

BingLingGroup commented Jun 30, 2019

The English language which it auto-captions looks like Indian English because of I Indian words in it. I tried to change the regional language in my PC to English (united states) as well speech language to English (united states) which earlier was English (India). I then reinstalled the autosub but still gives me the same wrong captions for the video. Here are the Auto captions for the same OBAMA VIDEO which yo put the link in the description.
President Obama Addresses the Nation on the BP Oil Spill - Copy.srt.txt

Just exactly what I mentioned in #136 . Perhaps you need to switch your IP or find some universal lang codes to use.

Please help me out, what should I do now for changing the IP address and whats the universal english code? it would be great if you could give me some stepby step instructions. Thanks

See this speech-to-text/docs . Because the author hard-coded the lang codes and the filter codes, you need to adopt my modified version of autosub to use these more accurate lang codes.

@ghost
Copy link

ghost commented Jun 30, 2019

The English language which it auto-captions looks like Indian English because of I Indian words in it. I tried to change the regional language in my PC to English (united states) as well speech language to English (united states) which earlier was English (India). I then reinstalled the autosub but still gives me the same wrong captions for the video. Here are the Auto captions for the same OBAMA VIDEO which yo put the link in the description.
President Obama Addresses the Nation on the BP Oil Spill - Copy.srt.txt

Just exactly what I mentioned in #136 . Perhaps you need to switch your IP or find some universal lang codes to use.

Please help me out, what should I do now for changing the IP address and whats the universal english code? it would be great if you could give me some stepby step instructions. Thanks

See this speech-to-text/docs . Because the author hard-coded the lang codes and the filter codes, you need to adopt my modified version of autosub to use these more accurate lang codes.

i downloaded autosub.exe from your page and ran it. what other changes should i do.?

@BingLingGroup
Copy link

The English language which it auto-captions looks like Indian English because of I Indian words in it. I tried to change the regional language in my PC to English (united states) as well speech language to English (united states) which earlier was English (India). I then reinstalled the autosub but still gives me the same wrong captions for the video. Here are the Auto captions for the same OBAMA VIDEO which yo put the link in the description.
President Obama Addresses the Nation on the BP Oil Spill - Copy.srt.txt

Just exactly what I mentioned in #136 . Perhaps you need to switch your IP or find some universal lang codes to use.

Please help me out, what should I do now for changing the IP address and whats the universal english code? it would be great if you could give me some stepby step instructions. Thanks

See this speech-to-text/docs . Because the author hard-coded the lang codes and the filter codes, you need to adopt my modified version of autosub to use these more accurate lang codes.

i downloaded autosub.exe from your page and ran it. what other changes should i do.?

Just use autosub -h and autosub --list-speech-to-text-codes to see what I have changed. And use those new arguments.

@BingLingGroup
Copy link

@timoteo7 Just use py-googletrans and it's Ok. I use it in my modified version of autosub.

@Meet2674
Copy link

Traceback (most recent call last):
File "C:\Users\MEET\AppData\Local\Programs\Python\Python38-32\Scripts\autosub_app.py", line 19, in
from autosub.formatters import FORMATTERS
File "C:\Users\MEET\AppData\Local\Programs\Python\Python38-32\lib\site-packages\autosub\formatters.py", line 34
subtitle_dicts = map(lambda (r, t): {'start': r[0], 'end': r[1], 'content': t}, subtitles)
^

How do I correct this?

@BingLingGroup
Copy link

BingLingGroup commented Mar 21, 2020

@Meet2674 It seems you are using 0.3.12 on windows. It's not compatible with windows or Python 3. You could consider using my forked version of autosub. https://github.com/BingLingGroup/autosub

@aflerov
Copy link

aflerov commented Apr 9, 2020

Hi there!

I've installed autosub following all the steps of the mentioned Tutorial, but in my case there is a difference with Tutorial between the number of lines in srt files: i only have two lines in SpanishPaoladelCastillo.srt after autotranslation instead of four lines in Tutorial, and 64 lines in EnglishObama.srt instead of 66 lines in Tutorial.

I've also tried pyTranscriber, but results are the same. Versions of subs in Tutorial are better than mine, but why?

@aflerov
Copy link

aflerov commented Apr 9, 2020

And another one question. I have some errors, what do they mean? How could I fix them?
2020-04-08_21-39-57

@BingLingGroup
Copy link

@aflerov Just use py-googletrans to translate subtitles. I use it in my modified version of autosub.

@Damon-M
Copy link

Damon-M commented Apr 15, 2020

QQ截图20200415214057
how to solve this problem

@ismuta
Copy link

ismuta commented Apr 18, 2020

And another one question. I have some errors, what do they mean? How could I fix them?
2020-04-08_21-39-57

I've the same issue and I cannot fix it.

@tong-sak
Copy link

tong-sak commented Apr 6, 2021

helpme
image

@frostieff
Copy link

Screenshot 2021-05-13 042304

I followed everything from the youtube tutortial + the written tutorital and still get this issue.

@oscar370
Copy link

oscar370 commented Dec 4, 2021

image
How can I fix it?

@longhtd
Copy link

longhtd commented Jun 6, 2022

I have installed autosub as described above, but I get the following error message:

E:\Completed>C:\Python27\python.exe C:\Python27\scripts\autosub_app.py --list-la
nguages
Traceback (most recent call last):
  File "C:\Python27\scripts\autosub_app.py", line 17, in <module>
    from autosub.constants import LANGUAGE_CODES, \
  File "C:\Python27\Scripts\autosub.py", line 17, in <module>
ImportError: No module named constants

I can find the constanst.py file under C:\Python27\Lib\site-packages\autosub\constants.py

Did you find the solution? I have the same error

@BigGreatGrandAwesomeWei
Copy link

BigGreatGrandAwesomeWei commented Jun 6, 2022 via email

@gheetshyin
Copy link

gheetshyin commented Sep 25, 2022

I've made it works with Python 3.10.

First I have installed python from :
python-3.10.7
During the setup change the install path to C:\Python310 or you'll have to modify all the .bat files I supply in next step.

Download this archive and extract it:
autosub_batch_files.zip

Run the batch file :
Install_AutoSub.bat

I took ffmpeg from this link:
ffmpeg
and extracted the 3 exe in folder C:\Python310
(if the link disapears report to the site gyan.dev ffmpeg builds

At this point you can test the script by launching this command in a terminal
C:\Python310\python.exe C:\Python310\scripts\autosub_app.py --list-languages

To extract subtitles from a video you can either drop it on the batch file corresponding to its language (i.e drop it on AutoSub_Spanish.bat if your video file is in spanish) or you can use the context menu 'send to'

To translate your .srt in any language report to chapter 7.- Translate your Subtitles in the original post for the use of Subtitle Edit .

@Roger-Gu
Copy link

Roger-Gu commented Oct 24, 2022

I have installed autosub as described above, but I get the following error message:

E:\Completed>C:\Python27\python.exe C:\Python27\scripts\autosub_app.py --list-la
nguages
Traceback (most recent call last):
  File "C:\Python27\scripts\autosub_app.py", line 17, in <module>
    from autosub.constants import LANGUAGE_CODES, \
  File "C:\Python27\Scripts\autosub.py", line 17, in <module>
ImportError: No module named constants

I can find the constanst.py file under C:\Python27\Lib\site-packages\autosub\constants.py

Did you find the solution? I have the same error

Same here. Tried to move the script under the site-packages folder
Update: It worked for me to use python -m autosub_app after installing the patch by gheetshyin

@Roger-Gu
Copy link

Roger-Gu commented Oct 24, 2022

@gheetshyin
One very interesting thing is that I must enter the site-packages directory first for the autosub_app to work. It doesn't matter in which directory I run the script, but I mush have entered this directory before. Very weird. Do you know what might be a cause?

image

@gheetshyin
Copy link

gheetshyin commented Oct 24, 2022

@Roger-Gu

Sorry, I have absolutly no clue about this. I would have think that you'd have to be in the directory where is autosub_app.py
I do not know much about python. Maybe it is a path issue, on my computer I have python installation directory in the %PATH% and also the folder Scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests