About 6 years ago I wrote one of my first Vectrex blog entries about Bad Apple.
This is sort of a “follow up”. “The Times They Are a-Changin’“
Steve Jobs might have been quite mad with me, migrating from my iMac to a Windows PC – especially by quoting Bob Dylan when doing so… nonetheless this did happen.
Above mentioned blog entry does not “work” for me anymore – since it was mainly written for Mac-Users. Being now (again) a member of the windows world and wanting to test out movie generation for vectrex again, I was faced with a dilemma:
– should I power up my old rusty iMac?
– should install everything on a virtual (Ubuntu) machine?
– is it even possible to use a windows based setup?
Long talk – short answer:
Above file contains (runnable out of the box) a windows 10 (tested on 3 different machines) version of the complete setup to generate a BadApple “Movie” for the vectrex.
You know – I adore software that just comes in a package (plain zip) and works out of the box, without downloading additional stuff, without setting up, without missing DLL and without it corrupting your registry and file system with unwanted links.
Above pakage is such a thing, you unpack it anywhere you like and in a shell (or from your Total Commander) execute:
… and it will build the movie.
It takes time – depending on the speed of your computer it might take an hour or so. While running a vecx emulator will at some stage be shown, that plays the complete movie. This is to determine sync values for the audio. The vecx will close itself when finished!
(and the last stage of the building process will begin)
Some more information:
The package includes:
- mplayer – binary installed
- ImageMagick – binary installed
- potrace – binary installed
- sox – binary installed
- asm6809 – binary installed
- vecx (patched) – binary installed
- php – binary installed
- bash – binary installed
If you execute the convert.bat, all paths are setup from the current directory. The convert.bat takes one parameter, the MP4 file to convert. Most probably other files might need different “internal” settings to look good.
The version above is nearly identical to the original SpritesMod version, that is – it only supports potrace data output. I have somewhere on my Mac a modified version, that also supports autotrace output (svg), but I have not converted that yet …might be a future project.
Behind the scene – what does this do?
sets up the correct paths to use bash, and than executes the bash with the “convert.sh” script file
this very closely resembles the original sprites mod script. Modified in the ways to add local binary paths and to pass some parameters to the combine.php script.
the convert.sh script first invokes mplayer, which generates “png” snapshot files of the movie and also saves the audio to a wav file. All png files are generated into a directory “png”. For the included BadApple version 6572 png images (each 500kB) are created.
is called to convert the png files to pnm files (potrace cannot work with png). All pnm files are generated into the directory “pnm”.
each of the pnm files is converted (vectorized) with potrace to a “geojson” format. These files are stored in the directory “vec”.
is called to convert the wav file (output from mplayer) to a raw 11700 hz data file (audiodump.raw)
is called to generate vectrex “vector line” data. The raw data is output to a binary vec.bin.
In stage 1, the audio data is not included in vec.bin.
This for now also generates into the directory “tst” png files for “debugging” which shows the original png image overlayed with the generated vectors – to be able to “manually” compare the vector output to the image input.
The player of binary for the vectrex is created.
Executing this – my installed Virus scanner always throws an alarm. But this file does NOT contain any Virus (I double check with VirusTotal). Theoretically you only have to build the player once, since it is always the same. But in case you would want to change the vectrex binary in any way, this is part of the complete setup.
The special vecx version is started with the built player. The vecx loads the vec.bin and generates a timing.log. The log describes the length and position of where the player can play the audio data.
is called again to generate vectrex “vector line” data. The raw data is output to a binary vec.bin. In stage two the timing.log information is used to build an “interleaved” version of the vector data and the audio data. The final pairing:
player.bin (vectrex executable)
vec.bin (file to “stream” from)
Can be used to play the movie.
(VecFever, VeXtreme, PiTrex – or Vide if the cartridge setup was done correctly)
Still further information
Vecx was build using a “MSYS MinGW x64” unix environment install under windows. Additionally to the development tools it was necessary to find SDL and two SDL extensions (SDL! – NOT SDL 2).
SDL “install” is supplied within the directory “MovieGen\bin\vecx.win32\SDL” – it took me some time to find the correct SDL downloads.
Bash install was “snitched” together from a windows git install, which was also based on MINGW64. I only copied over the bash commands that were used in the script.
PHP – I just installed the current (php-8.1.3-nts-Win32-vs16-x64.zip) version, and enabled the needed extensions to the php.ini file.
All other binaries were downloaded from their original homepages (links in my original blog entry are still valid!) and unpacked “as is” – it seemed to be easier going than on my iMac 6 years ago!