CONDITIONAL QUESTION

Questions and answers on how to get the most out of FFAStrans
jhora
Posts: 3
Joined: Sun Dec 01, 2024 8:01 pm

CONDITIONAL QUESTION

Post by jhora »

Hi To All
I'm new here. Amazing Software that you built ...congrats.

I record a lot of *.mov files

2024-11-04_CONCERT.mov
2024-11-06_CONGRESS.mov

I'm trying to build a MP4 transcoding workflow, where after transcoding, it should move the *.mp4 file to CONCERT or CONGRESS folders. I'm trying to work this movement with the file name but without success.
attached are some printscreens
Captura de ecrã 2024-12-01, às 20.15.54.png
Captura de ecrã 2024-12-01, às 20.15.54.png (543.69 KiB) Viewed 8480 times
Captura de ecrã 2024-12-01, às 20.18.20.png
Captura de ecrã 2024-12-01, às 20.18.20.png (266.7 KiB) Viewed 8480 times
It should be something really simple.
tks in advance
Jh
emcodem
Posts: 1855
Joined: Wed Sep 19, 2018 8:11 am

Re: CONDITIONAL QUESTION

Post by emcodem »

Hey Jh, welcome to the forum and thank you for using FFAStrans!

In the Screenshot you sent bottom left you see a little ? symbol, it opens an explainative help (just in case you didnt find that yet).

There are multiple ways to get what you want, the most straight forward might be:

%s_original_name% = *CONCERT*

Your current check only works if the source name literally contains the phrase: CONTAINS "CONCERT". The conditional processor does not support "written" comparison control statements like CONTAINS. The only way to choose how the comparison is done is the middle dropdown that contains the different comparison controls we have (=, regex etc..)

Once everything works as expected, you can check the "Dispel" checkbox at the bottom, this will delete failed decision jobs.

On a sidenote, the way you do it is most natural and beginner friendly, a solid solution. Of course there are advanced ways to do this, which allow to work without a "split" and a copy of all the processors just for the purpose of dealing with 2 different target locations. You could work with user_variables and regex in order to get this done. But there is no need to play with this advanced concepts if your workflow stays as simple as it seems to be currently.
emcodem, wrapping since 2009 you got the rhyme?
jhora
Posts: 3
Joined: Sun Dec 01, 2024 8:01 pm

Re: CONDITIONAL QUESTION

Post by jhora »

Hi emcodem,
Tks a lot. Solved!
missed ? symbol.
I'll continue working on my task!
best
jh
emcodem
Posts: 1855
Joined: Wed Sep 19, 2018 8:11 am

Re: CONDITIONAL QUESTION

Post by emcodem »

Have fun!
emcodem, wrapping since 2009 you got the rhyme?
emcodem
Posts: 1855
Joined: Wed Sep 19, 2018 8:11 am

Re: CONDITIONAL QUESTION

Post by emcodem »

@mahirat
Welcome to the forum and thank you for using FFAStrans!
Of course such things are possible but in order to help you we must know what exactly you want to do, for example to what target paths would your 2 files need to be delivered?

So far you described two filenames, 2024-11-04_CONCERT.mov vs. 2024-11-06_CONGRESS.mov, you can use exactly the same method as you see above, e.g. a conditional and 2 deliver processors.
But i believe what you really want to do is to isolate the date part from the source filename and use it as target delivery folder.

For this, in a populate processor, create a new user_variable and set it to
%s_date_from_input% = $regext("%s_original_name%","(\d\d\d\d-\d\d-\d\d)"). You can then use %s_date_from_input% to construct the target path in the delivery processor.
e.g. you set c:\temp\%s_date_from_input% as target path and 2024-11-04_CONCERT.mov will be delivered to c:\temp\2024-11-04

Let me know the exact relation between your source files and target files so i might be able to come up with some small workflow example for you.
emcodem, wrapping since 2009 you got the rhyme?
artjuice
Posts: 49
Joined: Mon Mar 20, 2023 11:33 pm

Re: CONDITIONAL QUESTION

Post by artjuice »

emcodem wrote: Sun Dec 01, 2024 9:40 pmHave fun!
Hi @emcodem.
I really try to make right conditional by myself, but it's don't work as i expected.
I need to check file name after delivering node, If the filename contains prefix "DGTL_" do POST.
I understand that best will be make it throw $regext("/^dgtl_/i"), but a can't make correct sequence => Deliveries -> Conditional.
2025-02-24_Remote Desktop Manager-005656.png
2025-02-24_Remote Desktop Manager-005656.png (31.03 KiB) Viewed 2586 times
I also try to make it throw populate var => Deliveries -> Populate Variables -> Conditional.
2025-02-24_Remote Desktop Manager-005658.png
2025-02-24_Remote Desktop Manager-005658.png (25.25 KiB) Viewed 2586 times

For now i don't understand correct expression and sequence for if-then-compare :(
emcodem
Posts: 1855
Joined: Wed Sep 19, 2018 8:11 am

Re: CONDITIONAL QUESTION

Post by emcodem »

@artjuice

There is a manual for the functions in the populate processor at bottom, Bold F symbol.
For executing a regex, we need at least 2 things: the input (e.g. filename) and the regex pattern.
Working example:

Code: Select all

$regext("%s_source%","a")
This checks if there is a small "a" in the source file path or name. If you store this to a variable, the variable can be either "a" (if yes) or nothing (if no).

Also, i believe we dont support // and flags in regex but we do incasesensitive anyway. So your regex could work as

Code: Select all

$regext("%s_original_name%","^dgtl")



Copy of Manual for $regext function:

Code: Select all

Usage:

$regext(input string ="string/%variable%", pattern = "string/%variable%"[, input integer = integer/%variable%])

Example 1:

$regext('<Duration value="1214"/>','<Duration value="(\d+)"/>') =

1214

Example 2:

$regext("TVShow_EP0013.mxf", "(EP\d{4})")=

EP0013
emcodem, wrapping since 2009 you got the rhyme?
artjuice
Posts: 49
Joined: Mon Mar 20, 2023 11:33 pm

Re: CONDITIONAL QUESTION

Post by artjuice »

@emcodem

No, don't work, im do something wrong, but don't understand what.

I make easy WF = Monitors Folder -> Conditional (%s_source% equal to $regext("%s_original_name%","^dgtl_")) -> Create text file (where must be only filenames with "DGTL_" prefix).
But have an error: "1st evaluation of \"%s_source% = $regext(\"%s_original_name%\",\"^dgtl_\")\" is \"\\\\ffast1\\ffas_jobs\\test_j\\DGTL_tets2.mxf = \""

I also try to change %s_source% to %s_original_name%
And also make it throw Populate variables, where i map %s_dgtl_prefix% to $regext("%s_original_name%","^dgtl_"), and than use it in Conditional

1st evaluation of \"%s_original_name% = $regext(\"%s_original_name%\",\"^dgtl_\")\" is \"DGTL_tets2 = \""
User avatar
FranceBB
Posts: 275
Joined: Sat Jun 25, 2016 3:43 pm
Contact:

Re: CONDITIONAL QUESTION

Post by FranceBB »

To be fair, if you want the conditional to return "true" for all files starting with "DGTL_", then there's no need to mess with Regext, you can simply do:

if %s_original_name% == DGTL_*

and it's gonna work with a simple conditional. ;)
Screenshot from 2025-02-24 15-13-48.png
Screenshot from 2025-02-24 15-13-48.png (11.09 KiB) Viewed 2549 times
Screenshot from 2025-02-24 15-16-08.png
Screenshot from 2025-02-24 15-16-08.png (3.29 KiB) Viewed 2549 times
Screenshot from 2025-02-24 15-17-38.png
Screenshot from 2025-02-24 15-17-38.png (6.54 KiB) Viewed 2549 times
artjuice
Posts: 49
Joined: Mon Mar 20, 2023 11:33 pm

Re: CONDITIONAL QUESTION

Post by artjuice »

@FranceBB

Yes, it's work.
But i need a more comprehensive approach, and regext satisfies the need.
First of all i want to understand sequence for Conditional - do i need to make user variable, map regext to it, or i can do all in Conditional node?
And where i make mistake in my approach?...

Thx!
Post Reply