Commandline Tool

  • Hallo,

    ich will mit der Commandline Version von Mediainfo die Codec-Informationen eines Videos speichern, entweder als textfile, oder als Variable direkt in Autoit.

    Das Problem ist jetzt, dass ich es nur im cmd-prompt hinbekommen habe:

    Zitat

    C:\MediaInfo\MediaInfo.exe videofile.mpg

    Dadurch zeigt es mir etliche Zeilen mit Informationen an. Wie kann ich diese speichern? Ich möchte es schon in AutoIT machen und nicht per cmd-datei, da sich der Pfad etc. immer wieder ändert.

    Gruß

    Einmal editiert, zuletzt von Taek (27. Juli 2008 um 23:56)

    • Offizieller Beitrag

    Hi,

    versuch mal dies

    [autoit]

    MsgBox(64, 'DOS', _getDOSOutput('set'))

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

    Func _getDOSOutput($command)
    Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, '', @SW_HIDE, 2 + 4)
    While 1
    $text &= StdoutRead($Pid, False, False)
    If @error Then ExitLoop
    Sleep(10)
    WEnd
    Return $text
    EndFunc ;==>_getDOSOutput

    [/autoit]

    Mega

  • Habs jetzt doch noch hinbekommen:

    [autoit]

    $mediainfo_path='"'&@ScriptDir&"\Tools\MediaInfo.exe"&'"'
    $videofile_path='"________"'
    $txt_output_path='"'&@ScriptDir&"\Temp\videoinfo.txt"&'"'

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

    Run(@SystemDir&"\cmd.exe")
    Send($mediainfo_path&" "&$videofile_path&" > "& $txt_output_path&"{ENTER}exit{ENTER}")

    [/autoit]

    Danke trotzdem für deine Bemühungen.