Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. Thank you for your support. Tom Speirs

Patreon

Capture Videos to PinballX Media - Table, Backglass, and DMD


Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 table

Was 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 properly

Maybe upload one of the smaller scrambled vids for us to check out to investigate

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 FPLaunch
CloseVP:
;toLog("CloseVP Called")
;Hotkey, %exitScriptKey%, Off
GoSub 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 VPinball
WinMinimize, ahk_class VPinball
WinClose, ahk_class VPinball
WinWaitClose 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 ExitScript
return
rosveClose:
;toLog("rosveClose Called")
; rosve
; --------------------------------------------------------------
; --- Close the animated backglass -----------------------
; --------------------------------------------------------------
; b2s close bug fix
StringRight, ending, XTable, 3
if (ending = "B2S")
{
WinKill, Form1
}
return
; ***********************************************
#IfWinActive ahk_class VPPlayer
; Interlock Switch
i::
Send {End}
SetTimer, WaitForJoy7, 10
Return
WaitForJoy7:
if GetKeyState("Joy7")
return
Send {End}
SetTimer, WaitForJoy7, off
Return
; Exit Table
e::
Gosub CloseVP
Return
#IfWinActive

Link to comment
Share on other sites

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>Pause
Press any key to continue . . .
Link to comment
Share on other sites

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!
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

Yep that is it. It looks like you have playfield resolution of 1920x1080, backglass resolution of 1366x768 and then a dmd resolution of 1360x768

1920+1366+1360 = 4646 pixels wide max

If 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 now

1920
1080
1366
768
2
0
0
1366--->1360
310
1370--->1366
240

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 line

DMD_X:=PF_width+XDMD_X ;Reference to Top Left of Playfield screen

and above it add these 2 lines:

DMD_width = 1360

XDMD_X = 1366

  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

Turns out the issue for me was the taskkill lines after the capture

Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel

It 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

Link to comment
Share on other sites

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 wrong

Process, WaitClose, ffmpeg.exe, 75

To 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

Link to comment
Share on other sites

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
#Include, %A_ScriptDir%\xpath.ahk
SetTitleMatchMode, 2
DetectHiddenWindows, On
; User inputs
PinballX_Path=c:\PinballX
FFMPEG_Path=c:\ffmpeg\bin
OBS_Path=d:\Eric\VP\OBS_0_656b\64bit
Audio_Device="Stereo Mix (Realtek High Defini"
;Audio_Device=""What U Hear" (Creative SB Audi"
Table=%1% ;Table filename
SplitPath, Table,,, ext, XTable
If ext=fpt
system=FuturePinball
Else system=VisualPinball
; Read PinballX config for paths
If system=VisualPinball
Name=Visual Pinball
Else If system=FuturePinball
Name=Future Pinball
IniRead, WorkingPath, %PinballX_Path%\Config\PinballX.ini, %system%, WorkingPath
IniRead, 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/#entry129111
databaseFile=%PinballX_Path%\Databases\%Name%\%Name%.xml
xpath_load(dbXML, databaseFile ) ; need to read the existing xml otherwise xpath deletes all existing nodes
description:=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=1
StringGetPos, pos, description,/
If ErrorLevel=1
StringGetPos, pos, description,:
If ErrorLevel=1
StringGetPos, pos, description,*
If ErrorLevel=1
StringGetPos, pos, description,?
If ErrorLevel=1
StringGetPos, pos, description,"
If ErrorLevel=1
StringGetPos, pos, description,>
If ErrorLevel=1
StringGetPos, pos, description,|
If ErrorLevel=0
description=%XTable%
If ext=fpt
{
IniRead, exe, %PinballX_Path%\Config\PinballX.ini, %system%, Executable
RegRead, PF_width, HKCU, Software\Future Pinball\GamePlayer, Width
RegRead, PF_height, HKCU, Software\Future Pinball\GamePlayer, Height
RegRead, BG_width, HKCU, Software\Future Pinball\GamePlayer, SecondMonitorWidth
RegRead, BG_height, HKCU, Software\Future Pinball\GamePlayer, SecondMonitorHeight
IniRead, DMD_width, %WorkingPath%\FutureDMD.ini, default, SizeW
IniRead, DMD_height, %WorkingPath%\FutureDMD.ini, default, SizeH
IniRead, DMD_X, %WorkingPath%\FutureDMD.ini, default, PosX
IniRead, 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 Text
IfNotInString, Text, %PF_width%
IfNotInString, Text, %PF_height%
{
IfInString, Text, 1280
IfInString, Text, 1024
{
StringReplace, Text, Text, 1280, %PF_width%, All
StringReplace, Text, Text, 1024, %PF_height%, All
FileDelete, %OBS_Path%\sceneCollection\FuturePinball.xconfig
FileAppend, %Text%, %OBS_Path%\sceneCollection\FuturePinball.xconfig
init=1
}
If init !=1
{
MsgBox Warning playfield width/height do not match FuturePinball.xconfig
ExitApp
}
}
}
Else
{
StringReplace, WorkingPath, TablePath, \Tables
FileReadLine, PF_width, %TablePath%\ScreenRes.txt, 1
FileReadLine, PF_height, %TablePath%\ScreenRes.txt, 2
FileReadLine, BG_width, %TablePath%\ScreenRes.txt, 3
FileReadLine, BG_height, %TablePath%\ScreenRes.txt, 4
RegRead, XDMD_width, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_width
RegRead, XDMD_height, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_height
RegRead, DMD_X, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_x
RegRead, DMD_Y, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_y
DMD_width:=XDMD_width-3
DMD_height:=XDMD_height-3
; Hardcode
If rom=hirolcas
{
DMD_width:=768
DMD_height:=294
DMD_X:=3840
DMD_Y:=125
}
If rom=simpprty
{
DMD_width:=768
DMD_height:=294
DMD_X:=3840
DMD_Y:=125
}
If rom=ripleys
{
DMD_width:=768
DMD_height:=294
DMD_X:=3840
DMD_Y:=125
}
If rom=wpt_140a
{
DMD_width:=768
DMD_height:=294
DMD_X:=3840
DMD_Y:=125
}
If rom=taf_l7
{
DMD_width:=768
DMD_height:=238
DMD_X:=3840
DMD_Y:=200
}
If description=America's Most Haunted (Spooky Pinball LLC 2014)
{
RegRead, DMD_width, HKCU, Software\UltraDMD, w
RegRead, DMD_height, HKCU, Software\UltraDMD, h
RegRead, DMD_X, HKCU, Software\UltraDMD, x
RegRead, DMD_Y, HKCU, Software\UltraDMD, y
}
If B2S=True
{
FileReadLine, DMD_width, %TablePath%\ScreenRes.txt, 8
FileReadLine, DMD_height, %TablePath%\ScreenRes.txt, 9
FileReadLine, XDMD_X, %TablePath%\ScreenRes.txt, 10
FileReadLine, DMD_Y, %TablePath%\ScreenRes.txt, 11
DMD_X:=PF_width+XDMD_X ;Reference to Top Left of Playfield screen
}
}
;Disable Aero if Enabled
RegRead, DWMComp, HKCU, Software\Microsoft\Windows\DWM, Composition
Aero=%DWMComp%
If Aero=1
Run, sc stop uxsms,, Hide
If ext=fpt
Run, "%PinballX_Path%\Scripts\dc2.exe" -configure="%PinballX_Path%\Scripts\dc2config\FPSettings.xml",, Hide
Else
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 /exit
Process, Wait, Future Pinball.exe
If DMD_width>0
Run, %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 Capture
If ext=fpt
Run, %OBS_Path%\OBS.exe -portable -profiles "FuturePinball" -start,, Hide
Else
; 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",, Hide
Run, %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",, Hide
Run, %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",, Hide
If 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 FuturePinball
WinMinimize, ahk_class FuturePinball
WinActivate, ahk_class FuturePinballOpenGL
WinWaitActive, ahk_class FuturePinballOpenGL
WinHide, ahk_class Button
WinHide, ahk_class Shell_TrayWnd
}
Else
{
WinActivate, Visual Pinball Player
WinWaitActive, Visual Pinball Player
}
Process, WaitClose, ffmpeg.exe, 80
Process, Close, %ErrorLevel%
WinClose, ahk_class OBSWindowClass
If ext=fpt
{
Sleep, 15000
Run, taskkill /im OBS.exe /f,, Hide
; CloseFP from FPLaunch
WinHide, ahk_class FuturePinball
WinMinimize, 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/credtis
WinActivate, ahk_class FuturePinballOpenGL
WinWaitActive, ahk_class FuturePinballOpenGL
Send {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.exe
Process, close, FutureDMD.exe
WinClose, ahk_class FuturePinball
WinWaitClose, ahk_class FuturePinball
WinShow, ahk_class Button
WinShow, ahk_class Shell_TrayWnd
}
Else
{
Run, taskkill /im %exe%.exe /f,, Hide
Process, 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 execution
If Aero=1
Run, sc start uxsms,, Hide
; Post Capture Trim and Transcode
If ext=fpt
Run, %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"
Else
Run, %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"
; Else
Run, %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 up
FileDelete, %A_ScriptDir%\playfield.mp4
FileDelete, %A_ScriptDir%\playfield.mkv
FileDelete, %A_ScriptDir%\bg.mkv
FileDelete, %A_ScriptDir%\dmd.mkv
ExitApp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...