[FEATURE REQ] Queues & Loops
jorgebr opened this issue · 2 comments
The latest improvements (set shell priorities and window titles, automatically generate filenames based on encoding & other options, etc.), allow one to quickly set up and run multiple jobs.
It is so easy that now we run into a new problem -- many shell windows open but there's only a limited number of shell priority values. So, for example, in my workflow I end up having one process belownormal
and all the other ones low
, and then manually over time "upgrade" one of the low
process to belownormal
as processes complete.
I can think of two ways to help deal with this.
Manual Queues
It would be amazing to have a "Queue" function where jobs can be run in sequence in the same shell window.
- First you need the concept of a "queue"... one queue entry = the current script. Perhaps have a "Add to Queue" button to add the current script to the queue.
- At the end you need a "Run Queue" button that executes all those scripts sequentially in the same DOS or Powershell window.
This would allow someone, for example, to quickly queue runs for different CRF values.
A more complex approach, trying to build "from" "to" and "step" values for different parameters, would be way too complicated ... would add too much to the UI.
Of course, it would be nice to have a way to "see the queue" and edit it (for example to remove a job added by accident). A button "Edit Queue" (or perhaps "Show Queue Script" or "Show Queue") could show the queue in the script text field, which already allows edit. If the script field text color is changed, perhaps to bright yellow, it would be a clear visual indicator that the script you are now looking at is the Queue.
Ideally there would also be another button called "Replace Queue" which then replaces the queue with the text in the script field. Having a separate "Add Queue" button is still useful, for example, to use the current queue as a template to make some quick changes, and add to the queue again.
So in summary, I'm thinking a new set of buttons in a new boxed section titled "Queue": Edit, Add, Replace, Run
Loop code: entire directory or wildcards
- Allow wildcards in the input textbox.
An entire directory is just a special case, equivalent toc:\path\to\*.*
- Or you could get fancier, and if the Input textbox is just a path with no filename component, generate the
*.*
string automatically.
Sample code I use for this:
FOR /F "usebackq delims=" %%f IN (`dir /b /s "c:\path\to\Wild Kr*S02E*.mkv" ^| sort`) DO (
TITLE "%%~nxf" & ^
START "" /b /wait /LOW "C:\path\to\Axiom 1.9.2.0\ffmpeg\bin\ffmpeg.exe" ^
-n -i "%%f" -c:v libx265 -preset superfast -crf 30 -pix_fmt yuv420p ^
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -map 0:v:0? -map_chapters 0 ^
-c:s mov_text -map 0:s? ^
-c:a copy -map 0:a? -map_metadata 0 -f mp4 -threads 0 ^
"%dest%\%%~nf 1080p x265 CRF30 p-super-fast yuv420p AAC.mp4"
)
c:\path\to\Wild Kr*S02E*.mkv
would come from the Input textbox- Note this is cmd batch file so use of double
%
and escape pipe (^|
)before sort. Sort is a cute tweak, just so that by looking at the title of the window, I can see how much of the queue has been processed. delims=
is necessary so DOS handles filenames with spaces.- Note the
/s
parameter todir
so that all sub-directories are included...that's optional.
So if the Input text box has wildcards or no filename, you generate loop code. That's it.
I recommend disabling the "Convert" button in this case (not re-enabled until Input text field has a proper filename with no wildcards), so that a basic user doesn't set off a big loop accidentally.
So in this case, only the "Script" button is enabled, allowing a user to see the generated loop code in the Script text box.
This use case could be implemented stand-alone -- it's completely separate from the "Queue" idea above. However, if the queue idea is implemented, this case can work along with it. All the Queue buttons as above could still work, so one can queue a loop along with single-file jobs, or just run the loop as a single job.
I will have to look into this.
I have already planned a feature called Jobs, which will queue jobs with their selected settings to a list. It would then process each one, running ffmpeg.exe
directly through Axiom, and piping the terminal's output to a textbox, instead of passing it to cmd.exe
. However this feature is far away.
That looks great ... but after thinking about it overnight, I'm now leaning that jobs/queues may not be worth it. One could just copy each script, and paste it cumulatively into a text batch file, which is then run manually in the shell. One could add an "echo ==================" in between each "job" to easily be able to look at the output later.
That's what I'll do from now on.
On the other hand, for those that don't do command line at all, it definitely adds value.
The "Loops" suggestion, though, I think is still valid, and I think simpler to implement, no?