Teil eines Strings als VAR

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

nacken012
Posts: 92
Joined: 22 Jul 2016, 14:39

Teil eines Strings als VAR

01 Jan 2022, 00:29

Hallo, wünsche ein Frohes neues Jahr.

Ich habe mir einen Video Converter für meinen Technisat Receiver geschrieben, das funktioniert auch alles perfekt.

Nun möchte es den erweitern um die Option, automatisch die schwarzen Balken eines Videos zu entfernen.

Habe es hinbekommen das ich die Schnitt Daten in einer txt Datei speicher, aber nun zu der Frage:

Wie kann man nur einen bestimmten Teil als VAR speichern ?

Hier die Ausgabe die ich bekomme:

[Parsed_cropdetect_0 @ 000001e3c4b8ccc0] x1:0 x2:719 y1:60 y2:516 w:720 h:448 x:0 y:64 pts:108000 t:1.200000 crop=720:448:0:64

Die Zeile kann immer anders aussehen, ich brauchte also das was hinter dem "crop=" steht als VAR


Wie mache ich so etwas ?

lg Horst
Rohwedder
Posts: 7718
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Teil eines Strings als VAR

01 Jan 2022, 03:05

Hallo,
z.B:

Code: Select all

Zeile = [Parsed_cropdetect_0 @ 000001e3c4b8ccc0] x1:0 x2:719 y1:60 y2:516 w:720 h:448 x:0 y:64 pts:108000 t:1.200000 crop=720:448:0:64
Var := StrSplit(Zeile, "crop=").2
MsgBox,% Var
nacken012
Posts: 92
Joined: 22 Jul 2016, 14:39

Re: Teil eines Strings als VAR

01 Jan 2022, 03:58

Vielen vielen Dank, perfekt :-)
nacken012
Posts: 92
Joined: 22 Jul 2016, 14:39

Re: Teil eines Strings als VAR

01 Jan 2022, 04:48

Das ist jetzt draus geworden

Code: Select all

GuiDropFiles:
Gui, Submit, nohide
SplitPath, A_GuiEvent, Dateiname, Verzeichnis, Erweiterung, NameOhneErw, Laufwerk
Sleep, 500
runwait,%comspec% /c bin\ffmpeg.exe -skip_frame nokey -y -hide_banner -loglevel 32 -stats -i "%A_GuiEvent%" -vf cropdetect -an -f null - 2>autocrop.txt

Sleep, 100
FileReadLine, line, autocrop.txt, 21

Zeile = %line%
Var := StrSplit(Zeile, "crop=").2

runwait,%comspec% /c bin\ffmpeg.exe -y -i "%A_GuiEvent%" -filter:v "crop="%Var% -f dvd -b:v 2800k -r 25 -ar 48000 -b:a 128k "%Verzeichnis%\%NameOhneErw%.mpg"
Rohwedder
Posts: 7718
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Teil eines Strings als VAR

01 Jan 2022, 05:54

Statt:

Code: Select all

Zeile = %line%
Var := StrSplit(Zeile, "crop=").2
geht auch:

Code: Select all

Var := StrSplit(line, "crop=").2

Return to “Ich brauche Hilfe”

Who is online

Users browsing this forum: No registered users and 18 guests