Jump to content
SpesoftPinballXConvert-It
Sign in to follow this  
Mike_da_Spike

[APP] Create Launch Video's from playfield with overlay

Recommended Posts

HI All,

I created a small program that can create (multiple) video's from your playfield video's and put an over lay on it.
The idea started when PinballX introduced loading Videos and @scutters modified his "Loading Video & Image Changer (de-randomiser) "

With Scutters his plugin and this program (and a lot of creativity of yourself), you can create your loading video's per table.
examples :
 

 
 

The video's that are created are just short playfield videos with multiple PNG's as overlay.
This program will just grab your playfield videos folder and take all the (missing) video's in it
It requires FFMPEG.exe to operate  (not included, because not sure if it was allowed to post)

The program contains an EXE file and an INI file.
You need to setup the INI first. 
Normally you setup the INI files once, but if you want to change/add overlay's you can change it later,   but I will explain later.

Basic setup INI file :

------------------------------------------------------------------------------------------------------------------------------------------
'Global Variable settings
------------------------------------------------------------------------------------------------------------------------------------------

[Global]
LogPathLocal  = "#CWD#LOG"
LogFileName   = "CreateLaunchingVideos.log"
LogSize       =  0
LogLevel      = "LOGLVL_INFO"


[Paths]
PinballX_Path = "c:\Pinball\PinballX"
FFMPEG_Path   = "#CWD#"
Overlay_Path  = "c:\Pinball\PinballX\Media\Overlay"

[Executables]
FFMPEG_EXE   = "ffmpeg.exe"

[PINBALLX]
CabinetMode         = "True"
GenerateXMLSection1 = "VisualPinball"
GenerateXMLSection2 = "System_1"
GenerateXMLSection3 = "PinballFX3"

Setup the next sections one time :

[Global] section :

  • LogPathLocal - path for logfile. Can be only put a subdirectory , file pathname or #CWD# for current Working Directory 
  • LogFileName -  File name of the logfile
  • LogSize -  0 will overwrite everytime the log file
                       other value will be overwrite the logfile is fize is reached (kb)
  •  LogLevel - Type of logging :
                                                      LOGLVL_INFO  - Shows the least ammount of logging. Enough if all is working
                                                      LOGLVL_VERBOSE  - If you encounter errors, this mode will shows the most issues
                                                      LOGLVL_VERY_VERBOSE  - Nightmare logging mode ! Shows too much info, but handy if it is really not working

[Paths] section :

  • PinballX_path Set the correct path to your PinballX root folder
  • FFMPEG_path : Set the correct path where your FFmpeg.exe is located 
  • Overlay_path : Set the correct path where your overlay PNG's are located

[PINBALLX] section :

  • CabinetMode - True will process cabinet files,
                                 False will process desktop files
  •  GenerateXMLSection - Start the GenerateXMLSection from 1 and up. 
                                                add/remove the sections that has the names in the original Pinballx.INI in the CONFIG folder of PinballX for the emulators which you want to process the videos from
                                                In the example, I only want or the 3 entries that are defined in PinballX.ini to be processed for this script. 
                                                Modify this to your own needs, but make sure the numbering is starting from 1 to ...

You can change the login,paths and pinballx section to your own needs.

Now come the tricky part in  the INI

The INI file can be setup in 2 ways :
1) You can create 1 loading video per playfield. If you have more overlays'you can randomize the overlay per video (like the examples above)
     See example 1
2) You can create multiple video's per playfield (up to 5). With this you can create (up to) 5 different loading videos per playfield table. During launch of a table the videos will be randomized
    See example 2

Example 1

[Overlay1]
VideoLengthMs1 = 5000
ImageMask1     = "TAF%%%.png"
BitRate1       = 5

[Overlay2]
VideoLengthMs1 = 4500
ImageMask1     = "LW3%%%.png"
BitRate1       = 5

[Overlay3]
VideoLengthMs1 = 5000
ImageMask1     = "T2%%%.png"
BitRate1       = 5

[Overlay4]
VideoLengthMs1 = 6000
ImageMask1     = "loadingb%.png"
BitRate1       = 5

[Overlay1] section :

  • VideoLengthMs1 : Set the time of your loading videos in milliseconds
                                      this must be a number between 1 and 10000 (loading videos should not be that long)
  • ImageMask1 : In your overlay_path ([Paths] section) you have multiple PNG's that makes the overlay. 
                              The maskname is the name of the PNG and the % is the total digits your files has.
                               If you have for example 960 Png's You start the first PNG with  number 0. But because you need 0-950, you must start with 000.
                               For example : Test000.png. Second must be named Test001.png , third Test002.png etc
                               The mask in this example would be Test%%%.png
  • BitRate1 : Set the bitrate of the output video. Lower makes smaller files, but less quality. 3-4 is default

If you have multiple Overlay sections (with different overlays) , this program will randomly pick 1 overlay section per created video.
In my example I have 4 sections. If it needs to create a loading video, it will pick 1 of the 4 sections and uses that overlay for the video.
 

Example 2:

[Overlay1]
VideoLengthMs1 = 5000
ImageMask1     = "TAF%%%.png"
BitRate1       = 5

VideoLengthMs2 = 4500
ImageMask2     = "LW3%%%.png"
BitRate2       = 5

VideoLengthMs3 = 5000
ImageMask3     = "T2%%%.png"
BitRate3       = 5

VideoLengthMs4 = 6000
ImageMask4     = "loadingb%.png"
BitRate4       = 5

When only using section [Overlay1], but by increasing the numbers, you can create multiple videos (with different extension) for the same video
With @scutters
 plugin, it will randomize (during PBX load) one of these videos on launch,
The following numbers creates the extensions of the videos
....1 = MP4
....2 = F4V
....3 = FLV
....4 = AVI
....5 = MPEG

There are already some overlaymask that you can use (as I have in my examples and INI files):
Thanks to @joyrider3774 who started the thread and very special thanks to @scutters for his plugin and for his awesome overlays !:

TAF overlay:

LW3 overlay:

T2 overlay:

Loading overlay:
Loading.zip

Special thanks to @scutters. Scutters did the research of the FFMPEG commands that is used (I really doesn't understand the commandline ;) )
It was his idea to create multiple videos with different overlays (example 2)
He also tested this program and give his sign off 

I'm not a programmer, but like to make some things that makes life easy

Here is the latest version of the exe file and an example of the INI. Check changelog below for latest changes

 

CreateLaunchVideos V1.1.zip

CreateLaunchVideos.ini

Changelog :
Date             Version     Modified By     Comment

07/09/2019     0.1b             MdS              Started with creating video's for playfield 
11/09/2019     0.2 b            MdS              Added multiple files and randomized sections - Reported by MdS & Scutters
12/09/2019     0.5 b            MdS              Bug fixses - Reported by MdS 
12/09/2019     0.6 b            MdS              Added popup if something is wrong (with timeout) and fixed logpath with #CWD# - Reported by MdS
12/09/2019     0.7 b            MdS              Changed FFmpeg line - Reported by Scutters
12/09/2019     0.8 b            MdS              Fixed the -system- to be skipped - Reported by MdS
12/09/2019     0.9 b            MdS              Moved MPeg to 5 - Reported by Scutters
13/09/2019    0.91b            MdS              Only processing "mp4", "avi", "f4v", "mpeg" and "flv" video's - Reported by joyrider3774
13/09/2019    0.92 b           MdS             Fixed  -system-  skipped - Reported by joyrider3774
01/10/2019    1.0                MdS             Removed some typos in log and get out of Beta
20/10/2019    1.1                MdS             Added support for NVIDIA rendering

 

NOTE: If you run the exefile from the command line it will process all missing tables.
If you want to re-create all tables (you can delete them from your "loading videos" directory) or use the -f option to force to create all videos again

 

Edited by Mike_da_Spike
changed to version 1.1
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Is source code available (maybe on github ?) / what did your program it in ?

My bitdefender is being noisy about the executable. I'm guessing it's a false positive but i have been unable to download the executeable for now. My bitdefender keeps blocking each download

Am trying to unblock it and running a check afterwards with virustotal or something. My bitdefender has been messing with pinballx installation as well so i'm really guessing it's a false positive but want to be sure

Managed to temporary disable antivirus and upload to virustotal, there are a few others detecting the same thing but i'm mainly guessing it could be false positives,

https://www.virustotal.com/gui/file/99d2b4a577c8a3c377a7b68759e5a43d9be6e8781bbd9b577fc28c169385ea96/detection

not accusing or anything, as usually these are false positives but you never know if the the pc you compiled the exe might have been infected or you used some cracked development program but i doubt all that.

edit: it are false positives probably because of vbs to exe compilation

 

Share this post


Link to post
Share on other sites
9 minutes ago, joyrider3774 said:

Is source code available (maybe on github ?) / what did your program it in ?

My bitdefender is being noisy about the executable. I'm guessing it's a false positive but i have been unable to download the executeable for now. My bitdefender keeps blocking each download

image.png.d25797ecdf6f0886529748ab59a5a4b8.png

Am trying to unblock it and running a check afterwards with virustotal or something. My bitdefender has been messing with pinballx installation as well so i'm really guessing it's a false positive but want to be sure

Managed to temporary disable antivirus and upload to virustotal, there are a few others detecting the same thing but i'm mainly guessing it could be false positives

https://www.virustotal.com/gui/file/99d2b4a577c8a3c377a7b68759e5a43d9be6e8781bbd9b577fc28c169385ea96/detection

Lol. I feel honored by all the detections :p 

this i written in vbs and compiled to exe.

Code is not on github. It is code that my colleague and me started in 2001. We build classes for logging. Registry, active directory. We made our own framework to make programming easier for ourself.

With this code we could adminitrate our complete environment.  

We still using it in a very large environment, and never got complains about virus detection.

I realy wsnt to learn visual studio, but don't have time for it(i have a lot of ideas)

 

Share this post


Link to post
Share on other sites

ah it's probably because of the vbs script compiled to exe's that the antivirus programs are flipping on it. Probably are false positives will give it a go now :)

Share this post


Link to post
Share on other sites

@Mike_da_Spike it's running fine now on my system creating video's as a test. I'm amazed at what you achieved using vbs scripts etc :) i probably would have spend way too much time on it if i did it in delphi

Btw you might need to exclude thumbs.db and desktop.ini file. Somehow it detected those files and tried to create movies out of it. Those files are windows specific and contain the thumbnail database for the video's in that folder. (desktop.ini i only mentioned extra it was not detected with me but could exists also but thumbs.db was detected)

 

9/12/2019 8:20:59 PM	INFO	Proccessing Thumbs.db
9/12/2019 8:20:59 PM	INFO	Randomized overlay images found. Using section [Overlay1]
9/12/2019 8:20:59 PM	INFO	Start creating video : [Thumbs.MP4] with imagemask [TAF%%%.png] from [Overlay1] 
9/12/2019 8:20:59 PM	INFO	Found [M:\Pinball\PinballX\Media\Visual Pinball\Table Videos\Thumbs.db]
9/12/2019 8:20:59 PM	INFO	Shell.Run(["M:\Pinball\PinballX\ffmpeg.exe" -y -i "M:\Pinball\PinballX\Media\Visual Pinball\Table Videos\Thumbs.db" -r 12 -thread_queue_size 512 -i "M:\Pinball\PinballX\Media\Overlay\TAF%03d.png" -filter_complex "[0:v]scale=1920:1080[scaled];[scaled][1:v]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2,fps=fps=30,vflip,hflip" -ss 00:00:00 -t 00:00:05 -an -vcodec:a libx264 -preset veryslow -b:v 1M -f MP4 "M:\Pinball\PinballX\Media\\Loading Videos\Thumbs.MP4])
9/12/2019 8:21:00 PM	INFO	Run [M:\Pinball\PinballX\ffmpeg.exe -y -i "M:\Pinball\PinballX\Media\Visual Pinball\Table Videos\Thumbs.db" -r 12 -thread_queue_size 512 -i "M:\Pinball\PinballX\Media\Overlay\TAF%03d.png" -filter_complex "[0:v]scale=1920:1080[scaled];[scaled][1:v]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2,fps=fps=30,vflip,hflip" -ss 00:00:00 -t 00:00:05 -an -vcodec:a libx264 -preset veryslow -b:v 1M -f MP4 "M:\Pinball\PinballX\Media\\Loading Videos\Thumbs.MP4] returned 1
9/12/2019 8:21:00 PM	ERROR	Error during creating video : [Thumbs.MP4]

Share this post


Link to post
Share on other sites

Thanks. I didn't have them in my folders, but will exluded them in the following release.

I have already a complete areay what to excluded abd will add these 2 files to.

Thanks for bringing it up !

Share this post


Link to post
Share on other sites

@Mike_da_Spike downloaded latest version, is it normal that the app processes "- system -.mp4" files from system menu ?

 

09/13/2019 11:21:48 AM	INFO	Randomized overlay images found. Using section [Overlay1]
09/13/2019 11:21:48 AM	INFO	Start creating video : [- system -.MP4] with imagemask [TAF%%%.png] from [Overlay1] 
09/13/2019 11:21:48 AM	INFO	Found [C:\PinballX\Media\Visual Pinball\Table Videos\- system -.mp4]
09/13/2019 11:21:48 AM	INFO	Shell.Run(["C:\PinballX\ffmpeg.exe" -y -i "C:\PinballX\Media\Visual Pinball\Table Videos\- system -.mp4" -r 12 -thread_queue_size 512 -i "C:\PinballX\Media\Overlay\TAF%03d.png" -filter_complex "[0:v]scale=1920:1080[scaled];[scaled][1:v]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2,fps=fps=30,vflip,hflip" -ss 00:00:00 -t 00:00:05 -an -vcodec:a libx264 -preset veryslow -b:v 2M -f MP4 "C:\PinballX\Media\\Loading Videos\- system -.MP4])
09/13/2019 11:22:08 AM	INFO	Run [C:\PinballX\ffmpeg.exe -y -i "C:\PinballX\Media\Visual Pinball\Table Videos\- system -.mp4" -r 12 -thread_queue_size 512 -i "C:\PinballX\Media\Overlay\TAF%03d.png" -filter_complex "[0:v]scale=1920:1080[scaled];[scaled][1:v]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2,fps=fps=30,vflip,hflip" -ss 00:00:00 -t 00:00:05 -an -vcodec:a libx264 -preset veryslow -b:v 2M -f MP4 "C:\PinballX\Media\\Loading Videos\- system -.MP4] returned 0
09/13/2019 11:22:08 AM	INFO	Succesfully created video : [- system -.MP4]

 

Am currently letting it redo everything on my cabinet, my cab is much slower than my main pc so will be a while but it's only once as the app detects video's already done which is great so in future it will only have to do newly added tables :)

Share this post


Link to post
Share on other sites

Hmmm... I should skip the - system - (see your previous log). It doesnt hurt, because system is not used. But must recheck the code.

As I said: I'm not a programmer :P.

Share this post


Link to post
Share on other sites
10 minutes ago, Mike_da_Spike said:

Hmmm... I should skip the - system - (see your previous log). It doesnt hurt, because system is not used. But must recheck the code.

As I said: I'm not a programmer :P.

No problem only noticed it as it was the first file it did but if it's not used with scutters plugin i leave it in otherwise it would recreate the file each time :) 

and btw scripting is a form of programming, you did a good job :)

Share this post


Link to post
Share on other sites
4 minutes ago, joyrider3774 said:

No problem only noticed it as it was the first file it did but if it's not used with scutters plugin i leave it in otherwise it would recreate the file each time :) 

- sytstem - videos will be ignored by the plugin (unless you rename to the actual system name), so shouldn't cause an issue.

  • Like 1

Share this post


Link to post
Share on other sites

Updated version to 0.92b
System video's will be skipped again ...

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, joyrider3774 said:

and btw scripting is a form of programming, you did a good job :)

thanks ! I appreciate it

Share this post


Link to post
Share on other sites

Uploaded version 1.0
I noticed I had some textual logging issues (typos... :P ). Removed those and put out of Beta. Thanks to all who tested it and believed in me

  • Like 1

Share this post


Link to post
Share on other sites

Uploaded version 1.1
Added support for NVIDIA GPU rendering. In my case the video's generated 55% faster.
Not sure if people still using this, after implementing GIF overlay in PinballX. 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
10 minutes ago, Mike_da_Spike said:

Uploaded version 1.1
Added support for NVIDIA GPU rendering. In my case the video's generated 55% faster.
Not sure if people still using this, after implementing GIF overlay in PinballX. 

 

I am!, i'm an nvidia user too so this should be great for me. Thanks Mike 

Share this post


Link to post
Share on other sites
39 minutes ago, scutters said:

I am!, i'm an nvidia user too so this should be great for me. Thanks Mike 

awesome ! Let me know if it is faster for you @scutters

Share this post


Link to post
Share on other sites
4 hours ago, Mike_da_Spike said:

awesome ! Let me know if it is faster for you @scutters

Indeed it is!! good work, thanks.

  • Thanks 1

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...