• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum
    • Categories
    • Recent
    • Popular
    • Tags
    • Register
    • Login

    Javascript EDL reader

    How To... ?
    2
    2
    848
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DillTheKraut
      last edited by DillTheKraut

      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  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 ];

      }

      EDL Reader.iua


      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() ?)

      1 Reply Last reply Reply Quote 5
      • WolandW
        Woland Tech Staff
        last edited by

        I love seeing material come together from multiple users to create new and interesting tools. Great work!

        Best wishes,

        Woland

        TroikaTronix Technical Support
        New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
        TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
        TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

        | Isadora 3.2.6 | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s |

        1 Reply Last reply Reply Quote 0
        • First post
          Last post