|
Metroidn1f
|
 |
« Reply #5 on: July 03, 2010, 08:47:54 PM » |
|
Could someone please look over this? I will explain on what it is suppose to do at the end of this post.
Public Class MainPage
Private Sub MakeFileMkvD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MakeFileMkvD.Click Dim TrkInptMkvD 'Track Input for Mkv Demuxer. Dim VOtPtMkvD 'Video Output for Mkv Demuxer. Dim AOtPtMkvD 'Audio Output for Mkv Demuxer. Dim VIDMkvD 'Video ID for Mkv Demuxer. Dim AIDMkvD 'Audio ID for Mkv Demuxer. Dim MkvDQ 'Confirmation Of Deleting Already Existed Video Output File. Dim MkvDLoop 'Variable For While Loop. Dim MkvNulD 'Varaible so Null Can be Used. Experimental TrkInptMkvD = VideoInputBoxMkvD.Text VOtPtMkvD = AudioOutputBoxMkvD.Text AOtPtMkvD = VideoOutputBoxMkvD.Text VIDMkvD = VideoIDMkvD.Text 'Temp: System.Diagnostics.Process.Start(Environ$("Temp") & "\MkvMakeFileD.bat") AIDMkvD = AudioIDMkvD.Text MkvDLoop = 0 MkvNulD = "Nul" While MkvDLoop < 1 If Not My.Computer.FileSystem.FileExists("'" & TrkInptMkvD & "'") Then MsgBox("The file, " & TrkInptMkvD & " does not exist", vbExclamation + vbOKOnly, "File Does Not Exist") MkvDLoop = MkvDLoop + 1 End If If My.Computer.FileSystem.FileExists("'" & VOtPtMkvD & "'") Then MkvDQ = MsgBox("The file, " & VOtPtMkvD & " already exists. Do you want to delete it?", vbQuestion + vbYesNo, "File Already Exists") If MkvDQ = vbYes Then Kill("'" & VOtPtMkvD & "'") Shell(Environ$("Comspec") & " /c Echo @Echo Off>> '%Temp%\MkvMakeFileD.bat'") Shell(Environ$("Comspec") & " /c Echo Color 0B>> '%Temp%\MkvMakeFileD.bat'") Shell(Environ$("Comspec") & " /c Echo mkvextract tracks " & TrkInptMkvD & " " & VIDMkvD & ":'" & VOtPtMkvD & "' " & AIDMkvD & ":'" & AOtPtMkvD & "'>> '%Temp%\MkvMakeFileD.bat'") Else End End If MkvDLoop = MkvDLoop + 1 End If Shell(Environ$("Comspec") & " /c Echo @Echo Off>> '%Temp%\MkvMakeFileD.bat'") Shell(Environ$("Comspec") & " /c Echo Color 0B>> '%Temp%\MkvMakeFileD.bat'") Shell(Environ$("Comspec") & " /c Echo mkvextract tracks " & TrkInptMkvD & " " & VIDMkvD & ":'" & VOtPtMkvD & "' " & AIDMkvD & ":'" & AOtPtMkvD & "'>> '%Temp%\MkvMakeFileD.bat'") MkvDLoop = MkvDLoop + 1 End While End Sub End Class
What it does is, I have the gui to ask me where the file is that I want to demux, (It is mkv). Then I tell it where to output the audio and audio, and beside it, I list the track ID. THen I click the make file button, and that is where that scripts comes in. First it checks to see if the input file exists, and if it doesn't, they MkvDLopp = MkvDLoop + 1 end the loop causing the sub to end.
If the file exists, it will check if the output video file exits. If it does, I will prompted if I want to delete it. If I click yes, it will delete and it will go ahead and make the batch file. If I click no, (Now were in the first else) it ends then the MkvDLopp = MkvDLoop + 1 comes into place again, and cancel the loop causing the sub to end.
If in the first place the Output video file did not exists, it would go ahead and make the batch file.
Yes I have realized that I have not specified to check and see if the audio output file exists, but I know it doesn't.
I have a feeling I do not have the MkvDLopp = MkvDLoop + 1 set up or put in the right spot to end the while loop.
When ever I run it, it always says that the file that I had input, does not exist, but I know it does. The reason why I think I have put the MkvDLopp = MkvDLoop + 1 in the correct way or right place is because, after I click okay when I get that message, the command prompt pops quickly. I then go to the %Temp% directory and I do not see the MkvMkaeFIleD.bat anywhere.
I know what I am about to give you might not help, but it will if you understand. It will aid you with on if I have the script right to compare it with what the inside of the batch file should look like.
The input fie is: C:\Users\Metroidn1f\Downloads\Movies\Exam 2009 720p BluRay x264\avchd-exam.2009.720p.mkv
Video output is: C:\Test.264 and the track ID is 1
THe Audio output is: C:\Test.ac3 and the track ID is 2
The inside of the batch file should look like this.
@Echo Off Color 0B mkvextract tracks "C:\Users\Metroidn1f\Downloads\Movies\Exam 2009 720p BluRay x264\avchd-exam.2009.720p.mkv" 1:"C:\Test.264" 2:"C:\Test.ac3"
ANd take note, where ever you see something like this '" it is just not one quote (") It is ' and a ". Same button, but one is just shifted.
Sorry if this confuses you. But I am just really stumped. This is my first application that I have actually attempted to make.
|