Page 1 of 3
Panasonic P2
Posted: Mon Apr 19, 2021 4:02 pm
by lieberreich
Hi! I have some troubles with Panasonic P2 workflow. I'm trying to use command executor in order to delete original media (or whole CONTENTS folder) after compression, but all commands can return only path to XML file or folder name. I'll be gratefull if someone can help me to find a solution.
TXT Node
1-%s_original_drive%
2-%s_original_folder%
3-%s_original_full%
4-%s_original_path%
5-%s_original_root%
6-%s_pickup_file%
7-%s_recursed_path%
Result
1-D:
2-\!in\CONTENTS\CLIP
3-D:\!in\CONTENTS\CLIP\0006KN.XML
4-D:\!in\CONTENTS\CLIP
5-D:
6-D:\!in\CONTENTS\CLIP\0006KN.XML
7-
Re: Panasonic P2
Posted: Mon Apr 19, 2021 4:13 pm
by emcodem
Hey there,
welcome to the forum and thank you for using FFAStrans! Good to have you here
try %s_original_path~1%
https://ffastrans.com/wiki/doku.php?id= ... _variables
Re: Panasonic P2
Posted: Mon Apr 19, 2021 4:26 pm
by lieberreich
it won't help either. Already tried
Re: Panasonic P2
Posted: Mon Apr 19, 2021 4:30 pm
by emcodem
Hm should help... Whats the value of %s_original_path~1% in your Text file?
Re: Panasonic P2
Posted: Mon Apr 19, 2021 4:34 pm
by lieberreich
emcodem wrote: ↑Mon Apr 19, 2021 4:30 pm
Hm should help... Whats the value of %s_original_path~1% in your Text file?
There are no problems with txt. I need to compress a lot of P2 files and delete original media. workflow looks like p2->h264->folder->command executor. When im trying to use %comspec% /c"del /f /q "%s_original_full%"" it deletes only xml files, but i need some solution to get MXF through command executor
Re: Panasonic P2
Posted: Mon Apr 19, 2021 4:38 pm
by emcodem
I understood that, no worries. Wanna know the returned value from %s_original_path~1%
Re: Panasonic P2
Posted: Mon Apr 19, 2021 4:46 pm
by lieberreich
before %s_original_path~1%
4-D:\!in\CONTENTS\CLIP
after %s_original_path~1%
CLIP
I can use "path~n" to navigate backwards in folders, but can't use del function because it may still render other media in contents folder
path~n can return only a name of (~n back steps) folder
Re: Panasonic P2
Posted: Mon Apr 19, 2021 4:53 pm
by emcodem
Hehe my Bad :d
I'll Post some example for you later, Hard to Do on mobile
Re: Panasonic P2
Posted: Mon Apr 19, 2021 4:57 pm
by lieberreich
emcodem wrote: ↑Mon Apr 19, 2021 4:53 pm
Hehe my Bad :d
I'll Post some example for you later, Hard to Do on mobile
Thank you! Long story short - i just want to delete mxf related to xml after h.264 node in order to save space on hard drive. I dont care much about empty folders, because they can be deleted via timer at night for example.
Re: Panasonic P2
Posted: Mon Apr 19, 2021 6:07 pm
by emcodem
Ok, so a little regex magic should help us here. There are 2 little problematic spots:
1) you need to "hardcode" your "base watchfolder" into the regex in the populate variables node, so the code is actually not 100% reuseable unfortunately, you cannot really use it for multiple watchfolders in the same workflow. If you want to do so, you'd need to at least guarantee that the number of folders in the watched directories is always the same. Like first watchfolder is on \\server\share\path, second on \\server\share2\anotherpath
2) when inserting your path into the regex, all backslashes must be doubled
So, to get out the "first folder" after your watchfolder, you can do like this:
Code: Select all
$regext("%s_source%","C:\\!in\\.+?\\")
Another option:
As should will always be a CONTENTS folders in P2, you could get it like this so you just always delete the CONTENTS folder, no matter in what subdir it is and you dont underly above mentioned restrictions.
Code: Select all
$regext("%s_source%",".+?CONTENTS\\")
...It depends a little on how exactly you expect the subfolder structure in c:\!in to look like.
A pro pos, ja, ich wäre auch lieber reich