-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Comments
I have installed autosub as described above, but I get the following error message:
I can find the constanst.py file under C:\Python27\Lib\site-packages\autosub\constants.py |
Try cmd ---------Message Normal install-------
---------Message Normal uninstall-------
|
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. |
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.
|
Try with path in video |
Thx, JeanDown123! I move the ffmpeg.exe to C:\Python and it worked, it's true that the path caused the problem. |
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? |
Hansdevr: |
Okay, so french to french, dutch to dutch etcetera.. Right? I'll try that! |
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? |
A "audio clean" help. For length chunk or segment threshold = percentile(energies, 0.2) Try "frame_width = 8000" |
Thanks Jean, much appreciated! :) |
Well, to be honest, it didn't make much of a difference.. :( |
Thank you for you work! |
What is the duration of the videos you tried? |
@JeanDown123 I'm having the same problem and i checked *.flac files they were all 0KB files. Any solution. Thanks In Advance! |
Try: https://www.youtube.com/watch?v=Ya6Av7uecbg |
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)
I think the trick is the last two lines, maybe. Help appreciated, thanks! |
MrNobdy , think path file px.mp4. |
Greetings.
Please help me |
I had try video Converting speech regions to FLAC files: 100% Time 00:00:12 Flac files is okay (not null size), but .sqr file size is 0 kb :( |
Found via debugger that script need connection internet. Now it's work! :) |
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 |
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:
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. |
how to make it work auto in a forder?I mean make sub for all file in a folder |
@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) |
@dezea sorry,but i dont know python language,please help me,or you could change it for me,thank |
To Install Python: Check "Add Python.exe to Path"? |
@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.
|
Does the same languages srt converter need google api ? |
音频是 EN, 从 EN 导出EN 字幕。不翻译成ZH。 因为翻译工作可以用字幕软件翻译,不需要autosub翻译。但是就是EN to EN ,也是空文件。原因是因为相同语言也要调用Google Api 吧?所以还是要翻墙。 |
那肯定的,这必须要先能连上google。 |
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. |
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 |
@timoteo7 Just use py-googletrans and it's Ok. I use it in my modified version of autosub. |
Traceback (most recent call last): How do I correct this? |
@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 |
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 Just use py-googletrans to translate subtitles. I use it in my modified version of autosub. |
Did you find the solution? I have the same error |
I got no solution, I give up.
longhtd ***@***.***> 于 2022年6月6日周一 上午9:15写道:
… 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
—
Reply to this email directly, view it on GitHub
<#31 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFINJQZI2XK5X7VVY3M74J3VNVGJXANCNFSM4CL53N6A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I've made it works with Python 3.10. First I have installed python from : Download this archive and extract it: Run the batch file : I took ffmpeg from this link: At this point you can test the script by launching this command in a terminal 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 |
Same here. Tried to move the script under the site-packages folder |
@gheetshyin |
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 |
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
Install Python 2.7 (32 bits)
https://www.python.org/ftp/python/2.7.12/python-2.7.12.msi
## Note: Check Add Python.exe to Path
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
Change Name File "autosub" to "autosub_app.py"
Rename C:\Python27\Scripts\autosub autosub_app.py
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)
Download(https://ffmpeg.zeranoe.com/builds/) and
Copy ffmpeg.exe to C:\Python27\
Restart Windows
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
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
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
Or
https://sourceforge.net/projects/srt-tran/
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]"
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
Error infinite loop
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-------------------------
----------------------After - Modified Option 1 ------------------------
----------------------after - Modified Option 2 ------------------------
Message Normal Output Pip install autosub
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
The text was updated successfully, but these errors were encountered: