Teil eines Strings als VAR

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Teil eines Strings als VAR

Re: Teil eines Strings als VAR

Post by Rohwedder » 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

Re: Teil eines Strings als VAR

Post by nacken012 » 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"

Re: Teil eines Strings als VAR

Post by nacken012 » 01 Jan 2022, 03:58

Vielen vielen Dank, perfekt :-)

Re: Teil eines Strings als VAR

Post by Rohwedder » 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

Teil eines Strings als VAR

Post by nacken012 » 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

Top