Hey Leute ich wollte mir eben schnell einen simplen FLV to MP3 Converter bauen, damit ich die Vids im Auto hören kann!
Aber ich weiß nicht mehr weiter...
Es funktioniert alles ohne Probleme, nur er stoppt zwischen 10 - 15 Min Spielzeit...
Das Lied geht um die 90 Minuten!
VS bringt mir auch keinen Fehler...
Hier der Grundcode:
Aber ich weiß nicht mehr weiter...
Es funktioniert alles ohne Probleme, nur er stoppt zwischen 10 - 15 Min Spielzeit...
Das Lied geht um die 90 Minuten!
VS bringt mir auch keinen Fehler...
Hier der Grundcode:
VB.NET-Quellcode
- Imports System.IO
- Imports System.Threading
- Public Class Form1
- Dim thread As New MethodInvoker(AddressOf fertig)
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim ofd As New OpenFileDialog
- With ofd
- .Filter = "FLV File (*.flv)|*.flv"
- End With
- If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
- TextBox1.Text = ofd.FileName
- End If
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim sfd As New SaveFileDialog
- With sfd
- .Filter = "MP3 File (*.mp3)|*.mp3"
- End With
- If sfd.ShowDialog = Windows.Forms.DialogResult.OK Then
- TextBox2.Text = sfd.FileName
- End If
- End Sub
- Private Sub fertig()
- Label1.Text = ""
- MessageBox.Show("Abgeschlossen")
- End Sub
- Public Sub Convert(ByVal input As String, ByVal output As String)
- Dim ff As New Process
- With ff
- .StartInfo.WindowStyle = ProcessWindowStyle.Hidden
- .StartInfo.FileName = Application.StartupPath & "\ffmpeg.exe"
- .StartInfo.UseShellExecute = False
- .StartInfo.CreateNoWindow = True
- .StartInfo.RedirectStandardError = True
- .StartInfo.RedirectStandardOutput = True
- End With
- ff.StartInfo.Arguments = (" -i """ & input & """ -sameq """ & output & """")
- ff.Start()
- Do Until ff.HasExited
- Loop
- ff.Close()
- End Sub
- Private Sub start()
- Convert(TextBox1.Text, TextBox2.Text)
- Me.Invoke(thread)
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- Label1.Text = "Converting..."
- Dim th As New System.Threading.Thread(AddressOf start)
- th.Start()
- End Sub
- End Class