apm1467 / videocr

Extract hardcoded subtitles from videos using machine learning
MIT License
506 stars 117 forks source link

progress, tesseract config, roi, debug image #29

Closed kftsehk closed 2 years ago

kftsehk commented 3 years ago

A few features to the API that I find useful

Example usage:

save_subtitles_to_file(
        video_path='video.mp4',
        file_path='video.srt',
        lang='chi_tra+chi_sim', tesseract_config="--psm 6 --oem 3 --dpi 300",
        time_start='0:00', time_end='',
        conf_threshold=60, sim_threshold=90,
        roi=[[0.2,0.8],[0.90, 0.98]],
        debug=True,
        num_jobs=4,
    )

Some findings not patched:

VladiStep commented 3 years ago

@kftsehk, I tried to use your modified version, but at some point it stops with "The system cannot write to the specified device" error...

kftsehk commented 3 years ago

hi, the program will write the srt file, and the updated version with debug enabled will also write each frame’s region of interest.

Please confirm you do not have an issue with disk capacity, and post a stack trace.

VladiStep commented 3 years ago

@kftsehk, how do I get a stack trace? It just prints that message, no details.