Jump to content




Photo
* * * * * 2 votes

PBX Recorder (Automated PinballX media video recorder)

pbxrecorder screenshot videos ffmpeg recorder Pinballx

  • Please log in to reply
325 replies to this topic

#1 gtxjoe

gtxjoe

    Pinball Wizard

  • VIP
  • 4,978 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 17 April 2016 - 03:56 AM

File Name: PBX Recorder (Automated PinballX media video recorder)

File Submitter: gtxjoe

File Submitted: 16 Apr 2016

File Category: Frontends and Addons


PBX Recorder will walk through all the VP tables found set up in Pinballx, launch each table and record/capture all videos and/or images automatically.  This is intended for VP cab setups but will add Desktop support at some point (Note: Desktop users - there is now a beta version for single monitor desktop users below).  By default, PBX Recorder is setup to find and record missing media.  There are options to re-record all media if desired.  What to record and length of videos are all configurable.  
 
NOTE: PBX Recorder uses the DirectB2S screenres.txt to figure out how to record the Playfield, Backglass and DMD.  (If the DMD portion of screenres.txt is not filled in correctly, you will have trouble with DMD video or screenshot capture.  Try the included ScreenResCheck utility, to see exactly what PBX Recorder will record) 

NOTE: PBX Recorder videos requires that you to install the LAV filters recommended for PinballX here: http://www.pinballx.com/codecs.exe 
To view the videos outside of PinballX, try a media player like this: https://mpc-hc.org/

 

Special Thanks to:
- Carny_Priest for his original ffmpeg recording scripts and input on the PinballX forums (http://www.gameex.in...ckglass-and-dmd)
- All the beta testers 


Click here to download this file



#2 javier1515

javier1515

    Pinball Fan

  • VIP
  • 573 posts
  • Location:Villa Maria Cordoba

  • Flag: Argentina

  • Favorite Pinball: The Addams Family, Hook



Posted 17 April 2016 - 06:07 PM

Beautiful tool Joe!!  :otvclap:  :love39:  :yahoo:

 

Thanks man.. 


"Learning without thought is vain, thought without learning is dangerous." (Confucius)
 
"Aprender sin pensar es inútil, pensar sin aprender es peligroso". (Confucio)

 

 

Please, if you can help me with a small contribution to update my work team and continue to make more tables I will be eternally grateful.
 

#3 hauntfreaks

hauntfreaks

    Real 4K Tables Since 2013

  • VIP
  • 2,496 posts
  • Location:South Jersey

  • Flag: United States of America

  • Favorite Pinball: -<3<3<3 All Real Pins



Posted 18 April 2016 - 05:01 PM

if my table file/folder structure looks this.... will it work??

 

26494823245_9efa9d8a31_o.png


 26794541816_30ca1cca80_o.gif 43109635392_fc11af1a57_o.gif


#4 gtxjoe

gtxjoe

    Pinball Wizard

  • VIP
  • 4,978 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 18 April 2016 - 05:21 PM

Not at the moment, but could be added easily if

- The folder matches the table name exactly

or

- The folder matches the description name exactly

 

If it the folder name is close but does not really match either name or description, then it is a little more work but could still be added.

 

Let me know if you are actually interested in testing this, and I can upload something later.  Also what does the folder structure look like one level up - Do you keep VP9 and VPX in separate folders are all in the Tables folder?



#5 hauntfreaks

hauntfreaks

    Real 4K Tables Since 2013

  • VIP
  • 2,496 posts
  • Location:South Jersey

  • Flag: United States of America

  • Favorite Pinball: -<3<3<3 All Real Pins



Posted 18 April 2016 - 06:19 PM

yes I have all my systems and tables in separate folders.... my OCD would never lets me have all those files commingling all  willy nilly....lol 

 

post-73849-0-53638100-1461003502.pngpost-73849-0-73213500-1461003200.png

Attached Files


 26794541816_30ca1cca80_o.gif 43109635392_fc11af1a57_o.gif


#6 ernie76

ernie76

    Neophyte

  • Members
  • Pip
  • 2 posts
  • Location:Delligsen

  • Flag: Germany

  • Favorite Pinball: Addams Family

Posted 20 April 2016 - 08:03 AM

hi,

beautiful tool.

 

but there is a problem with mp4 export. it's not working

here are the log.

April 20,2016 09:52:24
Version 1.4

Monitor Count: 2,  Primary Monitor: 1
Monitor 1: 1280x720 (\\.\DISPLAY1)
Monitor 2: 2560x1024 (\\.\DISPLAY2)

Pinballx.ini
4
C:\Games\PinballX
0
1
0
0
0
0
0
1
5
0

Identify all VP XML files...
VP System #1:
C:\Games\PinballX\Databases\Visual Pinball\Visual Pinball.xml
C:\Games\Visual Pinball
C:\Games\Visual Pinball\Tables
VPinball992.exe

Skipping this system: Pinball FX2.xml

Skipping this system: MAME.xml

VP System #2:
C:\Games\PinballX\Databases\VPX\VPX.xml
C:\Games\Visual Pinball
C:\Games\Visual Pinball\TabelsX
VPinballX.exe

Skipping this system: .xml

Total number of VP systems found: 2

Working on Visual Pinball.xml (09:52:54)

Screenres.txt
1280
720
1280
1024
2
0
0
0
0
0
0
0

Values used for media capture (height/width forced to even values)
VirtualScreenWidth = 2560
TotalScreenWidth   = 1280  
PF_width           = 1280          
PF_height          = 720         
BG_width           = 1280          
BG_height          = 1024         
DMD_width          = 0      
DMD_height         = 0        
DMD_X_offset       = 0            
DMD_Y_offset       = 0             
-----------------------------------------
DMD_tot_offset     = 1280             
DMD_orig_width     = 0         

Congo (Williams 1995)

EXAMPLE of all ffmpeg.exe commands used
"C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\FFMpeg\bin\ffmpeg" -y -t 1 -f gdigrab -framerate 1 -offset_x 0 -offset_y 0 -video_size 1280x720 -i desktop -vf "rotate=PI:bilinear=0" "C:\Games\PinballX\Media\Visual Pinball\Table Images\Congo (Williams 1995).png"
"C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\FFMpeg\bin\ffmpeg" -y -t 1 -f gdigrab -framerate 1 -offset_x 1280 -offset_y 0 -video_size 1280x1024 -i desktop "C:\Games\PinballX\Media\Visual Pinball\Backglass Images\Congo (Williams 1995).png"
"C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\FFMpeg\bin\ffmpeg" -y -t 1 -f gdigrab -framerate 1 -offset_x 1280 -offset_y 0 -video_size 0x0 -i desktop "C:\Games\PinballX\Media\Visual Pinball\DMD Images\Congo (Williams 1995).png"
"C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\FFMpeg\bin\ffmpeg" -y -t 10 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size 1280x720 -i desktop -vcodec libx264 -preset ultrafast -qp 0 -threads 8 "C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\playfield.mkv"
"C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\FFMpeg\bin\ffmpeg" -y -t 10 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 1280 -offset_y 0 -video_size 1280x1024 -i desktop -vcodec libx264 -preset ultrafast  -qp 0 -threads 8 "C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\bg.mkv"
"C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\FFMpeg\bin\ffmpeg" -y -t 10 -rtbufsize 1500M -f gdigrab -framerate 30 -offset_x 1280 -offset_y 0 -video_size 0x0 -i desktop -vcodec libx264 -preset ultrafast  -qp 0 -threads 8 "C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\dmd.mkv"
"C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\FFMpeg\bin\ffmpeg" -y -i "C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\playfield.mkv" -ss 5 -to 1000 -vf "rotate=PI:bilinear=0" -c:v libx264 -crf 26 "C:\Games\PinballX\Media\Visual Pinball\Table Videos\Congo (Williams 1995).f4v"
"C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\FFMpeg\bin\ffmpeg" -y -i "C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\bg.mkv" -ss 5 -to 1000 -c:v libx264 -crf 26 "C:\Games\PinballX\Media\Visual Pinball\Backglass Videos\Congo (Williams 1995).f4v"
"C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\FFMpeg\bin\ffmpeg" -y -i "C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\dmd.mkv" -ss 5 -to 1000 -c:v libx264 -crf 26 "C:\Games\PinballX\Media\Visual Pinball\DMD Videos\Congo (Williams 1995).f4v"

PBXrecorder set to record complete media set
Launching table: VPinball992.exe -play C:\Games\Visual Pinball\Tables\Congo.vpt
Video and screenshot capture (09:53:12)
Recording "C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\playfield.mkv"
Convert Videos to f4v if video was captured (09:53:34)
Converting to "C:\Games\PinballX\Media\Visual Pinball\Table Videos\Congo (Williams 1995).f4v"
Table done (09:53:52)

Tales of the Arabian Nights (Williams 1996)
PBXrecorder set to record complete media set
Launching table: VPinball992.exe -play C:\Games\Visual Pinball\Tables\TOTAN_VP91x_3.4FS_Enhanced.vpt
Video and screenshot capture (09:54:08)
Recording "C:\Games\tools\PBXRecorder_x64_1.4\PBXRecorder_x64\playfield.mkv"
Convert Videos to f4v if video was captured (09:54:28)
Converting to "C:\Games\PinballX\Media\Visual Pinball\Table Videos\Tales of the Arabian Nights (Williams 1996).f4v"
Table done (09:54:48)

Working on VPX.xml (09:54:48)

Screenres.txt
1280
720
1280
1024
2
0
0
0
0
0
0
0

Values used for media capture (height/width forced to even values)
VirtualScreenWidth = 2560
TotalScreenWidth   = 1280  
PF_width           = 1280          
PF_height          = 720         
BG_width           = 1280          
BG_height          = 1024         
DMD_width          = 0      
DMD_height         = 0        
DMD_X_offset       = 0            
DMD_Y_offset       = 0             
-----------------------------------------
DMD_tot_offset     = 1280             
DMD_orig_width     = 0         

2 new recordings out of 2 tables. Finished (09:54:50)



#7 ernie76

ernie76

    Neophyte

  • Members
  • Pip
  • 2 posts
  • Location:Delligsen

  • Flag: Germany

  • Favorite Pinball: Addams Family

Posted 20 April 2016 - 08:14 AM

i have found the problem

in line 259 is this

If RecordingFormat = 1

but the variabel is RecFormat

the line must be

If RecFormat = 1

mfg

 ernie



#8 sasa12345

sasa12345

    Enthusiast

  • Members
  • PipPipPip
  • 250 posts

  • Flag: ---------

  • Favorite Pinball: indiana jones

Posted 20 April 2016 - 02:10 PM

not that we recorded visual pinball x, which are items for him because is set as a second system



#9 sasa12345

sasa12345

    Enthusiast

  • Members
  • PipPipPip
  • 250 posts

  • Flag: ---------

  • Favorite Pinball: indiana jones

Posted 26 April 2016 - 10:05 PM

Not recorded VP 10,
what should I change?
greeting


#10 gtxjoe

gtxjoe

    Pinball Wizard

  • VIP
  • 4,978 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 26 April 2016 - 10:13 PM

I am guessing, but in Pinballx Settings, set VP10 "System" type to Visual Pinball.

 

You can also open and review the Pbxrecorder.log for errors or post the log here



#11 sasa12345

sasa12345

    Enthusiast

  • Members
  • PipPipPip
  • 250 posts

  • Flag: ---------

  • Favorite Pinball: indiana jones

Posted 28 April 2016 - 09:55 AM

I am guessing, but in Pinballx Settings, set VP10 "System" type to Visual Pinball.

 

You can also open and review the Pbxrecorder.log for errors or post the log here

:console: tnx



#12 BorgDog

BorgDog

    We come in peace.. shoot to kill.. shoot to kill.

  • Members
  • PipPipPipPip
  • 1,427 posts
  • Location:Leavenworth, WA

  • Flag: United States of America

  • Favorite Pinball: Alien Star, TNA



Posted 25 May 2016 - 02:01 AM

So I finally got around to checking this out on my cab, having suspicions it would not work on mine as my main playfield is in portrait orientation.  

 

Monitors are playfield 1920x1080 portrait oriented, backglass 1280x1024 landscape, dmd 800x480 landscape. Here is what my display setup looks like:

displays1.png

 

I used your screenrescheck utility to see how things looked, and in order to get the displays correct, I had to use these values:

 

screenres.png

 

the way I understand things is that the backglass x and y offset and dmd x and y offset should be in relation to the upper left corner of the backglass display, which appears to be the case in those settings for the X offset.  the Y offset values I had to put in there to get it to show correctly are relating to the main playfield monitor, not the backglass.  Is there some sort of bug in that utility?

 

My normal screenres.txt file looks like below, and the math seems to work for these settings:

 

1080
1920
1280
1000
2
0
0
800
250
1280
800
0

 

I left my screenres.txt the way it was, because it works and with the settings from the check utility it does not display right when vp is run.  I did a test with just taking images, and the playfield got captured upside down which I was expecting from reading the thread, but what I didn't expect is how it took the backglass image.  It evidently wants the settings from the check utility as all it got was the top portion of the backglass, even though what was on the backglass was the full image.  I think this goes back to it having Y offsets that reference back to the playfield for some reason.  Here is the backglass image it captured (snipped from photoshop), it got just black on the dmd screen.

 

capture0.png

 

If I had to guess I'm the first to run across this bug as nobody else has a playfield monitor that extends above the height of the backglass monitor, except for those few of us with portrait oriented displays.  Any way to get this to work right for my setup?

 

Thanks, looks like an awesome tool if I can get it working.

 



#13 BorgDog

BorgDog

    We come in peace.. shoot to kill.. shoot to kill.

  • Members
  • PipPipPipPip
  • 1,427 posts
  • Location:Leavenworth, WA

  • Flag: United States of America

  • Favorite Pinball: Alien Star, TNA



Posted 25 May 2016 - 02:25 AM

So as a quick test I moved all my monitors up so the top edges aligned and then the screen check utility worked with the correct/logical values.  playfield and backglass recorded, but dmd did not as I did not change it in the registry (or where ever I'd have to look that up again).  My playfield is likely recorded upside down because my monitor is flipped as well as portrait.



#14 gtxjoe

gtxjoe

    Pinball Wizard

  • VIP
  • 4,978 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 25 May 2016 - 02:46 AM

You still might need the upside down recording because of the way PinballX uses the videos.  If not needed, then copy the ahk script from the ahk script folder to the main folder and modify it

You will want to find and remove all instances of

     -vf "rotate=PI:bilinear=0" 

 

 

For the Backglass, yes it assumes offset of 0, but since your monitors are aligned at the bottom and not at the top, you need to have a non zero offset.  You can change this in the ahk script.  Search for bg.mkv and on that line if you see -offset_y 0 change the 0 to more appropriate value.  I think -offset_y 920 is what you need.

 

For the DMD, same thing y offset needs to be adjusted by same amount, search for 

FileReadLine, DMD_Y, %TablePath%\ScreenRes.txt, 11

 

after this line, add a new line like this

DMD_Y:=DMD_Y+920

 

Give this a try and report back.  You will have to install autohotkey if you do not have it installed


Edited by gtxjoe, 25 May 2016 - 02:50 AM.


#15 BorgDog

BorgDog

    We come in peace.. shoot to kill.. shoot to kill.

  • Members
  • PipPipPipPip
  • 1,427 posts
  • Location:Leavenworth, WA

  • Flag: United States of America

  • Favorite Pinball: Alien Star, TNA



Posted 25 May 2016 - 04:31 AM

thanks for the help, I have it recording all of them now, needed +720 for the dmd_y but other than that it seems to be working... now to figure out how to get pinballx to show the videos.. and figure out if I need to rotate the playfield video or not.   Off to a good start, thanks again gtx



#16 BorgDog

BorgDog

    We come in peace.. shoot to kill.. shoot to kill.

  • Members
  • PipPipPipPip
  • 1,427 posts
  • Location:Leavenworth, WA

  • Flag: United States of America

  • Favorite Pinball: Alien Star, TNA



Posted 26 May 2016 - 12:39 AM

Getting closer.  Backglass and dmd play now in pinballx just fine, the playfiled however is sideways.  the video itself if I watch it is vertical (upside down), but in pinballx it comes up sideways.  It did not seem to make a difference if I selected Desktop mode yes or no, in fact it didn't seem to pull the video from the desktop folder, so i'm not sure it's really in desktop mode.  Any ideas?

 

Looks like this:

capture1.png


Edited by BorgDog, 26 May 2016 - 12:51 AM.


#17 gtxjoe

gtxjoe

    Pinball Wizard

  • VIP
  • 4,978 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 26 May 2016 - 01:16 AM

Looks like you need to only rotate the video 90 degrees instead of 180, so try changing 

 

 

-vf "rotate=PI:bilinear=0" 

 

to

-vf "rotate=PI/2:bilinear=0" 



#18 BorgDog

BorgDog

    We come in peace.. shoot to kill.. shoot to kill.

  • Members
  • PipPipPipPip
  • 1,427 posts
  • Location:Leavenworth, WA

  • Flag: United States of America

  • Favorite Pinball: Alien Star, TNA



Posted 26 May 2016 - 02:46 AM

So that rotated it to 90, but it kept the video portrait and cropped the image sideways... like below.  it does show the right direction in pinballx, just not the whole image.

 

rotate.png



#19 gtxjoe

gtxjoe

    Pinball Wizard

  • VIP
  • 4,978 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 26 May 2016 - 03:11 AM

Haha. Close but no cigar. Will try this out on my cab tomorrow night

#20 BorgDog

BorgDog

    We come in peace.. shoot to kill.. shoot to kill.

  • Members
  • PipPipPipPip
  • 1,427 posts
  • Location:Leavenworth, WA

  • Flag: United States of America

  • Favorite Pinball: Alien Star, TNA



Posted 26 May 2016 - 03:13 AM

Thanks, I appreciate it :)







Also tagged with one or more of these keywords: pbxrecorder, screenshot, videos, ffmpeg, recorder, Pinballx