cdeb Posted March 29, 2019 Share Posted March 29, 2019 I want to start ffmpeg to make a video screencapure, so far nothing complex FFMPEG EXAMPLE COMMAND: ffmpeg -f gdigrab -i desktop -framerate 10 -vcodec libx264 YOUR_NAME_HERE.mp4 Example AU3 script: Local $cmd_string = "ffmpeg -f gdigrab -i desktop -framerate 10 -vcodec libx264 YOUR_NAME_HERE.mp4" Local $iPID = Run($cmd_string, @ScriptDir, @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($iPID) However, to stop video recording I have to press the ‘q’ key on the keyboard How can I send the same command to the $iPID? Link to comment Share on other sites More sharing options...
Nine Posted March 29, 2019 Share Posted March 29, 2019 Have you tried StdinWrite ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
cdeb Posted March 29, 2019 Author Share Posted March 29, 2019 Yes I used StdInWrite($iPID, "Q" & @CRLF) but nothing Example: Local $cmd = "" $cmd_string = "ffmpeg -f gdigrab -i desktop -framerate 10 -vcodec libx264 YOUR_NAME_HERE.mp4" Local $iPID = Run($cmd_string, @ScriptDir, @SW_HIDE, $STDOUT_CHILD) Local $max = 100000 Local $count = 0 While ProcessExists ( $iPID ) $sStderrRead = StderrRead ( $iPID ) If Not @error And $sStderrRead <> '' Then ConsoleWrite ( "! STDERR read : " & $sStderrRead & @Crlf ) EndIf $sStdoutRead = StdoutRead ( $iPID ) If Not @error And $sStdoutRead <> '' Then $sOutput &= $sStdoutRead ConsoleWrite ( "+ STDOUT read : " & $sStdoutRead & @Crlf ) EndIf $count += 1 If $count > $max Then ConsoleWrite ( "+ $count > $max: " & @Crlf ) StdInWrite($iPID, "Q" & @CRLF) EndIf Wend abberration 1 Link to comment Share on other sites More sharing options...
Nine Posted March 29, 2019 Share Posted March 29, 2019 you need to have $STDOUT_CHILD + $STDIN_CHILD + $STDERR_CHILD in your run function... abberration 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
cdeb Posted March 29, 2019 Author Share Posted March 29, 2019 Thank you Link to comment Share on other sites More sharing options...
Nine Posted March 29, 2019 Share Posted March 29, 2019 lolz “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now