-
Since I will modify some parameters when generating video subtitles, I need to use the command line to run it. Currently, does it support multiple videos or video files in the same folder to be processed one by one? If batch processing is possible, can you tell me how to do it. |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 19 replies
-
Every command line program "supports" it. Simplest example for Command Prompt: This will process one by one every mkv file in a current folder. NOTE: EDIT: Few usage examples:
|
Beta Was this translation helpful? Give feedback.
-
Here is Command Prompt example without overhead, process all mkv files in one go. Save the code posted bellow as text file and rename its extension to
|
Beta Was this translation helpful? Give feedback.
-
You should try TCC command line, it has no limit to command line length other than your actual RAM. I'm going to do this on 30,000 or so files.... But I want to just use the EXE since it handles things so well. I could definitely chunk it up, but it's nice to have no limitation. |
Beta Was this translation helpful? Give feedback.
-
That being said -- filelist support would be better. And it would solve the problem of length limits. For example, an .m3u file is a playlist of mp3s/songs. That would be great to run through this. Load the model once, and create karaoke for every song in the playlist with one go. |
Beta Was this translation helpful? Give feedback.
-
CMD and PowerShell have command length limit of 8191 characters, that's why there are error checks in the example in my second post. TCC should have no limits, so below is example without error checks to run .bat in TCC:
|
Beta Was this translation helpful? Give feedback.
-
That's exactly what I'm doing. I'll have to figure out how to do it with a filelist, but i know it's possible using only internal commands. :) |
Beta Was this translation helpful? Give feedback.
-
For what it's worth, here's a simple python pattern for taking an argument, and processing it whether it's a file, a wildcard, or a folder(recursive) I haven't written one to take a filelist, but if the file extension isn't audio and it appears to be a filelist (easy to check, read the lines, see if any are files), it could be treated transparently in the same fashion.
|
Beta Was this translation helpful? Give feedback.
-
From 134.5 version it supports batch processing by directory, filelist or wildcard out of the box. |
Beta Was this translation helpful? Give feedback.
-
Quite awesome! I was literally showing my friends visiting last night how awesome it is and how fast it runs. I did an entire album in 4 minutes! Other-whisper, it's like 10 minutes a song with cuda, and like 3 hours a song without. To go from hours to minutes is A-M-A-Z-I-N-G ... thank you so much!!! That's the difference in making huge runs possible Now i just gotta figure out splitting out the vocals with DEMUCS, pre-prompting whisper by downloading the lyrics with lyricsgenius.py/exe to reduce mistkaes, and any other options that might increase vocal accuracy and damn. It'll be a complete solution I've wanted for decades! Woo! thank you! |
Beta Was this translation helpful? Give feedback.
-
Does it recognize if an .srt file with same name exists and skips it? |
Beta Was this translation helpful? Give feedback.
-
@Purfview Sir, in batch task execution(all parameters are default.), I have encountered an issue where the presence of a silent file in the batch results in a transcription error, leading to the interruption of the entire transcription process. like below Traceback (most recent call last): another issue is when the transcription encounters a corrupted file that cannot be played, it also terminates the entire task. Is there a way to generate empty subtitle files directly when meet such silent files? or automatically skip file causing transcription issues(maybe other unknow issues like a audio file is broken) and proceed to run the next file directly. to prevent the entire process from being interrupted? hope this can be fix in the next version. thx |
Beta Was this translation helpful? Give feedback.
-
It is possible in Windows to allocate global system memory which isnt attached to the calling process. This would mean you could load the model and perform other time consuming one off initialisation on it. The first time the exe was run. Then process and quit the whisper exe. When it was run the next time it could use the model held in memory if it matched the next run arguments. If they arguments where different it could free the global memory and start again. Additionally, you could add an argument to the exe to flush the global memory when finished. This would offer the speed up of batch processing without the downsides. |
Beta Was this translation helpful? Give feedback.
-
^^ That would be a great substitute for lack of batch processing. |
Beta Was this translation helpful? Give feedback.
Every command line program "supports" it.
To be precise, there is nothing to support, just write a command for your command-line interpreter to do a batch processing.
Simplest example for Command Prompt:
for %i in (*.mkv) do whisper-faster.exe --language=en --model=medium %i
This will process one by one every mkv file in a current folder.
NOTE:
It can have significant overhead as it will reload executable and model on every file, so if you have many short files you may want to process them all in one go instead of one by one.
EDIT:
From 134.5 version Whisper-Faster supports batch processing by directory, filelist or wildcard out of the box.
And there is new
--batch_recursive
argument.Few…