Carny_Priest Posted October 3, 2014 Share Posted October 3, 2014 This is part proof of concept and part feature request.The following script starts a user defined Visual Pinball table and captures up to three videos -1. Table2. Backglass3. DMD Parameters for the capture are read from the user's ScreenRes.txt file.Output files are saved in the appropriate Media/Visual Pinball folder.This assumes that Visual Pinball is in the default installation path "Program Files (x86)" and PinballX is in the default installation path on the C drive. Change the script as needed.The script is using an experimental version of VPinball990. Change the executable in the script as needed.The script produces video clips about 1 minute long, high quality, and size somewhere around 10 Mb or under.Requires the Windows static build of ffmpeg which is free and open-source:http://ffmpeg.zeranoe.com/builds/I would use this to capture the attract mode sequence, but it is certainly possible to capture in-play.As the script captures playfield, backglass, and DMD simultaneously, the sequences should be synced. If a DMD area is not defined in ScreenRes.txt then the script assumes the configuration is two screen and no DMD area is captured.Output file names match the VP table name. In my database, I use the same VP table name as the "game name" field. So, PinballX will pick up and display these videos without any further renaming required. The benefit is that the user no longer needs to rely on others to upload media, and that the resulting output best reflects the user's specific table configuration (e.g., layback settings, offset, graphic mods, DMD colorization, 2 screen or 3 screen B2S).If you have a three screen cab, there is typically no B2S LED alpha-numeric displays uploaded on our favorite sites. This will capture a video of the B2S LED for those tables.One warning, ffmpeg's built-in gdigrab device is video only, no audio. I have my settings.ini set-up to mute sound in videos anyway because that is my preference. It should be possible to add sound if not with gdigrab then with another DirectShow-based screen capture device like Screen Capturer Recorder. #NoEnv #SingleInstance force#WinActivateForceSetTitleMatchMode 2DetectHiddenWindows OnFileReadLine, PF_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 1FileReadLine, PF_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 2FileReadLine, BG_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 3FileReadLine, BG_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 4FileReadLine, DMD_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 8FileReadLine, DMD_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 9FileReadLine, DMD_X, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 10FileReadLine, DMD_Y, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 11XDMD_X:=BG_width+DMD_X ;Reference to Top Left of Playfield screenTable = %1% ;Variable from VPStringTrimRight, XTable, Table, 4 ;Trim ".vpt" for output file name Run, "c:\Program Files (x86)\Visual Pinball\vpinball-9_9-accelmod-8-20-2014.exe" -play "c:\Program Files (x86)\Visual Pinball\Tables\%Table%",,UseErrorLevelProcess, wait, vpinball-9_9-accelmod-8-20-2014.exe Sleep, 30000 ; Allow time for table score display to get well beyond loading and boot images ; Fastest CaptureRun, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size %PF_width%x%PF_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\playfield.mkv",,Hide UseErrorLevelRun, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x %PF_width% -offset_y 0 -video_size %BG_width%x%BG_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\bg.mkv",,Hide UseErrorLevelIf DMD_width > 0 Run, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x %XDMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\dmd.mkv",,Hide UseErrorLevel WinActivate, Visual Pinball PlayerWinWaitActive, Visual Pinball Player Process, WaitClose, ffmpeg.exe, 70Sleep 5000Run, taskkill /IM vpinball-9_9-accelmod-8-20-2014.exe /F,,UseErrorLevel ; Post Capture Trim and TranscodeRun, ffmpeg -y -i "%A_ScriptDir%\playfield.mkv" -ss 5 -to 65 -vf "rotate=PI:bilinear=0" -c:v libx264 -crf 26 "C:\PinballX\Media\Visual Pinball\Table Videos\%XTable%.f4v",,UseErrorLevelRun, ffmpeg -y -i "%A_ScriptDir%\bg.mkv" -ss 5 -to 65 -c:v libx264 -crf 26 "C:\PinballX\Media\Visual Pinball\Backglass Videos\%XTable%.f4v",,UseErrorLevelIf DMD_width > 0 Run, ffmpeg -y -i "%A_ScriptDir%\dmd.mkv" -ss 5 -to 65 -c:v libx264 -crf 26 "C:\PinballX\Media\Visual Pinball\DMD Videos\%XTable%.f4v",,UseErrorLevel Process, WaitClose, ffmpeg.exe ; Clean upFileDelete, %A_ScriptDir%\playfield.mkvFileDelete, %A_ScriptDir%\bg.mkvIf DMD_width > 0 FileDelete, %A_ScriptDir%\dmd.mkv ExitApp Assuming you compile the script as CapScreensCab.exe. The command would be:CapScreenCab.exe "tablefilename"with tablefilename including the vpt extensionThis can be fairly easily modified to capture Future Pinball/FutureDMD media as well, I believe. In the end, for ease of use the functionality is probably much better integrated fully into PinballX. So, that's a feature that I'd like to see as the script demonstrates that it is very doable.EDIT - Not Future Pinball, I'm working on another script for that. 8 Quote Link to comment Share on other sites More sharing options...
rockyrocket Posted October 5, 2014 Share Posted October 5, 2014 Very interesting!, thanks for documenting this Carny . Quote Link to comment Share on other sites More sharing options...
chernandez Posted October 11, 2014 Share Posted October 11, 2014 Nice I will have to give this a try Quote Link to comment Share on other sites More sharing options...
rockyrocket Posted October 12, 2014 Share Posted October 12, 2014 Just want to say thanks again for showcasing ffmpeg carny as it is a very powerful tool.Used a couple of variations of the script today to record just the playfield with audio and rotate to the correct orientation.For a standard landscape set up I found the script below worked great.s::; Fastest CaptureRun, ffmpeg -t 70 -rtbufsize 1500M -f dshow -i video="screen-capture-recorder":audio="virtual-audio-capturer" -vcodec libx264 -preset ultrafast -threads 8 playfield.mkv,,Hide UseErrorLevel Process, WaitClose, ffmpeg.exe, 70Sleep 1000; Post Capture Trim and TranscodeRun, ffmpeg -y -i "%A_ScriptDir%\playfield.mkv" -ss 5 -to 65 -vf "rotate=PI:bilinear=0" -c:v libx264 -crf 26 "%A_ScriptDir%\PFCapture.mp4,,UseErrorLevel Process, WaitClose, ffmpeg.exe ; Clean upFileDelete, %A_ScriptDir%\playfield.mkv ExitAppAnd for recording when the screen is in portrait mode (android ect) you only need to rotate 90° ..s::; Fastest CaptureRun, ffmpeg -t 70 -rtbufsize 1500M -f dshow -i video="screen-capture-recorder":audio="virtual-audio-capturer" -vcodec libx264 -preset ultrafast -threads 8 playfield.mkv,,Hide UseErrorLevel Process, WaitClose, ffmpeg.exe, 70Sleep 1000; Post Capture Trim and TranscodeRun, ffmpeg -y -i "%A_ScriptDir%\playfield.mkv" -ss 5 -to 65 -vf "transpose=1" -c:v libx264 -crf 26 "%A_ScriptDir%\PFCapture.mp4,,UseErrorLevel Process, WaitClose, ffmpeg.exe ; Clean upFileDelete, %A_ScriptDir%\playfield.mkv ExitAppOf course you still need to manually rename with this method but it is pretty universal. Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted October 12, 2014 Author Share Posted October 12, 2014 Good stuff. I don't know the native format for audio using "virtual-audio-capturer". If the output file size is large, there may be an an opportunity to use ffmpeg's built in audio codecs to compress the audio track with good quality in the transcode step. One of these days, I'll work on a variation for Future Pinball/FutureDMD. Quote Link to comment Share on other sites More sharing options...
chernandez Posted October 14, 2014 Share Posted October 14, 2014 CarnyI've been trying to get this script to work for me but i keep getting an error when vp loads upwhen vp loads up it gives me a load error box and say cant load C:\program files (86)\visual pinball\ tables\and the table name that i put inI only changed the script with Vpinball.exe over the one you had in there.Any ideas of what i should trythanks Chris Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted October 14, 2014 Author Share Posted October 14, 2014 The VP path name in your table has a space in front of "tables". I assume that is a typo?The entire path for the executable is within quotes?The entire path for the table is within quotes? You are using the play parameter correctly? Should have "-play". It should not be missing or just "play".When you execute the script from the command line are you adding the full table name to the command? CapScreenCab.exe [tablefilename]Tablefilename should be a table that exists in your tables folder and you need to use the full file name including ".vpt"Still not working? Run VP as administrator. Quote Link to comment Share on other sites More sharing options...
chernandez Posted October 15, 2014 Share Posted October 15, 2014 ok heres the script i used#NoEnv#SingleInstance force#WinActivateForceSetTitleMatchMode 2DetectHiddenWindows OnFileReadLine, PF_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 1FileReadLine, PF_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 2FileReadLine, BG_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 3FileReadLine, BG_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 4FileReadLine, DMD_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 8FileReadLine, DMD_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 9FileReadLine, DMD_X, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 10FileReadLine, DMD_Y, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 11XDMD_X:=BG_width+DMD_X ;Reference to Top Left of Playfield screenTable = %1% ;Variable from VPStringTrimRight, XTable, Table, 4 ;Trim ".vpt" for output file nameRun, "c:\Program Files (x86)\Visual Pinball\VPinball.exe" -play "c:\Program Files (x86)\Visual Pinball\Tables\%Table%",,UseErrorLevelProcess, wait, VPinball.exeSleep, 30000 ; Allow time for table score display to get well beyond loading and boot images; Fastest CaptureRun, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size %PF_width%x%PF_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\playfield.mkv",,Hide UseErrorLevelRun, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x %PF_width% -offset_y 0 -video_size %BG_width%x%BG_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\bg.mkv",,Hide UseErrorLevelIf DMD_width > 0Run, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x %XDMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\dmd.mkv",,Hide UseErrorLevelWinActivate, Visual Pinball PlayerWinWaitActive, Visual Pinball PlayerProcess, WaitClose, ffmpeg.exe, 70Sleep 5000Run, taskkill /IM VPinball.exe /F,,UseErrorLevel; Post Capture Trim and TranscodeRun, ffmpeg -y -i "%A_ScriptDir%\playfield.mkv" -ss 5 -to 65 -vf "rotate=PI:bilinear=0" -c:v libx264 -crf 26 "C:\PinballX\Media\Visual Pinball\Table Videos\%XTable%.f4v",,UseErrorLevelRun, ffmpeg -y -i "%A_ScriptDir%\bg.mkv" -ss 5 -to 65 -c:v libx264 -crf 26 "C:\PinballX\Media\Visual Pinball\Backglass Videos\%XTable%.f4v",,UseErrorLevelIf DMD_width > 0Run, ffmpeg -y -i "%A_ScriptDir%\dmd.mkv" -ss 5 -to 65 -c:v libx264 -crf 26 "C:\PinballX\Media\Visual Pinball\DMD Videos\%XTable%.f4v",,UseErrorLevelProcess, WaitClose, ffmpeg.exe; Clean upFileDelete, %A_ScriptDir%\playfield.mkvFileDelete, %A_ScriptDir%\bg.mkvIf DMD_width > 0FileDelete, %A_ScriptDir%\dmd.mkvExitAppand heres what i get when i run command Quote Link to comment Share on other sites More sharing options...
chernandez Posted October 15, 2014 Share Posted October 15, 2014 that screen size was too smallheres another one to show screen Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted October 15, 2014 Author Share Posted October 15, 2014 The name of your file is [avatar (stern)].vpt? With the brackets? The load error is because VP is not finding that file in your Tables folder, I think. The editor is open but it could not find the table to load.Is it simply avatar (stern).vpt?Sorry, I think I confused you by putting in brackets in my example, but what I mean is that you just reference the file name as it appears in your Tables folder.Try entering the following:capscreencab.exe "avatar (stern).vpt"The quotes will be needed because the file name has spaces in it.EDIT - changed the original post to reflect that the table name should be in quotes. Quote Link to comment Share on other sites More sharing options...
chernandez Posted October 15, 2014 Share Posted October 15, 2014 That worked with quotesThank you Quote Link to comment Share on other sites More sharing options...
chernandez Posted October 15, 2014 Share Posted October 15, 2014 ok table plays but no recording where do i place the ffmpeg folder and thanks again Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted October 15, 2014 Author Share Posted October 15, 2014 http://www.wikihow.com/Install-FFmpeg-on-Windows Quote Link to comment Share on other sites More sharing options...
chernandez Posted October 15, 2014 Share Posted October 15, 2014 Thanks will doI guess I should have Google that Quote Link to comment Share on other sites More sharing options...
rockyrocket Posted October 15, 2014 Share Posted October 15, 2014 Just played with this a bit more on some other systems with mixed results.First the good it (Ffmpeg) worked great with ... - Visual Pinball (obviously) - Unity3D Pinball - Bluestacks.But failed to capture... - Future Pinball - Pinball FX2 - Pinball ArcadeIn most cases the windows desktop was recorded and not the game itself.This may not be conclusive as I do not claim to be any kind of expert on this at all - maybe you can define what layer is recorded?.All tests were done outside of PinballX from the cmdline.Really the only one I would like to see work is FP - wonder if FRAPS works from CMD? Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted October 15, 2014 Author Share Posted October 15, 2014 Ah, I had not tested with FP. I have had mixed results with applications that display in full screen rather than windowed, full screen. I had to work around this issue to mirror the DMD for SlamIt: Big Score. There was a way to force it to windowed full screen through a combination of game settings and scripting.I'm not sure that there is a way to do something similar for FP.Another test would include VP 9.21 running in full screen. Quote Link to comment Share on other sites More sharing options...
chernandez Posted October 18, 2014 Share Posted October 18, 2014 Carny i have pf recording right but on my bg it records my dmd and half of bg and on my dmd it records part of bgmy screenres.txt files is192010801920108030010124321927730i used bigboss's setdmd not sure if that would effect itdo you have any ideas thankschris Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted October 18, 2014 Author Share Posted October 18, 2014 What settings do you use for SetDMD?Do you have your screen set up in the usual recommended way? That's DMD (screen 3) located to the right of the BG (screen 2) which in turn is located to the right of the playfield (Screen 1). The tops of each screen are aligned on y=0. Quote Link to comment Share on other sites More sharing options...
chernandez Posted October 18, 2014 Share Posted October 18, 2014 What settings do you use for SetDMD?Do you have your screen set up in the usual recommended way?That's DMD (screen 3) located to the right of the BG (screen 2) which in turn is located to the right of the playfield (Screen 1). The tops of each screen are aligned on y=0.Damn your good i had dmd next to pf switch around now it record them right now my only issue is some lag in video so i going to try to record them separatethankschris Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted October 18, 2014 Author Share Posted October 18, 2014 Lag? Having three captures at once probably does take a lot of resources. The PC in my cab is a dedicated machine. I don't have anything else running in the background. I exit out of PinballX and run this from the command line. Another alternative is to try lowering the frame rate to 25 or even 20. If not for all three captures then perhaps for the BG especially if it is not a particularly active one.Can also experiment with lowering the value for rtbufsize (real time buffer size), but I don't know that it will help performance. 1 Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted October 21, 2014 Author Share Posted October 21, 2014 Just played with this a bit more on some other systems with mixed results.First the good it (Ffmpeg) worked great with ... - Visual Pinball (obviously) - Unity3D Pinball - Bluestacks.But failed to capture... - Future Pinball - Pinball FX2 - Pinball ArcadeIn most cases the windows desktop was recorded and not the game itself.This may not be conclusive as I do not claim to be any kind of expert on this at all - maybe you can define what layer is recorded?.All tests were done outside of PinballX from the cmdline.Really the only one I would like to see work is FP - wonder if FRAPS works from CMD?Tested with Fullscreen VP v9.21, and didn't have any issues capturing screens with the original script.I do have a potential solution for FP. At least, I've got something that passed some command line tests with Pinball FX2. Unfortunately, I can't test with Future Pinball. I've disassembled my cab to work on hardware, and I don't have Future Pinball installed on my test bed.Without the cab, I don't recall the exact settings for Future Pinball + BAM + FutureDMD, the process names, Window titles, etc. So some corrections may be needed with the following script.Otherwise, the only difference is that I am disabling Aero prior to the capture if it is Enabled by default. The script only turns Aero back on if Aero was on at the start. In my cab, I disabled Aero along with all other visual enhancements for whatever gain in performance I could get for running pinball. I don't want to inadvertently turn Aero back on. Give it a try; hopefully this will work. Turning off Aero is a trick for Vista and Windows 7. I don't know what to do for Windows 8. I don't have it.#NoEnv #SingleInstance force#WinActivateForceSetTitleMatchMode 2DetectHiddenWindows OnFileReadLine, PF_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 1FileReadLine, PF_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 2FileReadLine, BG_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 3FileReadLine, BG_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 4FileReadLine, DMD_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 8FileReadLine, DMD_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 9FileReadLine, DMD_X, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 10FileReadLine, DMD_Y, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 11XDMD_X:=BG_width+DMD_X ;Reference to Top Left of Playfield screenTable = %1% ;Variable from FPStringTrimRight, XTable, Table, 4 ;Trim ".fpt" for output file name ;Disable Aero if EnabledRegRead, DWMComp, HKCU, Software\Microsoft\Windows\DWM, CompositionAero = %DWMComp%If Aero = 1Run, sc stop uxsms,,UseErrorLevel Run, "c:\Games\Future Pinball\BAM\fploader.exe" /open "-play "c:\Games\Future Pinball\Tables\%Table%" /play /exit /arcaderender /STAYINRAM,,UseErrorLevelProcess, wait, Future Pinball.exe Sleep, 30000 ; Allow time for table score display to get well beyond loading and boot images ; Fastest CaptureRun, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size %PF_width%x%PF_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\playfield.mkv",,Hide UseErrorLevelRun, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x %PF_width% -offset_y 0 -video_size %BG_width%x%BG_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\bg.mkv",,Hide UseErrorLevelIf DMD_width > 0 Run, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x %XDMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\dmd.mkv",,Hide UseErrorLevel WinActivate, Future PinballWinWaitActive, Future Pinball Process, WaitClose, ffmpeg.exe, 70Sleep 5000Run, taskkill /IM Future Pinball.exe /F,,UseErrorLevel ; Post Capture Trim and TranscodeRun, ffmpeg -y -i "%A_ScriptDir%\playfield.mkv" -ss 5 -to 65 -vf "rotate=PI:bilinear=0" -c:v libx264 -crf 26 "C:\PinballX\Media\Future Pinball\Table Videos\%XTable%.f4v",,UseErrorLevelRun, ffmpeg -y -i "%A_ScriptDir%\bg.mkv" -ss 5 -to 65 -c:v libx264 -crf 26 "C:\PinballX\Media\Future Pinball\Backglass Videos\%XTable%.f4v",,UseErrorLevelIf DMD_width > 0 Run, ffmpeg -y -i "%A_ScriptDir%\dmd.mkv" -ss 5 -to 65 -c:v libx264 -crf 26 "C:\PinballX\Media\Future Pinball\DMD Videos\%XTable%.f4v",,UseErrorLevel Process, WaitClose, ffmpeg.exe ; Clean upFileDelete, %A_ScriptDir%\playfield.mkvFileDelete, %A_ScriptDir%\bg.mkvIf DMD_width > 0 FileDelete, %A_ScriptDir%\dmd.mkv ;Enable Aero if Enabled at the start of script executionIf Aero = 1Run, sc start uxsms,,UseErrorLevel ExitApp Quote Link to comment Share on other sites More sharing options...
rockyrocket Posted October 22, 2014 Share Posted October 22, 2014 Thanks carny for trying for me, still black screen though with aero disabled.Dtoxy or fraps work well with future pinball so we do at least have options - dtoxy is especially powerful.The list of things that do work with Ffmpeg can now include Bigscore and TPA if you set it to full screen windowed (although I have now uninstalled it ). Quote Link to comment Share on other sites More sharing options...
Carny_Priest Posted October 22, 2014 Author Share Posted October 22, 2014 That's too bad for FP. I was looking for free options for simultaneous capture of all three displays. Even better if those solutions did not require extra run time environments, installers, etc. And that can also be easily called in a script to automate the task.Other alternatives could be UScreenCapture. I think there may be a mod that overcomes the black screen. There is possibly Open Broadcaster Software but I haven't researched it.If you have a recent NVidia card there is also ShadowPlay. I have used it to capture Pinball FX2 but I have not tried with FP. There would be no simultaneous capture of 3 screens. But if you could capture the entire desktop then you could use ffmpeg to parse out a Playfield, BG, and DMD video in separate transcodes. Quote Link to comment Share on other sites More sharing options...
noiseprisoner Posted October 29, 2014 Share Posted October 29, 2014 This is such a great idea, especially for mods or original tables. I'm excited to try it out. Quote Link to comment Share on other sites More sharing options...
shifters67 Posted November 29, 2014 Share Posted November 29, 2014 Hi Carny_Priest,I would like to put a little build on this if i may to your awesome work - the video quality is great, small, and exactly matches your tables of course!!!I use only directB2S and B2S tables so in order to get the videos, do away with the images for table/bg/dmd i decided to render the entire contents of my VP tables directory using the following piece of simple python (2.7).It reads the VP tables directory, and then runs capscreencab.exe on each file ending in .vpt.__author__ = 'shifters'import osimport shutilsrc = 'c:\program files (x86)\Visual Pinball\Tables'if __name__ == '__main__': # get a list of the directory names names = os.listdir(src) print "Found: ", names # check all the folders for sub folders and move up to current level and rename in progress for name in names: print "Checking: ", name print "ext ", name[-4:] if name[-4:] == ".vpt": print "Rendering: ", name os.system('CapScreenCab.exe \"' + name + '\"')I also used a slightly modified version of your script - tailored to my layout, processing speed etc#NoEnv#SingleInstance force#WinActivateForceSetTitleMatchMode 2DetectHiddenWindows OnFileReadLine, PF_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 1FileReadLine, PF_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 2FileReadLine, BG_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 3FileReadLine, BG_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 4FileReadLine, DMD_width, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 8FileReadLine, DMD_height, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 9FileReadLine, DMD_X, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 10FileReadLine, DMD_Y, c:\Program Files (x86)\Visual Pinball\Tables\ScreenRes.txt, 11; my change to capture dmd in correct placeXDMD_X:=3200 ;Reference to Top Left of Playfield screenTable = %1% ;Variable from VPStringTrimRight, XTable, Table, 4 ;Trim ".vpt" for output file nameRun, "c:\Program Files (x86)\Visual Pinball\VPinball990.exe" -play "c:\Program Files (x86)\Visual Pinball\Tables\%Table%",,UseErrorLevelProcess, wait, VPinball990.exeSleep, 20000 ; Allow time for table score display to get well beyond loading and boot images; Fastest CaptureRun, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size %PF_width%x%PF_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\playfield.mkv",,Hide UseErrorLevelRun, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x %PF_width% -offset_y 0 -video_size %BG_width%x%BG_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\bg.mkv",,Hide UseErrorLevelIf DMD_width > 0Run, ffmpeg -t 70 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x %XDMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_Height% -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -threads 8 "%A_ScriptDir%\dmd.mkv",,Hide UseErrorLevelWinActivate, Visual Pinball PlayerWinWaitActive, Visual Pinball PlayerProcess, WaitClose, ffmpeg.exe, 70Sleep 5000Run, taskkill /IM VPinball990.exe /F,,UseErrorLevel; Post Capture Trim and TranscodeRun, ffmpeg -y -i "%A_ScriptDir%\playfield.mkv" -ss 5 -to 65 -vf "rotate=PI:bilinear=0" -c:v libx264 -crf 26 "C:\PinballX\Media\Visual Pinball\Table Videos\%XTable%.f4v",,UseErrorLevelRun, ffmpeg -y -i "%A_ScriptDir%\bg.mkv" -ss 5 -to 65 -c:v libx264 -crf 26 "C:\PinballX\Media\Visual Pinball\Backglass Videos\%XTable%.f4v",,UseErrorLevelIf DMD_width > 0Run, ffmpeg -y -i "%A_ScriptDir%\dmd.mkv" -ss 5 -to 65 -c:v libx264 -crf 26 "C:\PinballX\Media\Visual Pinball\DMD Videos\%XTable%.f4v",,UseErrorLevel;Process, WaitClose, ffmpeg.exeSleep 70000; Clean upFileDelete, %A_ScriptDir%\playfield.mkvFileDelete, %A_ScriptDir%\bg.mkvIf DMD_width > 0FileDelete, %A_ScriptDir%\dmd.mkvExitAppAnd hey presto - all BG/DMD/table vides created. I am so impressed with the quality for the size they are!I finally went into the DMD videos folder and delete all files 74KB in size which are tables with no DMD to display for the video to capture. This allows your default DMD graphic to display which for me is a custom one, so for those tables with no DMD video (as they have no dmd) i get my custom graphic - nice!!regardsShifters 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.