Need help to catch a TimeCode
Need help to catch a TimeCode
Hello,
Well, always on work with FFAStrans and I think I need help.
Here is my goal :
- In Avid Media composer, put a (or maybe 2)locator (a mark in the tineline) on the timeline. Export video file and export txt file with Timecode of this (these) locator(s).
- I have 1 video file and 1 text file contains name of locator and Timecode where locator is.
I want to catch this files with FFAStrans, open the text file to see the tc (or the two TC), take my video file and cut it where is the timecode(s) and deliver the 2 or 3 video files.
Ok not very easy. My problem is how catch this damn Timecode. I thought I have to populate variable to this TC but how?? This TC isn't always the same.
More, when I use the $read function, how choose what string use?
Well, if someone knows how begin I will be grateful.
Cheers.
Benjamin
Well, always on work with FFAStrans and I think I need help.
Here is my goal :
- In Avid Media composer, put a (or maybe 2)locator (a mark in the tineline) on the timeline. Export video file and export txt file with Timecode of this (these) locator(s).
- I have 1 video file and 1 text file contains name of locator and Timecode where locator is.
I want to catch this files with FFAStrans, open the text file to see the tc (or the two TC), take my video file and cut it where is the timecode(s) and deliver the 2 or 3 video files.
Ok not very easy. My problem is how catch this damn Timecode. I thought I have to populate variable to this TC but how?? This TC isn't always the same.
More, when I use the $read function, how choose what string use?
Well, if someone knows how begin I will be grateful.
Cheers.
Benjamin
Re: Need help to catch a TimeCode
Hello,
Well I'm come back to specify that I succeed to split my video file in 2 parts but I specify the beginning of the file 1 and its end. I know also the beginning of file 2 .
Anyway I just find how catch the TC where begin the file 2 (which comes in text file), populate this TC in a variable and tell to ffmpeg where cut the file. It could be work in theory
To resume, I have to catch the timecode in text file and make it variable.
Cheers
Well I'm come back to specify that I succeed to split my video file in 2 parts but I specify the beginning of the file 1 and its end. I know also the beginning of file 2 .
Anyway I just find how catch the TC where begin the file 2 (which comes in text file), populate this TC in a variable and tell to ffmpeg where cut the file. It could be work in theory
To resume, I have to catch the timecode in text file and make it variable.
Cheers
Re: Need help to catch a TimeCode
What kind of text file is it, XML?
-steinar
-steinar
Re: Need help to catch a TimeCode
Really simple txt file which can be export by Avid Media composer (locators on timeline and export markers with txt file).
(Don't know how join a file) Maybe a link :
http://dl.free.fr/mYuPvDTsg
Thanks
(Don't know how join a file) Maybe a link :
http://dl.free.fr/mYuPvDTsg
Thanks
Re: Need help to catch a TimeCode
Ok, so you need to populate a user variable with the contents of the file:
%s_my_avid_file% = $read("C:\My avid folder\UNITE42.TXT")
Then you populate another variable as:
%s_my_tc% = $between("%s_my_avid_file%", "ctvf2avidtech ", " V1 red ", 2)
You can do both operations in the same "Populate"-node.
In the text file there are 3 instances of TC encapsulated with identical strings. The last parameter 2 in the $between()-functions tells FFAStrans to get the second instance of contents of strings between "ctvf2avidtech " and " V1 red ". The spaces in the text file are TABs.
instance 1: ctvf2avidtech 01:00:00:00 V1 red cdb 1
instance 2: ctvf2avidtech 01:00:25:06 V1 red pk 1
instance 2: ctvf2avidtech 01:00:31:24 V1 red ad 1
Hope this helps.
-steinar
%s_my_avid_file% = $read("C:\My avid folder\UNITE42.TXT")
Then you populate another variable as:
%s_my_tc% = $between("%s_my_avid_file%", "ctvf2avidtech ", " V1 red ", 2)
You can do both operations in the same "Populate"-node.
In the text file there are 3 instances of TC encapsulated with identical strings. The last parameter 2 in the $between()-functions tells FFAStrans to get the second instance of contents of strings between "ctvf2avidtech " and " V1 red ". The spaces in the text file are TABs.
instance 1: ctvf2avidtech 01:00:00:00 V1 red cdb 1
instance 2: ctvf2avidtech 01:00:25:06 V1 red pk 1
instance 2: ctvf2avidtech 01:00:31:24 V1 red ad 1
Hope this helps.
-steinar
Re: Need help to catch a TimeCode
Ok thank you very, very much, it helps me so much!! I understand now how I can use variable and send it elsewhere.
I have a question anyway, is it possible to check if my variable "takes"well the good value? I tried to put a text file node behind the populate node and write %s_my_tc% in the text zone but my text file created is empty.
One thing, in help function, in description of $between function, the variable to populate is "integer"not static, mistake?
"$between(input string = "string/%variable%", from string = "string/%variable%", to string = "string/%variable%"[, instance found= integer/%i_variable%])"
Thanks a lot I 'm really happy to improve.
Cheers.
EDIT : I tried step by step but I'm not sure that the between function works. If I have only my TC in text file, it's ok. If I tried to select a specific string in my text file with between function, it failed...Damn!!
I have a question anyway, is it possible to check if my variable "takes"well the good value? I tried to put a text file node behind the populate node and write %s_my_tc% in the text zone but my text file created is empty.
One thing, in help function, in description of $between function, the variable to populate is "integer"not static, mistake?
"$between(input string = "string/%variable%", from string = "string/%variable%", to string = "string/%variable%"[, instance found= integer/%i_variable%])"
Thanks a lot I 'm really happy to improve.
Cheers.
EDIT : I tried step by step but I'm not sure that the between function works. If I have only my TC in text file, it's ok. If I tried to select a specific string in my text file with between function, it failed...Damn!!
Last edited by momocampo on Tue Feb 27, 2018 4:52 pm, edited 1 time in total.
Re: Need help to catch a TimeCode
Normally you can check what kind of data your variable has been populated with by testing it against an empty string in the "Conditional" node. That way you can monitor it instantsly in the status monitor.
No, it's not a mistake but a static is equally valid as long as the static represents an integer.
-steinar
No, it's not a mistake but a static is equally valid as long as the static represents an integer.
-steinar
Re: Need help to catch a TimeCode
Ok so it doesn't work. The conditional node back to me "success"
Populate is :
%s_conttxt% to $read("C:\Users\Benjamin\Desktop\ffmpeg\bin\test.txt")
%s_tcfound% to $between("%s_conttxt%","test3","test4",2)
Conditional node is :
%s_tcfound% is equal to
Text file (text.txt)is just:
test1 00:00:25:08 test2
test3 00:00:55:08 test4
Monitor said success....
If I add a generated text file node behind, my text file is empty.
I think there is something wrong but I don't see where.
EDIT : After several tries, I discover that the "2"for the second instance doesn't work. If I just remove it I have "error populating string may be too long"
If I remove the 2 and tab, It works. I have 00:00:55:08.
I succeed using $left and $right but less convenient... but maybe there is a bug with tab.
Thanks.
Populate is :
%s_conttxt% to $read("C:\Users\Benjamin\Desktop\ffmpeg\bin\test.txt")
%s_tcfound% to $between("%s_conttxt%","test3","test4",2)
Conditional node is :
%s_tcfound% is equal to
Text file (text.txt)is just:
test1 00:00:25:08 test2
test3 00:00:55:08 test4
Monitor said success....
If I add a generated text file node behind, my text file is empty.
I think there is something wrong but I don't see where.
EDIT : After several tries, I discover that the "2"for the second instance doesn't work. If I just remove it I have "error populating string may be too long"
If I remove the 2 and tab, It works. I have 00:00:55:08.
I succeed using $left and $right but less convenient... but maybe there is a bug with tab.
Thanks.
Re: Need help to catch a TimeCode
Ah, well you don't have 2 instances of strings between "test3" and "test4", just the one. If you have 2 or more your text would look something like:
test1 00:00:25:08 test2
test3 00:00:55:08 test4 (1'st instance)
test3 00:01:25:15 test4 (2'nd instance)
test3 00:02:51:21 test4 (3'rd instance)
Here you have 3 instances of strings between "test3" and "test4" and the function should (in your case) return "00:01:25:15". Hope this clarifies.
-steinar
test1 00:00:25:08 test2
test3 00:00:55:08 test4 (1'st instance)
test3 00:01:25:15 test4 (2'nd instance)
test3 00:02:51:21 test4 (3'rd instance)
Here you have 3 instances of strings between "test3" and "test4" and the function should (in your case) return "00:01:25:15". Hope this clarifies.
-steinar
Re: Need help to catch a TimeCode
Hello Steinar,
OK, I'm going to be the most clear as possible. I have all my texts files in this form:
"ctvf2avidtech 01:00:33:24 V2 red 1ctvf2avidtech 01:00:40:20 V2 red 1"
The spaces are 1 tab except between "red" and "1" which is 2 tabs.
If I use the between function to catch the first timecode ($between("%s_conttxt%", "ctvf2avidtech","V2")) the monitor says "Job ended with error on Populate variables@DESKTOP-5U981AC: Error populating %s_file% with $between("%s_conttxt%", "ctvf2avidtech","V2", 2). String may be too long"
Same thing with $between("%s_conttxt%", "ctvf2avidtech","V2",2) to catch the second timecode.
That's why I suppose there is a bug with tab.
If I remove the tabs in my text file,use space and catch the first tc ($between("%s_conttxt%", "ctvf2avidtech","V2")) the result is "" 01:00:33:24 "" With $between("%s_conttxt%", "ctvf2avidtech","V2",2) result is "" 01:00:40:20 ""
To succeed with space I have to use :"$between("%s_conttxt%", "ctvf2avidtech "," V2")" --->with a space after ctvf2avidtech and a space before v2(result is ok 01:00:33:24)
Same thing for second timecode :"$between("%s_conttxt%", "ctvf2avidtech "," V2",2)" result is well 01:00:40:20
You can try but I really think a little bug is present.
Thanks and sorry for this annoyance
Regards.
OK, I'm going to be the most clear as possible. I have all my texts files in this form:
"ctvf2avidtech 01:00:33:24 V2 red 1ctvf2avidtech 01:00:40:20 V2 red 1"
The spaces are 1 tab except between "red" and "1" which is 2 tabs.
If I use the between function to catch the first timecode ($between("%s_conttxt%", "ctvf2avidtech","V2")) the monitor says "Job ended with error on Populate variables@DESKTOP-5U981AC: Error populating %s_file% with $between("%s_conttxt%", "ctvf2avidtech","V2", 2). String may be too long"
Same thing with $between("%s_conttxt%", "ctvf2avidtech","V2",2) to catch the second timecode.
That's why I suppose there is a bug with tab.
If I remove the tabs in my text file,use space and catch the first tc ($between("%s_conttxt%", "ctvf2avidtech","V2")) the result is "" 01:00:33:24 "" With $between("%s_conttxt%", "ctvf2avidtech","V2",2) result is "" 01:00:40:20 ""
To succeed with space I have to use :"$between("%s_conttxt%", "ctvf2avidtech "," V2")" --->with a space after ctvf2avidtech and a space before v2(result is ok 01:00:33:24)
Same thing for second timecode :"$between("%s_conttxt%", "ctvf2avidtech "," V2",2)" result is well 01:00:40:20
You can try but I really think a little bug is present.
Thanks and sorry for this annoyance
Regards.