-
-
Notifications
You must be signed in to change notification settings - Fork 75
Add PGS to SRT OCR conversion feature #701
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
Closed
Closed
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
5108f53
Add PGS to SRT OCR conversion feature
mikeSGman 1c6c486
Address PR review feedback
mikeSGman f5ddccc
Fix OCR conversion for files with special characters in path
mikeSGman 5dd7627
Add pgsrip metadata to PyInstaller builds
mikeSGman c1d63d1
Include babelfish data files in PyInstaller builds
mikeSGman 39b1a5f
Include cleanit metadata in PyInstaller builds
mikeSGman 964ce3c
Include cleanit data files in PyInstaller builds
mikeSGman 4f8e347
Include trakit metadata in PyInstaller builds
mikeSGman aacb011
Add OCR dependencies to pyproject.toml
mikeSGman 9bd98ea
Add babelfish converter submodules as hidden imports
mikeSGman fdee985
Add MKVToolNix directory to PATH for pgsrip
mikeSGman c7fcaa1
Run pgsrip from video directory to avoid Windows path issues
mikeSGman 61e9735
Add test script and use POSIX paths for pgsrip
mikeSGman d967c82
Update test script with tesseract/mkvextract paths
mikeSGman 5060f88
Fix tesseract path for Subtitle Edit installation
mikeSGman 613c64f
Use Tesseract 5.5.0 for testing
mikeSGman d7e7a49
Detect Tesseract from Subtitle Edit and prioritize newest version
mikeSGman 54376c9
Add detection test script
mikeSGman 90a64ba
Add debug logging for pgsrip
mikeSGman 532d855
Set OCR tool paths at app startup for PyInstaller compatibility
mikeSGman 4560654
Enable keep_temp_files for debugging PyInstaller temp folder issue
mikeSGman 211b08b
Ensure TEMP/TMP env vars are set for PyInstaller
mikeSGman 8ecb3ad
Remove invalid keep_temp_files parameter
mikeSGman ef3dcf9
Monkey-patch pgsrip for PyInstaller temp folder compatibility
mikeSGman 953c967
Fix pgsrip monkey-patch to apply before Mkv import
mikeSGman f8893f6
Move pgsrip monkey-patch to app startup in __main__.py
mikeSGman b7884e4
Apply pgsrip patch after environment setup
mikeSGman 1ba9941
Add debug output to verify pgsrip patch is applied
mikeSGman ddaae55
Revert to simpler pgsrip usage - works from source
mikeSGman 835607e
Document known PyInstaller limitation for PGS OCR
mikeSGman 2f89be5
Add PGS to SRT OCR subtitle extraction
mikeSGman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| # Building FastFlix on Windows | ||
|
|
||
| This guide explains how to build FastFlix executables on Windows. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| 1. **Python 3.12 or higher** | ||
| - Download from [python.org](https://www.python.org/downloads/) | ||
| - Make sure to check "Add Python to PATH" during installation | ||
|
|
||
| 2. **Git** (to clone/update the repository) | ||
| - Download from [git-scm.com](https://git-scm.com/download/win) | ||
|
|
||
| ## Build Steps | ||
|
|
||
| ### 1. Open Command Prompt or PowerShell | ||
|
|
||
| Navigate to where you want to clone/have the FastFlix repository: | ||
|
|
||
| ```bash | ||
| cd C:\path\to\your\projects | ||
| git clone https://github.com/cdgriffith/FastFlix.git | ||
| cd FastFlix | ||
| ``` | ||
|
|
||
| Or if you already have it: | ||
|
|
||
| ```bash | ||
| cd C:\path\to\FastFlix | ||
| ``` | ||
|
|
||
| ### 2. Create and Activate Virtual Environment | ||
|
|
||
| ```bash | ||
| python -m venv venv | ||
| venv\Scripts\activate | ||
| ``` | ||
|
|
||
| You should see `(venv)` in your command prompt. | ||
|
|
||
| ### 3. Install Dependencies | ||
|
|
||
| ```bash | ||
| pip install --upgrade pip | ||
| pip install -e ".[dev]" | ||
| ``` | ||
|
|
||
| This installs FastFlix in editable mode with all development dependencies including PyInstaller. | ||
|
|
||
| ### 4. Build the Executable | ||
|
|
||
| You have two options: | ||
|
|
||
| #### Option A: Single Executable (Recommended for distribution) | ||
|
|
||
| ```bash | ||
| pyinstaller FastFlix_Windows_OneFile.spec | ||
| ``` | ||
|
|
||
| The executable will be in: `dist\FastFlix.exe` | ||
|
|
||
| #### Option B: Directory with Multiple Files (Faster startup) | ||
|
|
||
| ```bash | ||
| pyinstaller FastFlix_Windows_Installer.spec | ||
| ``` | ||
|
|
||
| The executable will be in: `dist\FastFlix\FastFlix.exe` | ||
|
|
||
| ### 5. Test the Build | ||
|
|
||
| ```bash | ||
| cd dist | ||
| FastFlix.exe | ||
| ``` | ||
|
|
||
| Or for the installer version: | ||
|
|
||
| ```bash | ||
| cd dist\FastFlix | ||
| FastFlix.exe | ||
| ``` | ||
|
|
||
| ## Running Without Building (For Testing) | ||
|
|
||
| If you just want to test changes without building an executable: | ||
|
|
||
| ```bash | ||
| python -m fastflix | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Missing Dependencies | ||
|
|
||
| If you get import errors, try reinstalling: | ||
|
|
||
| ```bash | ||
| pip install --upgrade --force-reinstall -e ".[dev]" | ||
| ``` | ||
|
|
||
| ### Build Errors | ||
|
|
||
| 1. Make sure you're in the FastFlix root directory | ||
| 2. Ensure the virtual environment is activated (you see `(venv)`) | ||
| 3. Try deleting `build` and `dist` folders and rebuilding: | ||
|
|
||
| ```bash | ||
| rmdir /s /q build dist | ||
| pyinstaller FastFlix_Windows_OneFile.spec | ||
| ``` | ||
|
|
||
| ### FFmpeg Not Found | ||
|
|
||
| The FastFlix executable doesn't include FFmpeg. You need to: | ||
|
|
||
| 1. Download FFmpeg from [ffmpeg.org](https://ffmpeg.org/download.html#build-windows) | ||
| 2. Extract it somewhere | ||
| 3. Add the `bin` folder to your PATH, or configure it in FastFlix settings | ||
|
|
||
| ## Known Limitations | ||
|
|
||
| ### PGS to SRT OCR (PyInstaller builds) | ||
|
|
||
| Due to an upstream issue in pgsrip v0.1.12, PGS to SRT OCR conversion does not work in PyInstaller-built executables. The feature works perfectly when running from source (`python -m fastflix`). | ||
|
|
||
| If you need PGS OCR functionality, please run FastFlix from source instead of using the compiled executable. | ||
|
|
||
| ## Notes | ||
|
|
||
| - The build process creates a `portable.py` file temporarily (it's removed after) | ||
| - The `.spec` files automatically collect all dependencies from `pyproject.toml` | ||
| - The icon is located at `fastflix\data\icon.ico` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know about those functions, handy!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just testing some final changes. I had to deal with detection for Subtitle Edit's tesseract installations. It works locally, testing a build now.