Waiting for multiple forks

Questions and answers on how to get the most out of FFAStrans
Post Reply
dylanreeve
Posts: 12
Joined: Fri Aug 19, 2016 4:37 am

Waiting for multiple forks

Post by dylanreeve »

Hi, I have a workflow that splits twice giving me a total of three paths each leading to its own encode and output.

At the end of the workflow I want to delete the source file, but I don't know necessarily which path will complete last and obviously I can't delete the source before it's freed up.

How best do I approach this?

Here's is screenshot:
ffastrans.PNG
ffastrans.PNG (25.32 KiB) Viewed 9985 times
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Waiting for multiple forks

Post by admin »

Hi dylanreeve, thank you for using FFAStrans and welcome to the forum! :-)

First, looking at your screenshot the workflow is invalid. In order to use filters you must place the "A/V Media"-decoder after the "Folder"-monitor. If not your workflow will fail.
Now to your question: Depending on your level of expertise when it comes to batch scripts, you can alway create one that checks if all your output files exists and if they do, delete the original. Or, you can use an undocumented function feature called '$exists("filename")' from within the "Conditional"-node:
2016-08-19.png
2016-08-19.png (17.02 KiB) Viewed 9972 times
Use can use the "Populate variables"-node to contruct your output filenames or you can mimic the file name settings from your "Folder"-delivery node. Pipe all your output nodes to this one followed by a "Command executor" that performs the deletion of your original if the "Conditional"-node succeeds.

Note that the "$exists()"-function is NOT 100% tested but should work and will not cause any harm.

-steinar
dylanreeve
Posts: 12
Joined: Fri Aug 19, 2016 4:37 am

Re: Waiting for multiple forks

Post by dylanreeve »

Thanks.

I realised I was missing the A/V Media decoder when I looked at the screenshot afterward... Oddly the workflow does actually work exactly as expected with the structure shown above, but I will amend it.

Some sort of Wait node would be handy... I could feed all three paths into is and wait for input on all of them, then continue out.

Thanks - I'll test out this conditional with the $exists function.
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Waiting for multiple forks

Post by admin »

:shock: I really don't see how that workflow would work as expected, unless the "A/V Media" is hidden beneath one of the other upper nodes...

-steinar
User avatar
kibi
Posts: 106
Joined: Mon Feb 29, 2016 12:57 pm
Contact:

Re: Waiting for multiple forks

Post by kibi »

The workflow can process without "A/V Media" node in case of *.AVS source files :)
Alexander Sorkin
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Waiting for multiple forks

Post by admin »

Yes of course but that requires very specific conditions in the AVS-file picked up. I think dylanreeve would know this and not find it odd that it works ;-)

-steinar
Post Reply