Private Shared Sub checkVideoHandler(ByVal sender As Object, ByVal outLine As Diagnostics.DataReceivedEventArgs) If Not [String].IsNullOrEmpty(outLine.Data) Then Dim tmp As String = outLine.Data.Trim() ' looks ok, probably a video If Regex.IsMatch(tmp, "^Input #0") Then _foundInput0 = True '_foundInput0 = False End If ' get the duration Dim m As Match = Regex.Match(tmp, "^Duration: (\d+:\d+:\d+\.\d+),") If _foundInput0 AndAlso m.Success Then _duration = m.Groups(1).Captures(0).ToString() End If ' get width, height, fps and pixelformat If _foundInput0 AndAlso Regex.IsMatch(tmp, "^Stream #0\.0(\(eng\))?: Video: ") Then _width = tmp.Split(","c)(2).Trim().Split(" "c)(0).Split("x"c)(0) _height = tmp.Split(","c)(2).Trim().Split(" "c)(0).Split("x"c)(1) _fps = tmp.Split(","c)(3).Trim().Split(" "c)(0) End If End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)