VID file format
VID Format
The ZX Spectrum Next VID format can be played back with the dotcommand .playvid which is included on the official distribution. The format and dotcommand was devised and written by Allen Allbright. To assist in creating compatible VID files, em00k created a tool call MakeVid that can convert many popular video formats using ffmpeg into VID files. MakeVid is a Windows application and can be downloaded from the MakeVid Github page
VID File Format
The VID file is constructed in the following way:
Mode | Description | Frame Structure |
---|---|---|
0 | 320x240 With palette 16.7fps 933 stereo samples @ 15.6kHz (frame size = 155) (layer 2) |
|
1 | 320x240 no palette 16.7fps 933 stereo samples @ 15.6kHz (frame size = 154) (layer 2) |
|
2 | 256x240 With palette 16.7 fps 1866 stereo samples @ 31.1kHz (frame size = 129) (layer 2) |
|
3 | 256x240 no palette 17fps 1866 stereo samples @ 31.1kHz (frame size = 128) (layer 2) |
|
4 | 256x192 With palette 25fps 933 mono samples @ 23.3kHz (frame size = 99) (layer 2) |
|
5 | 256x192 no palette 25fps 933 mono samples @ 23.3kHz (frame size = 98) (layer 2) |
|
Using MakeVid
Here is some additional information for using MakeVid and technical details on how the VID file is created.
Drop any mp4/avi/mkv onto the "Input Video" text. Select the desired resolution from the 3 options in the dropbox. If you want a preview at the end, ensure "Generate Preview mp4" is selected, and this will generate a new mp4 that will play once the conversion has completed to give you a taste of what the video will look like.
Supported Resolutions
- 320x240 With palette: 16.7fps, 933 stereo samples @ 15.6kHz (frame size = 155) (layer 2)
- 320x240 no palette: 16.7fps, 933 stereo samples @ 15.6kHz (frame size = 154) (layer 2)
- 256x240 With palette: 16.7fps, 1866 stereo samples @ 31.1kHz (frame size = 129) (layer 2)
- 256x240 no palette: 17fps, 1866 stereo samples @ 31.1kHz (frame size = 128) (layer 2)
- 256x192 With palette: 25fps, 933 mono samples @ 23.3kHz (frame size = 99) (layer 2)
- 256x192 no palette: 25fps, 933 mono samples @ 23.3kHz (frame size = 98) (layer 2)
Configuration Options
Video Settings
- Use the "Dithering" dropbox to change the dither method used to convert the frames.
- You can adjust the amplitude by adjusting the Volume value, the default is 4.
- MakeVid also lets you alter the contrast, gamma & saturation of the output file. The default values are set to 1.0 - increments of 0.1 should be used for best effects.
Custom FFMPEG Parameters
You can tell ffmpeg to only extract a section from the video if you enable "Use custom ffmpeg parameters". This will enable the text box below which should have the default settings of:
-ss 00:00:00 -to 00:00:30
These values represent HH:MM:SS
- be careful if you end up with a mistake here as the video will not convert.
Other Options
- Cleanup will clean up all the extracted videos and is a default option.
- This version has had the RAM drive option removed as you can now select an "Output Path" as a new destination for the converted file and temporary files used.
- The button "Output Path" will let you select a new destination path.
- "Open Folder" will open the folder for the "Input Video" to browse.
- "Explore File" will open the folder with the "Output File" in.
Conversion Process
- Extracts the audio at the required bit rate
- Extracts the video as separate bitmap images, rotates or crops as required
- Creates a VID file by combining the extracted raw audio & raw bitmaps
- Optionally creates a preview mp4
Example Conversion
For converting a video to 256x192 25fps, 23KHz audio:
Extract audio 23300Hz mono unsigned 8bit
ffmpeg -y -i "267.mp4" -ac 1 -f u8 -ar 23300 -af "volume=3dB" "e:\audio.pcm"
Extract frames as BMP files 25fps 256x192 RGB8 palette
ffmpeg -y -i "267.mp4" -vsync cfr -r 25 -vf "eq=contrast=1:gamma=1:saturation=1,vflip,scale=w=256:h=192:sws_dither=auto" -pix_fmt rgb8 "e:\ffmpeg0_%d.bmp"
Dependencies
- MakeVid requires ffmpeg to be located in the bin folder distributed with MakeVid.
- MakeVid uses RegistryProc by mk-soft for saving & reading registry user preference data and can be found in
HKCU/Software/em00k/makevid