Same GUID to 2 different files types with same filename

Questions and answers on how to get the most out of FFAStrans
Post Reply
jonathonz
Posts: 11
Joined: Wed Jan 16, 2019 2:57 am

Same GUID to 2 different files types with same filename

Post by jonathonz »

Hi,

I'm trying to setup my first workflow in FFAStrans which will take in via watch folder:

Filename_1.wav
Filename_1.xml

It needs to process just the WAV file, convert it to MP3 (plus loudness) and put in a drop folder with a GUID appended to filename as Filename_1_GUID.wav
It also needs to process the XML file with the same filename and rename it to the Filename_1_GUID.xml

The GUIDs stamped to both files need to be the same, as the file names must match for further processing down the line by another application.

I've tried a few different ways of doing this, particularly by generating a GUID, storing it to a user variable, and trying to use that variable for both files via either two watch folders with the second watch folder filtered to accept only .XML files with the source file name without extension of the first .WAV file, or conditional statements "if .XML then" and "if .wav then" and then generating the variable after if WAV file and referencing that to both the "if XML" and the output folder blocks. However both methods result in the XML file with a file name that is literally "Filename_1_%s_guid%.xml". As in it's not putting in the stored variable, just the literal variable itself.

Here is the results of the output folder:
The attachment variables.png is no longer available
Any ideas a simple way to do this seemingly simple task?

Here's a pic of how I tried (but failed) to apply the variable. I originally applied the set variable output just to two places, but started hitting multiple places as it kept not working.
variables.png
variables.png (4.75 KiB) Viewed 8699 times
I seem to be missing how to get the variable to be applied properly.

Thanks everyone!
Attachments
2019-01-16 11_22_29-FFAStrans Workflow Manager.png
2019-01-16 11_22_29-FFAStrans Workflow Manager.png (44 KiB) Viewed 8699 times
emcodem
Posts: 1631
Joined: Wed Sep 19, 2018 8:11 am

Re: Same GUID to 2 different files types with same filename

Post by emcodem »

hi, could you please upload your workflow xml?

cheers, emcodem
emcodem, wrapping since 2009 you got the rhyme?
jonathonz
Posts: 11
Joined: Wed Jan 16, 2019 2:57 am

Re: Same GUID to 2 different files types with same filename

Post by jonathonz »

Hi,

I simplified the workflow but still seeing the same issue.

Not sure how to pass a variable onto a different branch of the tree.

Workflow attached.
Attachments
TO MP3 -16 LUFS w GUID.xml
(21.43 KiB) Downloaded 325 times
emcodem
Posts: 1631
Joined: Wed Sep 19, 2018 8:11 am

Re: Same GUID to 2 different files types with same filename

Post by emcodem »

OK, i got it.
Unfortunately currently (and most likely in future) you need to see each branch of the tree as a completely separate job, branches do not share any variables besides the ones from their common main branch. So you need to set your guid variable on the main branch, before you break up into branches.
If it was different, how could it work to set %s_original_ext% to xml in one and to wav in the other branch...

Typically as a developer, i recommend to set your static variables as first thing in your program(/worfklow) anyway... So in my head, you insert one populate vars after your watchfolder and after that you break into branches. This first populate variables sets variables for all the stuff you use later, e.g. guid, output directories etc... This way you have all the stuff a user can change at one point.

I guess you understood, but just to be sure, here an example:
doublevar.xml
(8 KiB) Downloaded 319 times
cheers,
emcodem
emcodem, wrapping since 2009 you got the rhyme?
jonathonz
Posts: 11
Joined: Wed Jan 16, 2019 2:57 am

Re: Same GUID to 2 different files types with same filename

Post by jonathonz »

I get what you're saying, and it confirms what I suspected. However even if I generate a GUID before branching out I end up with two different GUIDs as the .xml and .wav are treated as two different files, I guess as they are two different files.


2019-01-16 15_34_47-FFAStrans Workflow Manager.png
2019-01-16 15_34_47-FFAStrans Workflow Manager.png (52.56 KiB) Viewed 8679 times
Attachments
TO MP3 -16 LUFS w GUID at top.xml
(21.46 KiB) Downloaded 313 times
emcodem
Posts: 1631
Joined: Wed Sep 19, 2018 8:11 am

Re: Same GUID to 2 different files types with same filename

Post by emcodem »

Well, you want to wait for wav and xml in the first branch. So just reconfigure your watchfolder to "*.wav" ONLY and wait until the *.xml exists by using a "Operations->Hold" node and wait for the other file to exist...
emcodem, wrapping since 2009 you got the rhyme?
jonathonz
Posts: 11
Joined: Wed Jan 16, 2019 2:57 am

Re: Same GUID to 2 different files types with same filename

Post by jonathonz »

Please forgive my lack of sophistication around this : ) And thank you for time and assistance!

However, when I tried this I get an error that the job timed out while waiting for files.

Perhaps I'm approaching this the wrong way, but essentially, I need to take two input files with same name, different extensions (.wav and .xml), convert one of them to .mp3 with custom FFMPEG loudnorm parameter, and then append a GUID to both the .mp3 and .xml file names and drop both into an output folder and/or FTP.

I had split into two branches with conditional "if .wav" and "if .xml" as I need the .xml NOT to be processed by the FFMPEG part but still moved along with the first file. Hence the two branches.

Could the core of the problem be that I'm trying to handle two files as one, effectively?
emcodem
Posts: 1631
Joined: Wed Sep 19, 2018 8:11 am

Re: Same GUID to 2 different files types with same filename

Post by emcodem »

Hmmm as you seem to be pretty familiar with the use of variables, and from your last sentences, unfortunally i was not able to get what's your remaining problem. Here is some example workflow that shows the usage of processors and variables in the way you need it:
jonathan.xml
(14.28 KiB) Downloaded 329 times
P.S. you could/should maybe use the type "static" instead of "variable" for the outputfolders, in case multiple workflows need to deliver to the same folders ;-) "static" is like "super-global"... "statics" are read-only globally for all workflows. Instead "variables" are set per workflow, derived by a branch but as soon as the branch starts, they are private for the current branch.
It just looks odd in the GUI when multiple branches end up in one single processor again; actually this is kind of a display error as the processor will be executed once per branch, so in real, the branches do not merge into one again but execute separately.

My recommendation is that you build your workflows like this: do not connect multiple branches into one again but insert the processor in question multiple times. This way the GUI representation of a workflow actually shows you how it is executed in reality.

Cheers,
emcodem
emcodem, wrapping since 2009 you got the rhyme?
jonathonz
Posts: 11
Joined: Wed Jan 16, 2019 2:57 am

Re: Same GUID to 2 different files types with same filename

Post by jonathonz »

emcodem,

Thanks for all the tips. I've changed my representation and my workflow and have put the GUID labeling on the shelf for the moment. The important parts are of the workflow are working, and that's all that matters.

Take care,

-Jonathon
Post Reply