Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
SONY VEGAS: Sony Vegas TutorialsSony Vegas ForumArticlesBasics ForumBlack Magic Design ForumAJA Xena Forum

Re: import Vegas edl into FCP - ?

Cow Forums : Sony Vegas
VIEW POSTS   •   ADD A NEW POST   •   SEARCH   •   CHANGE FORUM
Respond to this post   •   Return to posts index   •   Read entire thread


Re: import Vegas edl into FCP - ?
by Elvir Surkovic on Jul 4, 2008 at 11:52:35 am

I had to solve the same problem for my company. The problem is in the EDL file generated by Vegas, which does not fit FCP EDL file expected.
So I developed vb script to correct the EDL file generated by Vegas to fit expected FCP EDL format.
First, export edl as you did, then start this script to make necessary corrections (Tools->Scripting->Run Script).

Save this script text to text file, which must have an .vb extension:

---------------------------------------------Script Start----------------------------------------------

Imports System.Windows.Forms
Imports System
Imports Sony.Vegas
Imports System.IO
Imports System.Array

Public Module MainModule
Sub Main
Const fileTag As String = "_BHRT.EDL" 'Change original EDL filename to indicate sucessfull script operation
Dim openFileDialog1 As New OpenFileDialog()
Dim inFile As String
Dim outFile As String

openFileDialog1.InitialDirectory = "c:"
openFileDialog1.Filter = "edl files (*.edl)|*.edl"
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = True

'MessageBox.Show("hello world")
'openFileDialog1.ShowDialog()
If openFileDialog1.ShowDialog() = DialogResult.OK Then
inFile = openFileDialog1.FileName
If Not (inFile Is Nothing) Then
' Insert code to read the stream here.
outFile = inFile.Remove(inFile.Length - 4) + fileTag
Dim files As FileClass = New FileClass(inFile, outFile, "")
files.pullLines()
files.pullClips()
files.closeFiles()
My.Computer.FileSystem.DeleteFile(inFile)
End If
Else
Application.Exit()
End If




End Sub



Public Class FileClass

Const EDL_Identifier As String = "* FROM CLIP NAME:" 'Do not change this constant
Const EDL_IdentifierCorrection As String = " " 'Do not change this constant
Const EDL_FilesExtension As String = ".MOV" 'Change this constant to your video files extension (.avi,...)
Const EDL_ReelOld As String = "UNKNOWN" 'Do not change this constant
Const EDL_ReelPrefix As String = "FC" 'Prefix to reel names in EDL list (You can change this constant as you wish)

Private f1Stream As FileStream ' file: originalni EDL
Private f1Reader As StreamReader '
Private f1Name As String
Private f2Stream As FileStream ' file: novi EDL
Private f2Reader As StreamWriter '
Private f2Name As String
Private f3Stream As FileStream ' file: log
Private f3Reader As StreamWriter '
Private f3Name As String

Private linesListArr As String()
Private linesList_TagArr As String()
Private linesIndex As Integer = 0
Private linesEnd As Boolean = False
Private clipsTmpArr As String()
Private clipsListArr As String()

Private linesEDLArr As String()




Public Sub New(ByVal p1FileName As String, ByVal p2FileName As String, ByVal p3FileName As String)
f1Name = p1FileName
f2Name = p2FileName
f3Name = p3FileName

Try
If (p1FileName IsNot Nothing) And (p1FileName <> "") Then
f1Stream = New FileStream(f1Name, FileMode.Open, FileAccess.Read)
f1Reader = New StreamReader(f1Stream)
End If

If (p2FileName IsNot Nothing) And (p2FileName <> "") Then
f2Stream = New FileStream(f2Name, FileMode.OpenOrCreate, FileAccess.Write)
f2Reader = New StreamWriter(f2Stream)
End If

If (p3FileName IsNot Nothing) And (p3FileName <> "") Then
f3Stream = New FileStream(f3Name, FileMode.OpenOrCreate, FileAccess.Write)
f3Reader = New StreamWriter(f3Stream)
End If
Catch ex As Exception
MsgBox("File does not exist", MsgBoxStyle.Critical, "Sony Vegas Script")
End Try



End Sub

Public Sub closeFiles()
f1Reader.Close()
f1Stream.Close()
f2Reader.Close()
f2Stream.Close()
'f3Reader.Close()
'f3Stream.Close()
End Sub

Public Sub pullLines()
Dim index As Integer = 0
ReDim Preserve linesListArr(2000)

Do Until f1Reader.EndOfStream
linesListArr(index) = f1Reader.ReadLine()
index = index + 1
Loop

ReDim Preserve linesListArr(index - 1)
ReDim Preserve linesList_TagArr(index - 1)
ReDim Preserve linesEDLArr(index - 1)
End Sub

Public Sub pullClips()
Dim i As Integer
Dim j As Integer = 0
Dim sPom As String = ""


ReDim Preserve clipsListArr(0)
ReDim clipsTmpArr(linesListArr.Length - 1)

For i = 0 To linesListArr.Length - 1
If linesListArr(i).Length > 17 Then
sPom = linesListArr(i).Substring(0, 17)
End If

linesList_TagArr(i) = ""

If sPom = EDL_Identifier Then
clipsTmpArr(j) = linesListArr(i).Substring(18, linesListArr(i).Length - 18)
linesList_TagArr(i) = clipsTmpArr(j)
j = j + 1
End If
Next

ReDim Preserve clipsTmpArr(j - 1)
Array.Sort(clipsTmpArr)

ReDim Preserve clipsListArr(j - 1)
j = 0
clipsListArr(0) = clipsTmpArr(0)

For i = 0 To clipsTmpArr.Length - 1
If clipsListArr(j) <> clipsTmpArr(i) Then
j = j + 1
clipsListArr(j) = clipsTmpArr(i)
End If
Next
ReDim Preserve clipsListArr(j)

createLines_EDL()
For i = 0 To linesEDLArr.Length - 1
insLine_EDL(linesEDLArr(i))
Next

End Sub

Public Sub createLines_EDL()
Dim i As Integer

linesEDLArr(0) = linesListArr(0)
linesEDLArr(1) = linesListArr(1)

For i = 2 To linesListArr.Length - 2 Step 2
linesEDLArr(i) = linesListArr(i)
linesEDLArr(i) = linesListArr(i).Replace(EDL_ReelOld, EDL_ReelPrefix + findReel(i + 1))
Next
For i = 3 To linesListArr.Length - 1 Step 2
linesEDLArr(i) = EDL_Identifier + EDL_IdentifierCorrection + linesList_TagArr(i) + EDL_FilesExtension

Next

End Sub

Private Function findReel(ByVal index As Integer) As String
Dim i As Integer

For i = 0 To clipsListArr.Length - 1
If linesList_TagArr(index) = clipsListArr(i) Then
Return (i + 1).ToString
End If
Next
Return ""
End Function


Public Sub insLine_EDL(ByVal line As String)
Dim txtLine As String

txtLine = line
f2Reader.WriteLine(txtLine)
End Sub
Public Sub insLine_comment(ByVal comment As String)
Dim txtLine As String

txtLine = comment
f3Reader.WriteLine(txtLine)
End Sub

Public Sub resetIndex()
linesIndex = 0
End Sub


Public ReadOnly Property ProductsList() As String()
Get
Return linesListArr
End Get

End Property

Public ReadOnly Property ProductsListIndex() As Integer
Get
Return linesIndex
End Get

End Property

Public ReadOnly Property ProductsListEnd() As Boolean
Get
Return linesEnd
End Get

End Property
End Class


End Module

---------------------------------------------Script End------------------------------------------------



Respond to this post   •   Return to posts index   •   Read entire thread


Current Message Thread:


Related Threads:
Importing Panasonic P2 AVC Intra into Vegas9?   |   Do you have to author Blue Ray from the Vegas Timeline or can you import mpeg-2 files directly into DVD Architect?   |   Importing SWF file into Vegas Pro 8   |   sound problems when importing video into sony vegas 8.0 pro   |   Importing a DVD into Vegas??   |   Distortion importing jpegs into vegas   |   EX1 Footage Import into Vegas, no Audio   |   Mpg wont import into Sony Vegas 8.0a properly, if at all.   |   Can You Import Adobe After Effects Comps into Vegas 8?   |   Opening or Importing m2ts files into Vegas Pro

Related Tags:
EDL   |   FCP



Note: If you are a registered user please click here to login before posting.

Your post will not be accepted if your name and email address are not registered in our database. Click here if you do not have an account.

Name
E-Mail Address
Subject
E-Mail me when someone responds
Just This Message   Entire Thread   None  

Message:



Note: The following are HTML characters and may cause parts of your post to disappear if not used correctly: < > &
To include any portion of the post in your response, highlight the desired text and hit the "Q" key. Read more...



Add your message signature


 


Note: By clicking "Post Direct" button above, you are agreeing to the Creative Cow's Code of Conduct.



FORUMSTUTORIALSMAGAZINETRAININGREELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]