AutoIt Windows Screenshooter v1.84 Build 2019-08-18

  • Tweaky: sollte jetzt "gefixt" sein: ich musste die GUI auf maximal 8192x8192 festlegen, da sonst die GUI weiß bleibt.

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Wenn ich ein Video erstelle, poppt bei Win 7 64bit ein Fenster auf.
    Welchen Codec soll man da am besten einstellen?
    autoit.de/wcf/attachment/14309/

    Hm, gerade ist mir noch was aufgefallen.
    Kann es sein, dass die Dauer nicht stimmt.

    Wenn ich 10 Sekunden einstellen, ist das Video nur 5 Sekunden lang.
    Bei 5 Sekunden nur 3 Sekunden.

    Wenn ich es richtig sehe, läuft das Video einfach zu schnell

  • Tweaky:

    Zu den Codecs: welcher Codec am Besten ist, musst du ausprobieren, denn jeder Codec hat seine Vor- bzw. Nachteile. Du kannst auch XViD oder irgend welche anderen Codecs installieren und benutzen!

    Dauer: hast recht, da stimmt was nicht - muss da nochmals genauer schauen, was da schief läuft.

    Danke für dein Feedback!

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Hab mal alle Codecs durchprobiert

    Microsoft RLE: funktioniert nicht, Größe des Videos 0MB
    Microsoft Video 1: funktioniert, Größe des Videos 24,9MB
    Intel IYUV Codec: funktioniert, Größe des Videos 164MB
    Cinepak Codec von Radius: funktioniert, Größe des Videos 2,2MB
    Volle Einzelbilder (unkomprimiert): funktioniert, Größe des Videos 290MB

    Kann man vielleicht über eine ini den zu benutzenden Codec mitgeben :?:

  • Das Fenster, was du siehst, kommt von der Avifil32.dll, die die installienten Codecs auf dem System anzeigt.

    Eine Ini ist nicht geplant, denn du müsstest noch weitere Parameter (siehe $AVICOMPRESSOPTIONS Struktur) mitgeben, die nicht statisch sind.

    Hat jemand DEP aktiviert für alles Programme und Dienste? Wenn ja, dann führt das in Verbindung mit dem Windows Screenshooter zu Problemen, da verschiedene DLL aus dem Speicher geladen werden!
    Z.B: wird stürzt das About Intro und einige Bild Manipulationsfunktionen ab!

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯


  • Hm, gerade ist mir noch was aufgefallen.
    Kann es sein, dass die Dauer nicht stimmt.

    Wenn ich 10 Sekunden einstellen, ist das Video nur 5 Sekunden lang.
    Bei 5 Sekunden nur 3 Sekunden.

    Wenn ich es richtig sehe, läuft das Video einfach zu schnell

    Sollte jetzt gefixt sein!

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Danke für die neue Version.
    Leider funktioniert es bei mir nicht vollständig.

    Ich will 30 Sekunden aufzeichen.
    Die Aufzeichnugsphase dauert dann 50 Sekunden.
    Während der Aufzeichnung ruckelt die Maus.
    Das Videos ist dann 30 Sekunden lang ?(

    Bei 10 Sekunden sinds 15 Sekunden

  • Das heißt, die Aufnahme ist zu langsam, das muss wohl optimiert werden. z.B. DLLStructCreate, CreateDC usw. nur 1x vor der Aufnahme.
    Edit: Also in etwa so:

    Spoiler anzeigen
    [autoit]


    #region Grab2AVI
    Func Grab2AVI()
    GUISetState(@SW_HIDE, $hGUI)

    [/autoit] [autoit][/autoit] [autoit]

    Local $hGUI_Grab2AVI = GUICreate("", 0, 0, 0, 0, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW, WinGetHandle(AutoItWinGetTitle()))
    GUISetBkColor(0xFF0000, $hGUI_Grab2AVI)
    GUISetState(@SW_SHOW, $hGUI_Grab2AVI)
    Local $aMPos, $hWin, $hWinAncestor, $hWnd, $aRet_prev, $aPos, $q, $fps, $hBmp_AVI
    Local Const $frame_size = 3
    Local $tPoint = DllStructCreate($tagPOINT)
    Local $esc = True
    While Not _IsPressed("1B", $dll) * Sleep(25)
    $aMPos = MouseGetPos()
    DllStructSetData($tPoint, 1, $aMPos[0])
    DllStructSetData($tPoint, 2, $aMPos[1])
    $hWin = _WinAPI_WindowFromPoint($tPoint)
    $hWinAncestor = _WinAPI_GetAncestor($hWin, 2)
    $hWnd = HWnd($hWinAncestor)
    $aRet_prev = -1
    $aPos = WinGetPos($hWnd)
    If $hWnd <> $hGUI_Grab2AVI And $hWnd <> $aRet_prev Then
    $aRet_prev = $hWnd
    WinMove($hGUI_Grab2AVI, "", $aPos[0], $aPos[1], $aPos[2], $aPos[3], 1)
    _GuiHole($hGUI_Grab2AVI, $frame_size, $frame_size, $aPos[2] - 2 * $frame_size, $aPos[3] - 2 * $frame_size, $aPos[2], $aPos[3])
    WinSetOnTop($hGUI_Grab2AVI, 0, 1)
    ToolTip("Press CTRL to start capturing of marked window!" & @LF & @LF & _
    "Windows Size: " & $aPos[2] & " x " & $aPos[3], $aMPos[0] + 10, $aMPos[1] + 10)
    EndIf
    If _IsPressed("11", $dll) Then
    $esc = False
    ExitLoop
    EndIf
    WEnd
    ToolTip("")
    $tPoint = 0
    If Not $esc Then
    For $q = 0 To UBound($aButton_Menu_AVI_Sub1_Item) - 1
    If BitAND(GUICtrlRead($aButton_Menu_AVI_Sub1_Item[$q]), $GUI_CHECKED) = $GUI_CHECKED Then
    $rec_time = $AVI_ReqTime[$q]
    ExitLoop
    EndIf
    Next
    For $q = 0 To UBound($aButton_Menu_AVI_Sub2_Item) - 1
    If BitAND(GUICtrlRead($aButton_Menu_AVI_Sub2_Item[$q]), $GUI_CHECKED) = $GUI_CHECKED Then
    $fps = $AVI_FPS[$q]
    ExitLoop
    EndIf
    Next
    EndIf
    GUIDelete($hGUI_Grab2AVI)
    If $esc Then Return GUISetState(@SW_SHOW, $hGUI)

    [/autoit] [autoit][/autoit] [autoit]

    Local $timestamp = @YEAR & @MON & @MDAY & "_" & @HOUR & @MIN & @SEC & "_"
    Local $WinTitle = StringRegExpReplace(WinGetTitle($hWnd), '(\?|\*|\<|\>|\"|\:|\\)', "")

    [/autoit] [autoit][/autoit] [autoit]

    Local $add_ts = False
    If BitAND(GUICtrlRead($mButton_Menu_AVI_Sub3_Item1), $GUI_CHECKED) = $GUI_CHECKED Then $add_ts = True
    If BitAND(GUICtrlRead($mButton_Menu_AVI_Sub4_Item2), $GUI_CHECKED) = $GUI_CHECKED Then
    $compress_avi = False
    Else
    $compress_avi = True
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    _StartAviLibrary()
    Local $AVI_Filename = @ScriptDir & "\" & $timestamp & $WinTitle & ".avi"
    Local $AVI_File = _CreateAvi($AVI_Filename, $fps, $aPos[2], $aPos[3])
    If @error Then
    _CloseAvi($AVI_File)
    _StopAviLibrary()
    FileDelete($AVI_Filename)
    GUISetState(@SW_SHOW, $hGUI)
    Return MsgBox(64 + 262144, "Information", "Grab Screen to AVI has been aborted!", 15, $hGUI)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Local $hBitmap_AVI, $hBitmap_AVI_TS, $hBmp_AVI_TS
    Local $total_FPS = $rec_time * $fps, $fps_c = 1
    Local $fc = 1000 / $fps

    [/autoit] [autoit][/autoit] [autoit]

    Local $k32_dll = DllOpen("kernel32.dll")
    Local $DC = _WinAPI_GetDC(0)
    Local $hDC = _WinAPI_CreateCompatibleDC($DC)
    _WinAPI_ReleaseDC(0, $DC)
    Local $OldBMP, $bits = DllStructCreate("byte[" & DllStructGetData($AVI_File[3], "biSizeImage") & "]")
    Local $pBits = DllStructGetPtr($bits), $iLines = Abs(DllStructGetData($AVI_File[3], "biHeight"))
    Local $pHeader = DllStructGetPtr($AVI_File[3]), $iSize = DllStructGetSize($bits)
    Local $iFlags = BitOR($DT_CENTER, $DT_BOTTOM, $DT_SINGLELINE ), $tRect = DllStructCreate("dword[4]"), $t
    DllStructSetData($tRECT, 1, 10, 1)
    DllStructSetData($tRECT, 1, 10, 2)
    DllStructSetData($tRECT, 1, $aPos[2]-10, 3)
    DllStructSetData($tRECT, 1, $aPos[3]-10, 4)
    _WinAPI_SetTextColor($hDC, 0xFFFFFF)
    _WinAPI_SetBkMode($hDC, 1)
    Do
    $t = TimerInit()
    $hBmp_AVI = _ScreenCapture_CaptureWnd("", $hWnd)
    Local $OldBMP = _WinAPI_SelectObject($hDC, $hBmp_AVI)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    If $add_ts Then
    _WinAPI_DrawText($hDC, _Now(), $tRECT, $iFlags)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    _WinAPI_GetDIBits($hDC, $hBmp_AVI, 0, $iLines, $pBits, $pHeader, 0)
    _WinAPI_SelectObject($hDC, $OldBMP)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall($Avi32_Dll, "int", "AVIStreamWrite", "ptr", $AVI_File[1], "long", $AVI_File[2], "long", 1, "ptr", $pBits, _
    "long", $iSize, "long", $AVIIF_KEYFRAME, "ptr*", 0, "ptr*", 0)
    $AVI_File[2] += 1
    _WinAPI_DeleteObject($hBmp_AVI)
    $t = $fc - TimerDiff($t)
    If $t > 0 Then DllCall ($k32_dll, "none", "Sleep", "DWORD", $t)
    $fps_c += 1
    Until $fps_c > $total_FPS
    _WinAPI_DeleteDC($hDC)

    [/autoit] [autoit][/autoit] [autoit]

    _CloseAvi($AVI_File)
    _StopAviLibrary()
    DllClose($k32_dll)

    [/autoit] [autoit][/autoit] [autoit]

    MsgBox(64 + 262144, "Information", _
    "AVI video successfully created: " & @LF & @LF & _
    "Filename: " & $AVI_Filename & @LF & _
    "Filesize: " & Round(FileGetSize($AVI_Filename) / 1024^2, 2) & " MB" & @LF & _
    "Duration: " & $rec_time & " seconds" & @LF & _
    "Frames per second: " & $fps & @LF & _
    "Video resolution: " & $aPos[2] & " x " & $aPos[3], 30, $hGUI)
    GUISetState(@SW_SHOW, $hGUI)
    Local $show_avi = MsgBox(4 + 48 + 256, "Question", "Open AVI with default viewer?", 15, $hGUI)
    If $show_avi = 6 Then ShellExecute($AVI_Filename)
    EndFunc
    #endregion

    [/autoit]

    Einmal editiert, zuletzt von progandy (12. Oktober 2011 um 19:44)

  • Danke für die neue Version.
    Leider funktioniert es bei mir nicht vollständig.

    Ich will 30 Sekunden aufzeichen.
    Die Aufzeichnugsphase dauert dann 50 Sekunden.
    Während der Aufzeichnung ruckelt die Maus.
    Das Videos ist dann 30 Sekunden lang ?(

    Bei 10 Sekunden sinds 15 Sekunden


    Tja, das ist das Problem bei einer Interpreter Sprache: die Geschwindigkeit.

    progandy's version ist etwas schneller, aber letzt endlich gleiches Problem auch hier - Aufzeichnungslänge ist größer als die Solllänge und die Maus hakt.

    VIELEN DANK FÜRS TESTEN!!!!

    @progandy: danke für die Optimierung! :thumbup:

    Mal sehen, ob man noch mehr heraus holen kann.

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • progandy's version ist etwas schneller, aber letzt endlich gleiches Problem auch hier - Aufzeichnungslänge ist größer als die Solllänge und die Maus hakt.


    Das kommt drauf an. Bei mir passt es ziemlich genau, auch wenn die Maus hakt.
    Du kannst und solltest immer noch _ScreenCapture_Capture zerpflücken, das war mir zu viel Aufwand ;) Wenn du es richtig machst, kannst du dann nämlich auch das letzte DeleteObject aus der Schleife entfernen, es werden dann nur noch Bilddaten ziwschen schon reservierten Speicherbereichen kopiert das sollte schneller sein ohne ein andauerndes CreateCompatibleBitmap / DeleteObject ;)

  • Alter jetzt hab ich alles gesehen...da braucht man mal sowas und in dem moment kommt von irgendwoher die idee hier nachzusehen und *zack* hast du was...da ziehe ich meinen Hut vor dir (sobald ich mal einen anhabe). Sowas geht unter "High LVL Programming", wobei ich natürlich schon sagen muss, das mit die Kommentare im Code fehlen...ich verstehe bis zu 70% des Codes nicht mal ansatzweise, aber das ist Detail und auch ich vergesse ab und zu zu kommentieren...ansonsten wirklich grosse Klasse 5* :thumbup:

    Bild1: Ich beim debuggen


  • Das kommt drauf an. Bei mir passt es ziemlich genau, auch wenn die Maus hakt.
    Du kannst und solltest immer noch _ScreenCapture_Capture zerpflücken, das war mir zu viel Aufwand ;) Wenn du es richtig machst, kannst du dann nämlich auch das letzte DeleteObject aus der Schleife entfernen, es werden dann nur noch Bilddaten ziwschen schon reservierten Speicherbereichen kopiert das sollte schneller sein ohne ein andauerndes CreateCompatibleBitmap / DeleteObject ;)


    Mehr geht glaube ich nicht, außer der WTOB() Funktion:

    Spoiler anzeigen
    [autoit]


    Func Grab2AVI()
    GUISetState(@SW_HIDE, $hGUI)

    [/autoit] [autoit][/autoit] [autoit]

    Local $hGUI_Grab2AVI = GUICreate("", 0, 0, 0, 0, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW, WinGetHandle(AutoItWinGetTitle()))
    GUISetBkColor(0xFF0000, $hGUI_Grab2AVI)
    GUISetState(@SW_SHOW, $hGUI_Grab2AVI)
    Local $aMPos, $hWin, $hWinAncestor, $hWnd, $aRet_prev, $aPos, $q, $fps, $hBmp_AVI
    Local Const $frame_size = 3
    Local $tPoint = DllStructCreate($tagPOINT)
    Local $esc = True
    While Not _IsPressed("1B", $dll) * Sleep(25)
    $aMPos = MouseGetPos()
    DllStructSetData($tPoint, 1, $aMPos[0])
    DllStructSetData($tPoint, 2, $aMPos[1])
    $hWin = _WinAPI_WindowFromPoint($tPoint)
    $hWinAncestor = _WinAPI_GetAncestor($hWin, 2)
    $hWnd = HWnd($hWinAncestor)
    $aRet_prev = -1
    $aPos = WinGetPos($hWnd)
    If $hWnd <> $hGUI_Grab2AVI And $hWnd <> $aRet_prev Then
    $aRet_prev = $hWnd
    WinMove($hGUI_Grab2AVI, "", $aPos[0], $aPos[1], $aPos[2], $aPos[3], 1)
    _GuiHole($hGUI_Grab2AVI, $frame_size, $frame_size, $aPos[2] - 2 * $frame_size, $aPos[3] - 2 * $frame_size, $aPos[2], $aPos[3])
    WinSetOnTop($hGUI_Grab2AVI, 0, 1)
    ToolTip("Press CTRL to start capturing of marked window!" & @LF & @LF & _
    "Windows Size: " & $aPos[2] & " x " & $aPos[3], $aMPos[0] + 10, $aMPos[1] + 10)
    EndIf
    If _IsPressed("11", $dll) Then
    $esc = False
    ExitLoop
    EndIf
    WEnd
    ToolTip("")
    $tPoint = 0
    If Not $esc Then
    For $q = 0 To UBound($aButton_Menu_AVI_Sub1_Item) - 1
    If BitAND(GUICtrlRead($aButton_Menu_AVI_Sub1_Item[$q]), $GUI_CHECKED) = $GUI_CHECKED Then
    $rec_time = $AVI_ReqTime[$q]
    ExitLoop
    EndIf
    Next
    For $q = 0 To UBound($aButton_Menu_AVI_Sub2_Item) - 1
    If BitAND(GUICtrlRead($aButton_Menu_AVI_Sub2_Item[$q]), $GUI_CHECKED) = $GUI_CHECKED Then
    $fps = $AVI_FPS[$q]
    ExitLoop
    EndIf
    Next
    EndIf
    GUIDelete($hGUI_Grab2AVI)
    If $esc Then Return GUISetState(@SW_SHOW, $hGUI)

    [/autoit] [autoit][/autoit] [autoit]

    Local $timestamp = @YEAR & @MON & @MDAY & "_" & @HOUR & @MIN & @SEC & "_"
    Local $WinTitle = StringRegExpReplace(WinGetTitle($hWnd), '(\?|\*|\<|\>|\"|\:|\\)', "")

    [/autoit] [autoit][/autoit] [autoit]

    Local $add_ts = False
    If BitAND(GUICtrlRead($mButton_Menu_AVI_Sub3_Item1), $GUI_CHECKED) = $GUI_CHECKED Then $add_ts = True
    If BitAND(GUICtrlRead($mButton_Menu_AVI_Sub4_Item2), $GUI_CHECKED) = $GUI_CHECKED Then
    $compress_avi = False
    Else
    $compress_avi = True
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    _StartAviLibrary()
    Local $AVI_Filename = @ScriptDir & "\" & $timestamp & $WinTitle & ".avi"
    Local $AVI_File = _CreateAvi($AVI_Filename, $fps, $aPos[2], $aPos[3])
    If @error Then
    _CloseAvi($AVI_File)
    _StopAviLibrary()
    FileDelete($AVI_Filename)
    GUISetState(@SW_SHOW, $hGUI)
    Return MsgBox(64 + 262144, "Information", "Grab Screen to AVI has been aborted!", 15, $hGUI)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Local $hBitmap_AVI, $hBitmap_AVI_TS, $hBmp_AVI_TS, $OldBMP
    Local $total_FPS = $rec_time * $fps, $fps_c = 1
    Local $fc = 1000 / $fps

    [/autoit] [autoit][/autoit] [autoit]

    Local $k32_dll = DllOpen("kernel32.dll")
    Local $g32_dll = DllOpen("gdi32.dll")
    Local $DC = _WinAPI_GetDC(0)
    Local $hDC = _WinAPI_CreateCompatibleDC($DC)

    [/autoit] [autoit][/autoit] [autoit]

    Local $OldBMP, $bits = DllStructCreate("byte[" & DllStructGetData($AVI_File[3], "biSizeImage") & "]")
    Local $pBits = DllStructGetPtr($bits), $iLines = Abs(DllStructGetData($AVI_File[3], "biHeight"))
    Local $pHeader = DllStructGetPtr($AVI_File[3]), $iSize = DllStructGetSize($bits)

    [/autoit] [autoit][/autoit] [autoit]

    Local $iLeft, $iRight, $iTop, $iBottom
    $iLeft = $aPos[0]
    $iRight = $aPos[0] + $aPos[2]
    $iTop = $aPos[1]
    $iBottom = $aPos[1] + $aPos[3]
    If $iRight = -1 Then $iRight = _WinAPI_GetSystemMetrics($__SCREENCAPTURECONSTANT_SM_CXSCREEN)
    If $iBottom = -1 Then $iBottom = _WinAPI_GetSystemMetrics($__SCREENCAPTURECONSTANT_SM_CYSCREEN)
    Local $iW = $aPos[2]
    Local $iH = $aPos[3]
    $hBmp_AVI = _WinAPI_CreateCompatibleBitmap($DC, $iW, $iH)

    [/autoit] [autoit][/autoit] [autoit]

    Local $rec_timer = TimerInit()
    If $add_ts Then
    Do
    $OldBMP = DllCall($g32_dll, "handle", "SelectObject", "handle", $hDC, "handle", $hBmp_AVI)
    DllCall($g32_dll, "bool", "BitBlt", "handle", $hDC, "int", 0, "int", 0, "int", $iW, "int", $iH, "handle", $DC, "int", $iLeft, "int", $iTop, "dword", $SRCCOPY) ;_WinAPI_BitBlt()

    [/autoit] [autoit][/autoit] [autoit]

    $hBitmap_AVI = DllCall($ghGDIPDll, "int", "GdipCreateBitmapFromHBITMAP", "handle", $hBmp_AVI, "handle", 0, "ptr*", 0)
    $hBitmap_AVI_TS = WTOB($hBitmap_AVI[3], _Now())
    $hBmp_AVI_TS = DllCall($ghGDIPDll, "int", "GdipCreateHBITMAPFromBitmap", "handle", $hBitmap_AVI_TS, "ptr*", 0, "dword", 0xFF000000)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall($g32_dll, "int", "GetDIBits", "handle", $hDC, "handle", $hBmp_AVI_TS[2], "uint", 0, "uint", $iLines, "ptr", $pBits, "ptr", $pHeader, "uint", 0)
    DllCall($g32_dll, "handle", "SelectObject", "handle", $hDC, "handle", $OldBMP[0])
    DllCall($Avi32_Dll, "int", "AVIStreamWrite", "ptr", $AVI_File[1], "long", $AVI_File[2], "long", 1, "ptr", $pBits, "long", $iSize, "long", $AVIIF_KEYFRAME, "ptr*", 0, "ptr*", 0)
    $AVI_File[2] += 1

    [/autoit] [autoit][/autoit] [autoit]

    DllCall ($k32_dll, "none", "Sleep", "dword", $fc)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall($g32_dll, "bool", "DeleteObject", "handle", $hBmp_AVI_TS[2])
    DllCall($ghGDIPDll, "int", "GdipDisposeImage", "handle", $hBitmap_AVI[3])
    DllCall($ghGDIPDll, "int", "GdipDisposeImage", "handle", $hBitmap_AVI_TS)

    [/autoit] [autoit][/autoit] [autoit]

    $fps_c += 1
    Until $fps_c > $total_FPS
    Else
    Do
    ;_ScreenCapture_Capture() reduced
    $OldBMP = DllCall($g32_dll, "handle", "SelectObject", "handle", $hDC, "handle", $hBmp_AVI) ;_WinAPI_SelectObject()
    DllCall($g32_dll, "bool", "BitBlt", "handle", $hDC, "int", 0, "int", 0, "int", $iW, "int", $iH, "handle", $DC, "int", $iLeft, "int", $iTop, "dword", $SRCCOPY) ;_WinAPI_BitBlt()

    [/autoit] [autoit][/autoit] [autoit]

    DllCall($g32_dll, "int", "GetDIBits", "handle", $hDC, "handle", $hBmp_AVI, "uint", 0, "uint", $iLines, "ptr", $pBits, "ptr", $pHeader, "uint", 0) ; _WinAPI_GetDIBits()
    DllCall($g32_dll, "handle", "SelectObject", "handle", $hDC, "handle", $OldBMP[0]) ;_WinAPI_SelectObject()
    DllCall($Avi32_Dll, "int", "AVIStreamWrite", "ptr", $AVI_File[1], "long", $AVI_File[2], "long", 1, "ptr", $pBits, "long", $iSize, "long", $AVIIF_KEYFRAME, "ptr*", 0, "ptr*", 0)
    $AVI_File[2] += 1

    [/autoit] [autoit][/autoit] [autoit]

    DllCall ($k32_dll, "none", "Sleep", "dword", $fc)

    [/autoit] [autoit][/autoit] [autoit]

    $fps_c += 1
    Until $fps_c > $total_FPS
    EndIf
    Local $rec_dur = Round(TimerDiff($rec_timer) / 1000, 2)
    _WinAPI_DeleteObject($hBmp_AVI)
    _WinAPI_SelectObject($DC, $OldBMP[0])
    _WinAPI_ReleaseDC(0, $DC)
    _WinAPI_DeleteDC($hDC)

    [/autoit] [autoit][/autoit] [autoit]

    _CloseAvi($AVI_File)
    _StopAviLibrary()
    DllClose($k32_dll)
    DllClose($g32_dll)

    [/autoit] [autoit][/autoit] [autoit]

    MsgBox(64 + 262144, "Information", _
    "AVI video successfully created: " & @LF & @LF & _
    "Filename: " & $AVI_Filename & @LF & _
    "Filesize: " & Round(FileGetSize($AVI_Filename) / 1024^2, 2) & " MB" & @LF & _
    "Duration: " & $rec_time & " seconds" & @LF & _
    "Frames per second: " & $fps & @LF & _
    "Video resolution: " & $aPos[2] & " x " & $aPos[3] & @LF & _
    "Record duration: " & $rec_dur & " seconds", 30, $hGUI)
    GUISetState(@SW_SHOW, $hGUI)
    Local $show_avi = MsgBox(4 + 48 + 256, "Question", "Open AVI with default viewer?", 15, $hGUI)
    If $show_avi = 6 Then ShellExecute($AVI_Filename)
    EndFunc

    [/autoit]

    Den Text per WinAPI zu schreiben ist schneller, aber nicht leserlicher.

    Warum hast du

    [autoit]


    $t = $fc - TimerDiff($t)
    If $t > 0 Then DllCall ($k32_dll, "none", "Sleep", "DWORD", $t)

    [/autoit]


    verwendet? Was bringt das mehr als nur

    [autoit]


    DllCall ($k32_dll, "none", "Sleep", "dword", $fc)

    [/autoit]


    ?


    Alter jetzt hab ich alles gesehen...da braucht man mal sowas und in dem moment kommt von irgendwoher die idee hier nachzusehen und *zack* hast du was...da ziehe ich meinen Hut vor dir (sobald ich mal einen anhabe). Sowas geht unter "High LVL Programming", wobei ich natürlich schon sagen muss, das mit die Kommentare im Code fehlen...ich verstehe bis zu 70% des Codes nicht mal ansatzweise, aber das ist Detail und auch ich vergesse ab und zu zu kommentieren...ansonsten wirklich grosse Klasse 5* :thumbup:

    Das mit dem Kommentieren ist immer so eine Sache, eigentlich sollte man das immer machen, um nach einigen Wochen den eigenen Code zu verstehen, aber Faulheit siegt meistens...

    So kompliziert ist der Code eigentlich doch nicht, nur ziemlich viel in der Zwischenzeit. ;)

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

    Einmal editiert, zuletzt von UEZ (13. Oktober 2011 um 13:01)

  • Den Text per WinAPI zu schreiben ist schneller, aber nicht leserlicher.

    Kann sein ;)

    Zitat

    Warum hast du

    [autoit]


    $t = $fc - TimerDiff($t)
    If $t > 0 Then DllCall ($k32_dll, "none", "Sleep", "DWORD", $t)

    [/autoit]


    verwendet? Was bringt das mehr als nur

    [autoit]


    DllCall ($k32_dll, "none", "Sleep", "dword", $fc)

    [/autoit]


    Ich habe die Zeit gemessen, die die ganzen DLLCalls benötigen. Diese Zeit darf ja beim Sleep nicht gewartet werden. Mal ein Beispiel:
    -Du machst 10 Bilder/s
    -Also ein Sleep von 1000/10 = 100ms
    -Das Bild erstellen und schreiben dauert 50ms.
    -Also pro Schleifendurchlauf 150ms (= 150ms pro Bild). Damit stimmt die FPS nicht mehr.
    Zieht man aber die 50ms von der Sleep-Zeit ab, dann passt es wieder auf 100ms ;)

  • 8o Mit der 1.40er Version funktioniert es nun perfekt.
    Di Dauer des aufzeichnens entspricht das der eingestellten Zeit.

    Perfekt :thumbup:

    Danke :D

  • Bitte! Freut mich, dass es dir gefällt! :D Mehr konnte ich nicht optimieren.

    Wie hast du vom Update erfahren?

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Aha. Dort habe ich auch nicht die 1.40'er Version angekündigt.

    Hier ist das Feedback eher bescheiden, darum gibt es meistens das Update eher auf der engl. Seite.

    Benutzt du auch das Programm? Denn es scheint so, als ob du der Einzige bist, der das Programm zu benutzen scheint. ;)

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Jo das Programm benutze ich.
    Natürlich versuche ich auch einigermaßen den Source nachzuvollziehen, auch wenn das mit dem Video für mich zu weit geht.
    Ich staune immer wieder was alles in AutoIt möglich ist ;)

  • Da es viele Zeilen Code sind, ist es relativ unübersichtlich geworden. Aber ob man den Code nachvollziehen kann, kann ich nicht beurteilen, da auch kaum Kommentare vorhanden sind. :whistling:

    Nichts ist unmöglich, na ja sagen wir mal fast ist nichts unmöglich... Wenn ich das alter Sack hinbekomme, dann sollten die Jungspunde das alle mal hinbekommen.

    Danke nochmals für dein Feedback!

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯