Carny_Priest Posted November 4, 2015 Author Share Posted November 4, 2015 The capture script does work with ffmpeg daily static build from November 1.FP playfield capture works with the current stable build of Open Broadcaster Software (0.656). Quote Link to comment Share on other sites More sharing options...
Rhyno77 Posted November 7, 2015 Share Posted November 7, 2015 Hey Gtxjoe, first off, I wanted to say thanks for packaging Carny_priest's utility into a nice little gui option. It works pretty well for me, but I have a few issues that I was wondering if you'd seen in your usage.Despite checking the option to only capture tables that need media, it goes through all of them. I let it run through completely for a few hours, then tried it again and it captured them all a second time.For some reason it's not capturing my dmd on monitor 2 of 3, only the backglass and playfield.Thanks again to both of you! Quote Link to comment Share on other sites More sharing options...
allknowing2012 Posted November 7, 2015 Share Posted November 7, 2015 Yes thanks for taking this to the next level! Now we have somewhere to point people to who are missing their background vids and screenshots. I ran into issues with those dreaded old b2s.exe backglasses, but with the "only do missing stuff" option, its only a pain the first time thru. The program is redoing many of my vids since the naming didn't match the description. Thanks okay .. again, one time thru pain and suffering.I have a few vids that come back corrupt from the ffmpeg issues - I havent tracked that down - if its perhaps related to the non "even" x/y resolution settings or what. In any case its pretty simple to see those bad files in file explorerer, delete them and re-run the script again. It usually gets the second time thru. Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted November 8, 2015 Author Share Posted November 8, 2015 Just curious, what issues are you having with B2S?I haven't had any issues with corrupt output, but my resolutions are fairly standard. Also, the output uses a full color palette. Works perfectly well with LAV filters but may pose issues with other codecs. This can be fixed to output a color palette that will work with anything. Quote Link to comment Share on other sites More sharing options...
gtxjoe Posted November 8, 2015 Share Posted November 8, 2015 Thanks for trying this out. I need people to try this to work out the bugs I did have an issue with not recording my DMD when the dmd height defined screenres.txt was an odd value, not an even value. I had dmd height of 305, when I changed it to 300, it worked fine. I can investigate further and maybe have the script subtract 1 pixel from odd values.@Rhyno, send or post your screenres.txt and pbxrecorder.ini file so we can try to check out the DMD recording on our machines. Try setting the DMD width and height to some even numbers as a test. If the DMD video is not getting recorded, then every time you run the script, the script will see that the DMD video is missing and re-record all videos for the table (table/backglass/dmd), so the videos are all synchronized. That would explain why it re-records every table everytime, so lets figure out why the DMD is not being recorded. I assume you never saw the pop-up saying skipping table recording...@allknowing2012 - How were you naming your videos before this? The reasons for the re-recording of videos, could be that the script found media missing for a table. If 1 video or even 1 image, if you enabled that, is missing, it will re-record all media for that table. Next time, it will be skipped. Let me know if table skipping is working for you on subsequent runs. As for ffmpeg issues, send or post your screenres.txt and pbxrecorder.ini for us to try out. Also, I am not sure what you mean about B2S.exe issue. Can you explain a little more Quote Link to comment Share on other sites More sharing options...
Rhyno77 Posted November 8, 2015 Share Posted November 8, 2015 You're right about my DMD height; it's set to 315. I'm setting to 310 and we'll see how it runs through the night.Thanks!ScreenRes.txtPBXrecorder.ini Quote Link to comment Share on other sites More sharing options...
Jodannar Posted November 8, 2015 Share Posted November 8, 2015 Ive just run this across my cab for the first 10-15 tables. VP wasnt being closed between table loads. Subsequently older/previous tables were being recorded as the focus wasnt shifting to the new table. I now have recordings of the same table for multiple tables as the focus was not set to the proper table/old table closed before new opened.I also have scrambled video for 90% of the recordings. Definately something wrong in my setup. Quote Link to comment Share on other sites More sharing options...
gtxjoe Posted November 8, 2015 Share Posted November 8, 2015 What table did it stop working with? For me acdc crashes randomly a lot and that caused problems for tables after it. I had to remove that table from my xml. I added it back later and once I got a successful recording. It skips that problematic tableWas the stuck table running correctly or was it stuck on a crash screen or error or maybe the VP editor screen. I can try to add a few kill app commands in between tables so at least subsequent tables record properlyMaybe upload one of the smaller scrambled vids for us to check out to investigate Quote Link to comment Share on other sites More sharing options...
allknowing2012 Posted November 8, 2015 Share Posted November 8, 2015 b2s.exe issue .. those backglasses (ie before directb2s came out) dont stop when you kill vp.exe. I have to use a kill.bat script in pinballx to handle them. Assuming everyone has that issue ???Any of them .. acdc/rush/abracadabra/surfer/sure shot. Quote Link to comment Share on other sites More sharing options...
allknowing2012 Posted November 8, 2015 Share Posted November 8, 2015 I too have hit or miss on vids .. they dont render. I re-run a number of times to eventually get it .. but havent been able to get thru all of them yet."@allknowing2012 - How were you naming your videos before this? The reasons for the re-recording of videos, could be that the script found media missing for a table. If 1 video or even 1 image, if you enabled that, is missing, it will re-record all media for that table. Next time, it will be skipped. Let me know if table skipping is working for you on subsequent runs. "Skipping does work .. my vids are named (game).avi whereas you are checking for (description).avi Quote Link to comment Share on other sites More sharing options...
Rhyno77 Posted November 8, 2015 Share Posted November 8, 2015 Ive just run this across my cab for the first 10-15 tables. VP wasnt being closed between table loads. Subsequently older/previous tables were being recorded as the focus wasnt shifting to the new table. I now have recordings of the same table for multiple tables as the focus was not set to the proper table/old table closed before new opened.I also have scrambled video for 90% of the recordings. Definately something wrong in my setup.You might want to check your vpinball.exe's for "run as administrator". I unchecked the run as admin boxes and now the capture.exe has high enough permissions to kill the vpinball task. Quote Link to comment Share on other sites More sharing options...
Rhyno77 Posted November 8, 2015 Share Posted November 8, 2015 Btw, GTXJoe, I re-ran the exe last night with my screenres dmd values changed to even numbers, but unfortunately it didn't seem to make a difference. All tables were captured again, without dmd.192010801366768200136631013702400 Quote Link to comment Share on other sites More sharing options...
zanehed Posted November 8, 2015 Share Posted November 8, 2015 Hi guys, loving the progress on this, no DMD video for me either. Playfield and backglass are perfect.GTX66019201080168010502001280 370168000 Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted November 8, 2015 Author Share Posted November 8, 2015 b2s.exe issue .. those backglasses (ie before directb2s came out) dont stop when you kill vp.exe. I have to use a kill.bat script in pinballx to handle them. Assuming everyone has that issue ???Any of them .. acdc/rush/abracadabra/surfer/sure shot.It would be easy enough to incorporate the rosveClose subroutine from fplaunch when killing the VP process in the script. Quote Link to comment Share on other sites More sharing options...
gtxjoe Posted November 8, 2015 Share Posted November 8, 2015 Here is a link to 1) PBXrecorder_Beta02: which is for 2 or 3 monitor setup - just has minor fixes, including a bugfix for 2 monitor setup. 2) PBXrecorder_NODMD_Beta02: This is a temporary release- DMD recording is disabled and skipped on 3 monitor setups for those have DMD recording issues. It will let you capture at least the playfield and backglass as intended About B2S.exe, Yes, Send me the close backglass.exe routine used and I can add it to the script. I dont have any tables using B2S.exe.. Now for DMD troubleshooting: Download the dmdtest.zip and unzip in the folder with the PBX recording script. Run it and it will create a file called "PBXrecorderDMD.cmd" Double click on that new file and it will try to record a 2 second video of the dmd monitor (VP will not be started). Scroll up and look for errors in the window. and you can see if a dmd.mkv file was created in the same folder, it should be a 2 second video PBXrecorder_Beta02.zip PBXrecorder_NODMD_Beta02.zip dmdtest.zip Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted November 8, 2015 Author Share Posted November 8, 2015 About B2S.exe, Yes, Send me the close backglass.exe routine used and I can add it to the script. I dont have any tables using B2S.exe..This is taken from my miniDMD script which is my VP Launcher. Instead of killing the VP process you would run the subroutines; *********************************************** ; CloseVP from FPLaunchCloseVP:;toLog("CloseVP Called");Hotkey, %exitScriptKey%, OffGoSub rosveClose;GoSub bigbossClose ; change loops completely, put all data in xml !!! too slow;Visual Pinball must be closed this way instead of killing process ;or it wil not save your last game information.i.e score/credtis;DetectHiddenWindows on ;Or next line will not work;Loop, 4;Gui, %A_Index%: Destroy;This line fixes where the VP Window flashes real quick;when closing the window for a cleaner exit; win hide removed cause vp should be minimized, not hidden;WinHide, ahk_class VPinball;WinShow, ahk_class VPinballWinMinimize, ahk_class VPinballWinClose, ahk_class VPinballWinWaitClose ahk_class VPinball; bigbossclose won't get executed cause main thread will exit;GoSub bigbossClose; there's no need for exitscript cause main thread will do it;Goto ExitScriptreturn rosveClose:;toLog("rosveClose Called"); rosve; --------------------------------------------------------------; --- Close the animated backglass -----------------------; --------------------------------------------------------------; b2s close bug fixStringRight, ending, XTable, 3if (ending = "B2S"){WinKill, Form1}return ; *********************************************** #IfWinActive ahk_class VPPlayer ; Interlock Switchi::Send {End}SetTimer, WaitForJoy7, 10Return WaitForJoy7:if GetKeyState("Joy7")returnSend {End}SetTimer, WaitForJoy7, offReturn ; Exit Tablee:: Gosub CloseVPReturn #IfWinActive Quote Link to comment Share on other sites More sharing options...
Rhyno77 Posted November 9, 2015 Share Posted November 9, 2015 Hey Gtxjoe, I don't have too much time tonight, so I'll try some things tomorrow to hopefully resolve.Here's the output of mine - It runs for just a blip then exits out with the error below:C:\WINDOWS\system32>"C:\ffmpeg32\bin\ffmpeg" -y -t 2 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 3290 -offset_y 240 -video_size 1366x310 -i desktop -vcodec libx264 -preset ultrafast -qp 0 -threads 8 "C:\ffmpeg32\dmd.mkv"ffmpeg version N-76347-gdd36749 Copyright © 2000-2015 the FFmpeg developers built with gcc 5.2.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 5.100 / 55. 5.100 libavcodec 57. 12.100 / 57. 12.100 libavformat 57. 11.100 / 57. 11.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 14.101 / 6. 14.101 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 / 2. 0.100 libpostproc 54. 0.100 / 54. 0.100[gdigrab @ 04ee36a0] Capture area (3290,240),(4656,550) extends outside window area (0,0),(4646,1080)desktop: Input/output error C:\WINDOWS\system32>PausePress any key to continue . . . Quote Link to comment Share on other sites More sharing options...
Rhyno77 Posted November 9, 2015 Share Posted November 9, 2015 Ok, I couldn't let this sit til tomorrow - I changed the following:From:"C:\ffmpeg32\bin\ffmpeg" -y -t 2 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 3290 -offset_y 204 -video_size 1366x310 -i desktop -vcodec libx264 -preset ultrafast -qp 0 -threads 8 "C:\ffmpeg32\dmd.mkv"To:"C:\ffmpeg32\bin\ffmpeg" -y -t 2 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 3290 -offset_y 205 -video_size 1356x310 -i desktop -vcodec libx264 -preset ultrafast -qp 0 -threads 8 "C:\ffmpeg32\dmd.mkv" Knocking down the output size by 10 pixels has fixed it. Not exactly sure why, since the DMD monitor itself is 1360 wide, and that's the number I'm using in b2s and Pinballfx2. I suspect that my problem lies with my monitors being differently positioned than most (1=pf, 2=dmd, 3=bg ), but i'm not sure. Thanks for the support GTXJOE! Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted November 9, 2015 Author Share Posted November 9, 2015 The error in the log - the numbers following window area are the X and Y coordinates of your entire desktop with (0,0) the very upper left corner (usually your playfield). And (4646, 1080) means the width of the entire desktop is 4646 px and the height is 1080 px.Then the capture area defined by the capture instruction starts at position 3290 px and extends out to 4656 px. 4656 > 4646. Ffmpeg does not like it if it is told to capture an area not contained by the desktop, and it will crash.If the DMD width is really 1360 then you can hard code the instruction to use 1360, and it should run.Sent from my iPad using Tapatalk 1 Quote Link to comment Share on other sites More sharing options...
gtxjoe Posted November 9, 2015 Share Posted November 9, 2015 Yep that is it. It looks like you have playfield resolution of 1920x1080, backglass resolution of 1366x768 and then a dmd resolution of 1360x7681920+1366+1360 = 4646 pixels wide maxIf that is true, you should change your screenres.txt to align with your monitor resolutions better. The changes below reduces the width by 10 pixels and it should work now1920 1080 1366 768 2 0 0 1366--->1360310 1370--->1366240 0 If you don't like how that changes your B2S DMD window when playing tables, then do what Carny said and hard code these values in the PBXvideorecorder ahk, so look for this lineDMD_X:=PF_width+XDMD_X ;Reference to Top Left of Playfield screenand above it add these 2 lines:DMD_width = 1360XDMD_X = 1366 1 Quote Link to comment Share on other sites More sharing options...
Jodannar Posted November 9, 2015 Share Posted November 9, 2015 A flag to only record the back-glass, dmd or play field would be useful if possible. I use the directb2s directly in my front end along with pinmame for the majority of tables.Also a way to paramater-ise the duration of the recording to a user selection. Personally 15 seconds of attract loop is plenty per table Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted November 9, 2015 Author Share Posted November 9, 2015 Well, that is the deal with the script that I use personally for capturing. I wound up using a custom xml with an added B2S tag so that I could control whether or not I would record the DMD area depending on the table.Of course, that means I can't use Game Manager. And that may be a dealbreaker for many users. It was OK for me. I'm used to putting together my own media packs and editing the xml by hand in Notepad. I always record all three screens. These are captured simultaneously, and I like that as a result the video are synced together in PBX attract/preview mode. Best example of the effect would be Mystery Castle. That's why I don't use PBX built-in VPM or dB2S support. But it's cool if you do; it does save disk space for more tables. Quote Link to comment Share on other sites More sharing options...
allknowing2012 Posted November 9, 2015 Share Posted November 9, 2015 Turns out the issue for me was the taskkill lines after the captureRun, taskkill /IM ffmpeg.exe /F,,UseErrorLevelIt was a bit too eager and it was killing the ffmpeg before it could complete the capture file cleanly. I simply commented them out and it had no problem doing the remaining tables. The program closes itself under normal circumstances anyways.Another option might be to increase the sleep, 5000 to say sleep, 10000.I also added a Beep at the end of each table capture so I can hear it working away :-)soundbeep, 1000, 700 Quote Link to comment Share on other sites More sharing options...
gtxjoe Posted November 9, 2015 Share Posted November 9, 2015 Glad you got it figured out. I will look at rosve's script for kill the B2S.exe. How do you do it on your setup?Just above that is a 75 second wait. I guess on my new fast computer is is fine, but yes I should double it or even triple it. It really only intended to kill it if something goes wrongProcess, WaitClose, ffmpeg.exe, 75To do and possible enhancements:- Increase ffmpeg waitclose to 2x or 3x record times- Kill backglass.exe- Ability to specify which of the 6 possible medias to record: pf video, bg video, dmd video, pf image, bg image, dmd image- Detect if DMD recording window exceeds windows virtual desktop width- Drag and drop support of tables- Maybe allow naming to Table name instead of Description name Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted November 10, 2015 Author Share Posted November 10, 2015 This is my personal capture script. This uses a custom xml, mostly to support my miniDMD project which is a VP launcher, but it may be possible to use a standard xml. If tag 'rom' is populated, the script will pull the correct capture dimensions from the VPM registry. Tag 'exe' stores the correct executable. This would be 'alternateexe' in a standard xml. The new one is the tag 'B2S'. If True, the script will pull the correct capture dimensions from screenres.txt. There are some extras here: custom hard codes for certain roms where I am intentionally overscanning. If I pulled the values from the registry, ffmpeg will crash because the capture area is beyond the defined area of the desktop. I also have a section for AMH, where if the table is selected then the capture parameters are pulled from the UltraDMD key in the registry. I don't have the B2S kill script in here but you would replace line 256 with something involving those rosveClose/CloseVP subroutines from FPLaunch. They have been used for years in HyperPin. They are tried and true; works every time for me in my VPLauncher.#NoEnv #SingleInstance force#WinActivateForce;http://www.gameex.info/forums/topic/14632-multiple-exe-for-vp/#entry137471 - Thanks horseyhorsey#Include, %A_ScriptDir%\xpath.ahkSetTitleMatchMode, 2DetectHiddenWindows, On ; User inputsPinballX_Path=c:\PinballXFFMPEG_Path=c:\ffmpeg\binOBS_Path=d:\Eric\VP\OBS_0_656b\64bitAudio_Device="Stereo Mix (Realtek High Defini" ;Audio_Device=""What U Hear" (Creative SB Audi" Table=%1% ;Table filename SplitPath, Table,,, ext, XTable If ext=fptsystem=FuturePinballElse system=VisualPinball ; Read PinballX config for pathsIf system=VisualPinballName=Visual PinballElse If system=FuturePinballName=Future PinballIniRead, WorkingPath, %PinballX_Path%\Config\PinballX.ini, %system%, WorkingPathIniRead, TablePath, %PinballX_Path%\Config\PinballX.ini, %system%, TablePath ; Read description tag from xml - Thanks horseyhorsey - http://www.gameex.info/forums/topic/14632-multiple-exe-for-vp/#entry129111databaseFile=%PinballX_Path%\Databases\%Name%\%Name%.xmlxpath_load(dbXML, databaseFile ) ; need to read the existing xml otherwise xpath deletes all existing nodesdescription:=XPath(dbXML, "/menu/game[@name= . XTable . ]/description/text()")exe:= XPath(dbXML, "/menu/game[@name= . XTable . ]/exe/text()")rom:= XPath(dbXML, "/menu/game[@name= . XTable . ]/rom/text()")B2S:= XPath(dbXML, "/menu/game[@name= . XTable . ]/B2S/text()")StringReplace, description, description,,,`,,StringGetPos, pos, description,\If ErrorLevel=1StringGetPos, pos, description,/If ErrorLevel=1StringGetPos, pos, description,:If ErrorLevel=1StringGetPos, pos, description,*If ErrorLevel=1StringGetPos, pos, description,?If ErrorLevel=1StringGetPos, pos, description,"If ErrorLevel=1StringGetPos, pos, description,>If ErrorLevel=1StringGetPos, pos, description,|If ErrorLevel=0description=%XTable% If ext=fpt{IniRead, exe, %PinballX_Path%\Config\PinballX.ini, %system%, Executable RegRead, PF_width, HKCU, Software\Future Pinball\GamePlayer, WidthRegRead, PF_height, HKCU, Software\Future Pinball\GamePlayer, HeightRegRead, BG_width, HKCU, Software\Future Pinball\GamePlayer, SecondMonitorWidthRegRead, BG_height, HKCU, Software\Future Pinball\GamePlayer, SecondMonitorHeight IniRead, DMD_width, %WorkingPath%\FutureDMD.ini, default, SizeWIniRead, DMD_height, %WorkingPath%\FutureDMD.ini, default, SizeHIniRead, DMD_X, %WorkingPath%\FutureDMD.ini, default, PosXIniRead, DMD_Y, %WorkingPath%\FutureDMD.ini, default, PosY IniWrite, %PF_width%, %OBS_Path%\profiles\FuturePinball.ini, Video, BaseWidth IniWrite, %PF_height%, %OBS_Path%\profiles\FuturePinball.ini, Video, BaseHeight IniWrite, %A_ScriptDir%\playfield.mp4, %OBS_Path%\profiles\FuturePinball.ini, Publish, SavePath IniWrite, %A_ScriptDir%\Replay-$T.flv, %OBS_Path%\profiles\FuturePinball.ini, Publish, ReplayBufferSavePath FileRead, Text, %OBS_Path%\sceneCollection\FuturePinball.xconfig ; Read file and return as var TextIfNotInString, Text, %PF_width%IfNotInString, Text, %PF_height%{IfInString, Text, 1280IfInString, Text, 1024 {StringReplace, Text, Text, 1280, %PF_width%, AllStringReplace, Text, Text, 1024, %PF_height%, AllFileDelete, %OBS_Path%\sceneCollection\FuturePinball.xconfigFileAppend, %Text%, %OBS_Path%\sceneCollection\FuturePinball.xconfiginit=1}If init !=1{MsgBox Warning playfield width/height do not match FuturePinball.xconfigExitApp}}}Else{StringReplace, WorkingPath, TablePath, \Tables FileReadLine, PF_width, %TablePath%\ScreenRes.txt, 1FileReadLine, PF_height, %TablePath%\ScreenRes.txt, 2FileReadLine, BG_width, %TablePath%\ScreenRes.txt, 3FileReadLine, BG_height, %TablePath%\ScreenRes.txt, 4 RegRead, XDMD_width, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_widthRegRead, XDMD_height, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_heightRegRead, DMD_X, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_xRegRead, DMD_Y, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_yDMD_width:=XDMD_width-3DMD_height:=XDMD_height-3; HardcodeIf rom=hirolcas{DMD_width:=768DMD_height:=294DMD_X:=3840DMD_Y:=125} If rom=simpprty{DMD_width:=768DMD_height:=294DMD_X:=3840DMD_Y:=125} If rom=ripleys{DMD_width:=768DMD_height:=294DMD_X:=3840DMD_Y:=125} If rom=wpt_140a{DMD_width:=768DMD_height:=294DMD_X:=3840DMD_Y:=125} If rom=taf_l7{DMD_width:=768DMD_height:=238DMD_X:=3840DMD_Y:=200} If description=America's Most Haunted (Spooky Pinball LLC 2014) {RegRead, DMD_width, HKCU, Software\UltraDMD, wRegRead, DMD_height, HKCU, Software\UltraDMD, hRegRead, DMD_X, HKCU, Software\UltraDMD, xRegRead, DMD_Y, HKCU, Software\UltraDMD, y} If B2S=True{FileReadLine, DMD_width, %TablePath%\ScreenRes.txt, 8FileReadLine, DMD_height, %TablePath%\ScreenRes.txt, 9FileReadLine, XDMD_X, %TablePath%\ScreenRes.txt, 10FileReadLine, DMD_Y, %TablePath%\ScreenRes.txt, 11DMD_X:=PF_width+XDMD_X ;Reference to Top Left of Playfield screen}} ;Disable Aero if EnabledRegRead, DWMComp, HKCU, Software\Microsoft\Windows\DWM, CompositionAero=%DWMComp%If Aero=1Run, sc stop uxsms,, Hide If ext=fptRun, "%PinballX_Path%\Scripts\dc2.exe" -configure="%PinballX_Path%\Scripts\dc2config\FPSettings.xml",, HideElse Run, "%PinballX_Path%\Scripts\dc2.exe" -configure="%PinballX_Path%\Scripts\dc2config\VPMSettings.xml",, Hide If ext=fpt{Run, %WorkingPath%\%exe% /STAYINRAM /open "%TablePath%\%Table%" /play /exitProcess, Wait, Future Pinball.exeIf DMD_width>0Run, %WorkingPath%\FutureDMD.exe table="%Table%" close=1}Else{Run, %WorkingPath%\%exe%.exe -play "%TablePath%\%Table%"Process, Wait, %exe%.exe} Sleep, 30000 ; Allow time for table score display to get well beyond loading and boot images ; Fastest CaptureIf ext=fptRun, %OBS_Path%\OBS.exe -portable -profiles "FuturePinball" -start,, HideElse; Run, %FFMPEG_Path%\ffmpeg -t 70 -rtbufsize 1500M -f dshow -i audio=%Audio_Device% -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size %PF_width%x%PF_height% -i desktop -c:v libx264 -preset ultrafast -qp 0 -c:a copy -threads 8 "%A_ScriptDir%\playfield.mkv",, HideRun, %FFMPEG_Path%\ffmpeg -t 70 -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size %PF_width%x%PF_height% -i desktop -c:v libx264 -preset ultrafast -qp 0 -threads 8 "%A_ScriptDir%\playfield.mkv",, HideRun, %FFMPEG_Path%\ffmpeg -t 70 -f gdigrab -framerate 30 -offset_x %PF_width% -offset_y 0 -video_size %BG_width%x%BG_height% -i desktop -c:v libx264 -preset ultrafast -qp 0 -threads 8 "%A_ScriptDir%\bg.mkv",, HideIf DMD_width>0 Run, %FFMPEG_Path%\ffmpeg -t 70 -f gdigrab -framerate 30 -offset_x %DMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_height% -i desktop -c:v libx264 -preset ultrafast -qp 0 -threads 8 "%A_ScriptDir%\dmd.mkv",, Hide If ext=fpt{WinHide, ahk_class FuturePinballWinMinimize, ahk_class FuturePinballWinActivate, ahk_class FuturePinballOpenGLWinWaitActive, ahk_class FuturePinballOpenGLWinHide, ahk_class ButtonWinHide, ahk_class Shell_TrayWnd}Else {WinActivate, Visual Pinball PlayerWinWaitActive, Visual Pinball Player} Process, WaitClose, ffmpeg.exe, 80Process, Close, %ErrorLevel%WinClose, ahk_class OBSWindowClass If ext=fpt{Sleep, 15000Run, taskkill /im OBS.exe /f,, Hide ; CloseFP from FPLaunchWinHide, ahk_class FuturePinballWinMinimize, ahk_class FuturePinball;Future Pinball must be closed this way instead of killing process;or it wil not save your last game information.i.e score/credtisWinActivate, ahk_class FuturePinballOpenGLWinWaitActive, ahk_class FuturePinballOpenGLSend {Esc}WinWaitClose, ahk_class FuturePinballOpenGL;saving fp table position, black screen hides fp window; if (saveFPTables = "true") and (saveFPNeeded = "true") {; ;WinRestore, ahk_class FuturePinball; WinActivate, ahk_class FuturePinball; WinWaitActive, ahk_class FuturePinball; WinMenuSelectItem, ahk_class FuturePinball,,File,Save; Sleep, 1000; }; IfExist %emupath%\FutureDMD.exeProcess, close, FutureDMD.exeWinClose, ahk_class FuturePinballWinWaitClose, ahk_class FuturePinball WinShow, ahk_class ButtonWinShow, ahk_class Shell_TrayWnd}Else{Run, taskkill /im %exe%.exe /f,, HideProcess, close, UltraDMD.exe} Run, "%PinballX_Path%\Scripts\dc2.exe" -configure="%PinballX_Path%\Scripts\dc2config\StandardSettings.xml",, Hide ;Enable Aero if Enabled at the start of script executionIf Aero=1Run, sc start uxsms,, Hide ; Post Capture Trim and TranscodeIf ext=fptRun, %FFMPEG_Path%\ffmpeg -y -i "%A_ScriptDir%\playfield.mp4" -ss 5 -to 65 -vf [in]rotate=PI:bilinear=0[middle];[middle]scale=1920:-1[out] -map 0:1 -c:v libx264 -crf 26 "%PinballX_Path%\Media\%Name%\Table Videos\%description%.f4v"ElseRun, %FFMPEG_Path%\ffmpeg -y -i "%A_ScriptDir%\playfield.mkv" -ss 5 -to 65 -vf [in]rotate=PI:bilinear=0[middle];[middle]scale=1920:-1[out] -map 0:0 -c:v libx264 -crf 26 "%PinballX_Path%\Media\%Name%\Table Videos\%description%.f4v"Run, %FFMPEG_Path%\ffmpeg -y -i "%A_ScriptDir%\bg.mkv" -ss 5 -to 65 -vf "scale=1920:-1" -c:v libx264 -crf 26 "%PinballX_Path%\Media\%Name%\Backglass Videos\%description%.f4v"If DMD_width>0{; If description=America's Most Haunted (Spooky Pinball LLC 2014) ; Run, %FFMPEG_Path%\ffmpeg -y -i "%A_ScriptDir%\dmd.mkv" -ss 5 -to 65 -vf "vflip" -c:v libx264 -crf 26 "%PinballX_Path%\Media\%Name%\DMD Videos\%description%.f4v"; ElseRun, %FFMPEG_Path%\ffmpeg -y -i "%A_ScriptDir%\dmd.mkv" -ss 5 -to 65 -c:v libx264 -crf 26 "%PinballX_Path%\Media\%Name%\DMD Videos\%description%.f4v"}Process, WaitClose, ffmpeg.exe ; Clean upFileDelete, %A_ScriptDir%\playfield.mp4FileDelete, %A_ScriptDir%\playfield.mkvFileDelete, %A_ScriptDir%\bg.mkvFileDelete, %A_ScriptDir%\dmd.mkv ExitApp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.