Hello, I would like to know if someone knows a way of to run ffmpeg in several instances in parallel in windows. For example I want to convert several audio of a series but only with that is turn of 1 at the same time, using an only core of them 6 that can use. Already try using the program ppx2 that emulates the utility Xargs of linux but always me returns an error.Regret if not you can read well as use a translator.
Thank you.
example script in bat file
set /p format=original format:
set /p q=quality:
for %%a in (*.%format%) do "ffmpeg.exe" -i "%%~na" -vn -c:a libvorbis -q %q% "output folder\%%~na.ogg"
+ Reply to Thread
Results 1 to 9 of 9
-
Last edited by arielacade; 29th Aug 2016 at 22:42.
-
At the command line type:
Code:Start Name ffmpeg.exe (rest of command line)
-
Last edited by arielacade; 29th Aug 2016 at 22:53.
-
You can use START in a batch file the same way you use any other program.
for %%a in (*.%format%) do START "%%~na" "ffmpeg.exe"...
The problem is that you'll need a way to limit the number of simultaneous instances. Ie, if there are 100 files to be processed you don't want to start all 100 at once. Maybe you could add a delay between each instance. For example, if you know each is going to take 5 minutes, add a 1 minute delay between each START. That way you'll only have 5 instances running at a time. -
Modified .bat
Code:@echo off Setlocal EnableDelayedExpansion set /p format=original format: set /p q=quality: set /a counter=0 for %%a in (*.!format!) do IF !counter! LSS 5 ( start ffmpeg.exe -i "%%a" -vn -c:a libvorbis -q %q% "%%~na.ogg" set /a counter=counter+1 ) ELSE ( start /w ffmpeg.exe -i "%%a" -vn -c:a libvorbis -q %q% "%%~na.ogg" set /a counter=0 )
-
great idea to stop process at certain item, ..., I just had an idea that /w could be variable besides creating a subroutine, because process could be complex and using parentheses is always a trap in a sense using batch script, things get simple and subroutine can have other subroutines within if too complex etc.
Code:@echo off set /p format=original format: set /p q=quality: set /a counter=0 set "sign=NORMAL" for %%a in (*.%format%) do CALL :encode "%%a" pause exit :encode <audio file> start /%sign% ffmpeg.exe -i "%~1" -vn -c:a libvorbis -q %q% "%~n1.ogg" set /a counter = %counter% + 1 if [%counter%]==[5] set "sign=WAIT" goto :eof
-
Many thanks, this command worked perfectly. That is only a bit uncomfortable that is there will be so many windows cmd but that is one minor detail and as don't want to collapse my processor change [5] by [4] to realize 5 processes in simultaneous.
Thanks to all for answering. -
Similar Threads
-
Can I run TWO ffmpeg processes in parallel?
By pxstein in forum Newbie / General discussionsReplies: 4Last Post: 22nd Nov 2015, 01:47 -
Parallel Video Processor FAQ and help thread
By p-v-p in forum Video ConversionReplies: 0Last Post: 11th Aug 2014, 13:00 -
mencoder/mplayer audio parallel extract possible?
By Selur in forum Newbie / General discussionsReplies: 0Last Post: 19th Aug 2013, 09:59 -
ffmpeg audio parallel extract possible?
By Selur in forum Newbie / General discussionsReplies: 3Last Post: 19th Aug 2013, 09:41 -
Cpu Drainage by Unknown processes
By krooker in forum ComputerReplies: 1Last Post: 26th Jan 2012, 22:06