Javascript EDL reader
-
For a Project I'm working on, I needed to transfer subtitle cues from Adobe Premiere sequences to Isadora.
As Premiere can export an EDL edit list with timecode for IN and OUT marks, based on @DusX 'select line of text' script, I did an EDL reader.In combination with @Woland 's updated version of @fifou 's Timecode trigger actor, I managed to rebuild Premiere cut sequences in no time.
Maybe someone else can use it, so here are the script and a user actor with the named In / Outs:
(This is only tested with Premieres EDL export, with option 'Use Source Filename' on! But should work with other softwares EDL files like FinalCut too.)======================
function main()
{
// reads EDL files and filters values to output them for further use including ClipTitle/ Clip Filename if put to a Note under the basic values// 2 Inputs: 1:File name or path (TEXT); 2:Line to select (INTEGER)
// 10 Outputs: 1:Cues/Cuts total (INTEGER); 2:Cue/Cut # (INTEGER); 3:Media Type (TEXT); 4:Stream Type (TEXT); 5:Transition Type (TEXT); 6:Duration in Seconds (INTEGER); 7:SourceIN (TEXT); 8:SourceOUT (TEXT); 9:RecIN (TEXT); 10:RecOUT (TEXT); 11:Media Title (TEXT)
// arguments[0] = text file name or path
// arguments[1] = line to select
// read EDL file
var txt = read (arguments[0]);// split cue lines to an array and count cues
var Cues = txt.split("\r\n\r\n");
var CuesCount = Cues.length;// split cue values from notes
var ValuesNotes = Cues[arguments[1]].split("\r\n");
var NotesCount = ValuesNotes.length - 1;// split values to an array and count the values
var Values = ValuesNotes[0].split(" ");
var ValuesCount = Values.length;// read the values from the values array
var CueNumber = Values[0];var ValueTyp = Values[2];
var ValueStream = Values[9];
var ValueTrans = Values[14];
var ValueDur = Values[5];
var ValueSourceIN = Values[22];
var ValueSourceOUT = Values[23];
var ValueRecIN = Values[24];
var ValueRecOUT = Values[25];// read the Cue/file name if there is one
if (NotesCount > 0) {
var ClipTitleNote = ValuesNotes[1].split(": ");
var ClipTitle = ClipTitleNote[1];
} else {
var ClipTitleNote = "Undefined";
var ClipTitle = ClipTitleNote;
}// outputs
return [ CuesCount - 1, CueNumber, ValueTyp, ValueStream, ValueTrans, ValueDur, ValueSourceIN, ValueSourceOUT, ValueRecIN, ValueRecOUT, ClipTitle ];}
P.S.: Maybe someone have an idea how to change the script, so it jumps to the Cue# directly and reads the values instead of reading each line separately. (maybe with .StartWith() ?) -
I love seeing material come together from multiple users to create new and interesting tools. Great work!
Best wishes,
Woland
-
@dillthekraut said:
I did an EDL reader.
I got a notification that you edited this post today. We'd love it if you could upload this to the TroikatTronix Add-Ons Page.
-
@woland
It was just an insignifcant typo in the description header.How is a JavaScript template meant to be uploaded to the plugin db? I guess as user actor? There is no specific category like the 'Open GL Shader', which has probably the same work path, or is there? Maybe this is might be worth an extra category, as well for the new Pythoners? Anyway, i'll happily look into it asap.
I would also like to kindly remind on the feature request regarding the search function for the Plug-In DB. -
@dillthekraut said:
How is a JavaScript template meant to be uploaded to the plugin db? I guess as user actor? There is no specific category like the 'Open GL Shader', which has probably the same work path, or is there?
You could go with Category User Actor (or Patch if you want to make an example file) and select the tag "Javascript"
@dillthekraut said:
Maybe this is might be worth an extra category, as well for the new Pythoners?
The Javascript tag has it covered. There's a tag for Python as well, so that's also handled :)
@dillthekraut said:
I would also like to kindly remind on the feature request regarding the search function for the Plug-In DB.
Oh, believe me, I'm waiting on that one too. I'm dying to have it.