This guide walks you through using two Python scripts for identifying and removing EIA-608 subtitles from MKV video files. The first script scans MKV files in a specified directory for EIA-608 subtitles and logs the file paths. The second script removes the subtitles while backing up the original files.
- Python: Ensure you have Python installed on your system.
- MPV Player: Download and install the MPV player. Ensure you update the
mpv.com
path in the script. - FFmpeg: Download and install FFmpeg. Add it to your system's PATH to run it from the command line.
The first script identifies MKV files in a specified directory containing EIA-608 subtitles.
- Open the Find_EIA_608.py script and modify the following paths inside the script:
r"C:\Users\JySzE\Documents\MPV\mpv.com"
# Run the function with your desired scan directory and log file path
scan_files_for_eia_608(r"C:\Users\JySzE\Media_Test", r"C:\Users\JySzE\Desktop\eia_608_scan_log.txt")
- Save the script as
Find_EIA_608.py
. - Run the script:
python Find_EIA_608.py
- The script creates a log file listing the paths of all MKV files containing EIA-608 subtitles.
The second script removes EIA-608 subtitles from the files listed in the log created by the first script. It backs up each original file before processing.
- Open the script Remove_EIA_608.py and update the
log_file
variable with the path to the log file created by the first script:
log_file_path = r"C:\Users\JySzE\Desktop\eia_608_scan_log.txt"
- Save the modified script.
- Run the script:
python Remove_EIA_608.py
- For each file in the log:
- A backup of the original file is created with the
.bak
extension (e.g.,video.mkv.bak
). - The processed file is saved with the original file name.
- A backup of the original file is created with the
- Backup Files: Ensure enough disk space for backups, as each file will be duplicated before processing.
- Error Handling:
- If the MPV player or FFmpeg is not installed, you’ll see an error message. Install the missing tool and rerun the script.
- If processing fails, the original file is restored from the backup.
- Custom Paths: Adjust paths in the scripts to match your environment (e.g., locations of MPV and FFmpeg executables).
Follow these steps, and you’ll efficiently process your video files!