>>1506>Do you still have this set up?I do.
Here's a brief instruction guide to setting everything up on Windows:
1.
Download and install Python. When doing so, make sure to check the box on the first page of the installer that says, 'Add python.exe to PATH'. All other defaults are fine as you run the installer.
2. Open a new Command Prompt window (either type CMD or Command Prompt into the Windows search). Using the Windows Terminal is fine too.
3. Enter 'Python'. You should see something like, 'Python 3.X.Y'. If you do, you can close this window. If you don't see this, you forgot to add Python to PATH.
4.
Download FFmpeg, and extract it somewhere. You can put it wherever you want. I recommend putting it somewhere it won't be deleted or moved.
5. Type PATH into the Windows Search. Click 'Edit the system environment variables'. Click 'Environment Variables'
6. Under 'User variables for <username>', click 'Path', then 'Edit'.
7. Click 'New', then enter the path to wherever you extracted 'ffmpeg-7.0.1-full_bui
ld' to. (e.g. 'C:\Applications\ffmpe
g-7.0.1-full_build\bin
\')
8. Click 'OK', 'OK' again, and then 'Apply'. You can then close the System Variables window.
8. Open a new Command Prompt window. (Note: it must be a new window. The previous command prompt or terminal window will not have the updated PATH)
9. Enter 'ffmpeg'. You should see something like, 'ffmpeg version 6.0-essentials_build-w
ww.gyan.dev'. If you do, you can close this window. If you don't see this, you may have not saved to PATH.
10. Enter 'pip install git+
https://github.com/m1guelpf/auto-subtitle.git'11. Open a new Command Prompt window
12. Enter 'auto_subtitle'. You should see something like 'usage: auto_subtitle [-h]'
13. Either copy the batch script below and paste it to a text file called '[whatever you want to call it].bat', or download and extract the archive for the same .bat file. Further instructions for use are in the batch file, and you can edit it as you wish.
14. Move the .bat file into the directory where you have the file that you want to generate subtitles for, then run it. You should see a Command Prompt window appear and the script showing subtitles being created in realtime.
15. Open your file. Most video players should automatically load subtitles from the './subtitles' folder, but if not, you may need to move the subtitle file to the same directory the file is in. Alternatively, you may be able to drag and drop the .srt file into your video player.
@ECHO OFF
SETLOCAL
:: Requirements:
:: Python is installed and added to PATH
:: FFmpeg is installed and added to PATH
:: Note: Whisper is prone to hallucinations. Common issues include:
:: 1. Subtitle offset (e.g. speech at 00:01:15 showing up at 00:02:19. Typically when this occurs, the entire subtitle will be offset from that point)
:: 2. Missing subtitles
:: 3. Hallucinated dialogue (more common with poor quality audio, and translation)
:: 4. Repeated mistranscription (e.g. repeated mistranscribing 'mason' -> 'my son')
:: 5. Phonetic transcription (e.g. '日本' -> 'にほん')
:: 6. Translation issues (e.g. '日本' -> 'nihon' instead of 'Japan')
:: Also note: Smaller models are more prone to hallucinations, however, larger models may sometimes have more hallucinations than smaller models. If you are experiencing continued hallucinations using the large model, you may want to try using the medium and small model.
:: How-To:
:: Use '--task transcribe' if you only want native language subtitles.
:: Accuracy is good, and hallucinations are more rare.
:: Use '--task translate' if you only want English language subtitles.
:: Translation is far more prone to hallucinations than transcription.
:: Translate will always, and only, translate from X -> English.
:: Use '--verbose true' to see the progress as it occurs.
:: Use '--srt_only True' if you only want subtitle files. By default, auto_subtitle will directly add subtitles to the file if this is not set.
:: Use '--output_dir <path>' or '-o <path>' to set the output directory. By default, files will be in the same directory if this is not set.
:: Use '--output_srt True' to generate .srt files in addition to the video files. By default, no .srt files will be generated. This setting is redundant if '--srt_only' is set to True.
:: Use '--language [two character language code]' to set the language manually. By default, this is set to '--language auto'.
:: Language options are: ,af,am,ar,as,az,ba,be,bg,bn,bo,br,bs,ca,cs,cy,da,de,el,en,es,et,eu,fa,fi,fo,fr,gl,gu,ha,haw,he,hi,hr,ht,hu,hy,id,is,it,ja,jw,ka,kk,km,kn,ko,la,lb,ln,lo,lt,lv,mg,mi,mk,ml,mn,mr,ms,mt,my,ne,nl,nn,no,oc,pa,pl,ps,pt,ro,ru,sa,sd,si,sk,sl,sn,so,sq,sr,su,sv,sw,ta,te,tg,th,tk,tl,tr,tt,uk,ur,uz,vi,yi,yo,zh
:: Available models (As of Jun 5, 2024) are: tiny, base, small, medium, large (defaults to the newest version: large-v3), large-v1, large-v2, large-v3
:: There are also several English-only models: tiny.en, base.en, small.en, medium.en (there is no large.en)
:: Performance:
:: Tiny: ~1GB VRAM, 32x speed
:: Base: ~1GB VRAM, 16x speed
:: Small: ~2GB VRAM, 6x speed
:: Medium: ~5GB VRAM, 2x speed
:: Large: ~10GB VRAM, 1x speed
for %%i in (*) do auto_subtitle "%%i" -o subtitles/ --model medium --srt_only True --task translate --verbose True
:: This will run auto_subtitle on all valid files within the base directory, translate to English, and output .srt files to ./subtitles. Model used is Medium (Requires ~5GB VRAM). As script runs, the output will be shown in realtime as subtitles are generate.
echo.
echo.
echo All Done^!
pause