Page 1 of 1

concat files in growing folders - possible?

Posted: Thu Mar 23, 2017 3:51 pm
by ThomasM
Hi to everybody,

from the depth of archiving-jobs it´s me again...

simplified:

I got many folders with .MOV-clips:
>Folder_01
>Clip 01.MOV
>Clip 02.MOV
...
>Clip n.MOV
>Folder_02
>Clip 01.MOV
>Clip 02.MOV
...
>Clip n.MOV
...
>Folder_n
>Clip 01.MOV
>Clip 02.MOV
...
>Clip n.MOV

The processing should be like this:
- check number of .MOV-clips in each Folder
- concat Clips from Folder_01 to one file (FolderContent_01.MOV)
- concat Clips from Folder_02 to one file (FolderContent_02.MOV)
- concat Clips from Folder_n to one file (FolderContent_n.MOV)

I have set MAX ACTIVE JOBS to 4 in the prefs. Is it likely that one folder gets prepared despite the fact that it is already in progress?

In Depth:
I have a watchfolder in which for each Film there is a sub-Folder created with the film-Number
In the Monitor-Folder-Node I have RECURSE and CHECK FOR GROWING FOLDERS enabled.
Next Node is a COMMAND-EXECUTOR-NODE with %comspec% /c "ren "%s_original_full%" "%s_original_name%.mov"" because the original Filenames have no extension. But I need it for archival purposes. And this works.

Now the complication begins.

How can I tell FFAStrans to concate them as described above? First I though, it would be simple with variables, but I can´t get it to work. Then I tried to write the Filenames in a .txt-file for each File in a Folder with the same Folder-Structure.

But I do not know how to retain the Filepath from the Text-File

AND

I do not really know how to tell FFAStrans to concate them in case of different clip-counts in each folder... I mean, the names are quiet the same in each folder as described above, but one Folder has only one clip, the other may have 4 or 12 or whatever.

How to solve this?

thanks in advance,

tom

Re: concat files in growing folders - possible?

Posted: Thu Mar 23, 2017 7:50 pm
by admin
As far as I can see there are two ways of approaching this task:
  • 1. Create a custom script that accept arguments. This script can be executed from within FFAStrans. The script must evaluate in a loop whether file(s) exists, and if they do, echo them into a textfile. This file is written to a location of your choice.
  • 2. Create a huge workflow with the largest number of evaluations of file exist you think you may encounter. All the "Conditional" nodes must have a "Generate text file" node attached that has a prepopulated number of *.mov instances to match the last evaluation. This file is written to a location of you choice.

    To check if file exist in the "Conditional" node use the new $exists() function available in 0.8.0, f.ex:
    If $exists("%my_file_name_variable%_04.mov") = 0 Then....execute the "Generate text file" node with 3 .mov files

    This function can also be used to find the number of existing files that match a pattern:
    $exists("%my_file_name_variable%_*.mov")

    In both cases the functions returns the number of files found.

    Functions can be used in the "Conditional" and "Populate variables" nodes.

With both these approaches you will end up with a text file that holds the files to concatenate. When that's done you can use this text file as input to a ffmpeg command. But, it will have to be created using "Command executor", not the "Custom FFmpeg" encoder since the latter don't accept concat-files.

Now, I'm not going to create the workflow for you but I hope this will give you some good ideas :-)

-steinar

Re: concat files in growing folders - possible?

Posted: Tue Mar 28, 2017 2:58 pm
by ThomasM
steinar,

thank you for your kind response. I was afraid that exact this would happen - command line .bat -programming... brrrrrr......

Okay, I will give it a try. I let you know if and how I can get it to work.

regards,

tom

Re: concat files in growing folders - possible?

Posted: Wed Mar 29, 2017 6:19 pm
by admin
If you learn the basics of scripting and using variables and functions you will master FFAStrans better ;-)

-steinar

Re: concat files in growing folders - possible?

Posted: Tue Apr 04, 2017 12:55 pm
by ThomasM
yesssss....... still practising! ;)

tom