Skip to content

Conversation

@Phr33d0m
Copy link

I used to have a big pain with the CLI tool. Only one execution of the cli tool could be made at the same time. I wanted to parallelize my workflow (as I have the hardware to work on several files at the same time), so I did this modification to the video.py temporary folder cleanup.

Now, I am able to run several instances on the cli tool in separate terminals and parallelize with GNU Parallel as well.

@timminator
Copy link
Owner

Thank you for your contribution! A parallel execution of the CLI tool I did not have in my mind until now and the code was also not designed for this so far.
I have a few suggestions though. I made a few review comments. :-) Please take a look at them.

@timminator timminator force-pushed the master branch 2 times, most recently from 1966140 to 23d09d0 Compare August 31, 2025 00:07
@Phr33d0m
Copy link
Author

Phr33d0m commented Oct 7, 2025

@timminator thanks for the feedback! I have done the suggested changes and tested it thoroughly. The only issue is that, now if I ctrl+c out of it - the folders are not deleted anymore (they were before). This is not a big deal though.

In case anyone is interested, this is how I parallelize videocr on linux.

@timminator
Copy link
Owner

Hm, on windows they were also not deleted when pressing ctrl + c in its current state. But I also think thats not a big issue because they are deleted on the next run and are also not consuming a lot of space.

@timminator
Copy link
Owner

Looks good to me now! When I find some time I will try it out and if I don't find any problems, which I do not expect, this will be merged.

@ph-Os
Copy link

ph-Os commented Oct 15, 2025

Hi, first of all, a big thank you to both of you for putting together very useful tools. I just wanted to give you some feedback how it worked for me.

I also had several files to process and installed the current linux GPU binary VideOCR-GPU-v1.3.2-CUDA-11.8-Linux.7z as I have 1080TI.

I first had to separate the videos into folders by resolution - as the box for the OCR is in absolute coordinates - relative ones in relation to overall size would make this potentially work for any size.

When I ran this with a folder with a bunch files with this command ./ocr-parallel.sh --crops '0,500,1024,76' --max 5, I had errors for every file like as follows:

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/videocr_temp_16fveuoz/frame_000120_zone0.jpg'

I could not figure out what was the problem, maybe permissions ? Then just went on to put ./ocr-parallel.sh --crops '0,500,1024,76' $filename$ into a loop. That worked pretty well. Occasionally a file might still not work dropping most of the subtitles. Treating it individually with the GUI app would work though.

@timminator
Copy link
Owner

@ph-Os The FileNotFoundError is exactly what this PR addresses. The current release is not able to run in parallel.
Your second command is just running the jobs sequentially. That is expected to work, not sure what the issue was for some of the videos.

@ph-Os
Copy link

ph-Os commented Oct 16, 2025

Thx for the feedback, looking forward to the PR being implemented. Keep up the good work, Cheers!

@Phr33d0m
Copy link
Author

@ph-Os This PR allows multiple/parallel executions of the cli tool - that's all. You still need to provide the correct crop values (the easiest is to just copy them from the GUI).

Parallel OCR processing, the way I do it personally (I created a repo for my tools), is only useful when processing multiple video files from the same TV show (where crop values usually do not change between episodes).

If you intend to OCR episodes from completely different shows (with vastly diferent crop values) - my tools will not help you, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants