You can follow updates on the AGABlaster Twitter channel
You can see converted videos running on my Amiga from 1992 in my YouTube channel
This is a retro computing just-for-fun project. AGAConv is a CDXL video converter for Commodore-Amiga computers. It combines some existing tools to convert videos (MP4, etc.) into the CDXL format which can be played with AGABlaster or other CDXL players on an AGA Commodore-Amiga computer. The first Commodore-Amiga computer with the AGA chipset was released in 1992. Commodore went bankrupt in April 1994.
The CDXL format was created by Commodore primarily for the Commodore CDTV, released 1991, to permit playback of video from CD-ROM in the early 1990s. The CDXL format is a simple streaming format, consisting of linear concatenated chunks (packets), each with an uncompressed frame and associated audio data. In addition to the original 12-bit colors, AGAConv also supports 24-bit colors, as supported by Commodore Amiga AGA systems released in 1992+. It also ensures 32-bit padding of CDXL chunks, which can make a difference in video frame rate of up to 50%.
Overview of supported video/audio modes:
AGAConv was tested on Ubuntu 18.04 and on Windows 10 with Microsoft's Ubuntu app/terminal. The generated videos were tested on an Amiga 4000/60 with AGABlaster and Amiga OS 3.9 with original graphics and sound hardware.
AGAConv combines several tools to generate a CDXL file via a single command-line interface.
The script agaconv provides command line options such that every conversion can be done via a single command line and eventually calls agaconv-encode to generate a CDXL file that can be played on an Amiga with AGABlaster.
agaconv 0.9.7 is distributed with a GPL v3 open-source license.
AGAConv can generate custom CDXL files with 24-bit colors and standard CDXL files with 12-bit colors. All generated CDXL files can be played with AGABlaster without providing any additional command line options. The standard CDXL files can also be played with other CDXL players, such as cdgsxl and ffplay. Other players than AGAConv require additional command line options for speed/resolution settings. AGABlaster does not require any additional command line options for AGAConv generated CDXL files.
By default AGAConv generates videos with 24 frames per second (FPS), 28000 Hz, stereo sound, 320 pixel width, the height scaled to an Amiga screen (to maintain the original aspect ratio), and 256 colors per frame (AGA). Therefore, the easiest way to generate an AGA video is to provide only the input file name and and the output file name (see very first example). In the examples, additional command line options are only used to demonstrate how values different to the default values can be selected. The only required inputs are input and ouput file name.
This generates the video file myvideo.cdxl which can be played with agablaster on an AGA Amiga. Using default settings, it uses a frame rate of 24, 28000 Hz stereo sound, up to 256 unique colors (AGA8) per frame (24-bit color space), a width of 320, lores resolution, and the height is computed to keep the ratio of the original video.
To run the converted CDXL video on an Amiga with AGABlaster type
In this example, we set the color-mode different to the default (of aga8). This sets a maximum of 7 planes (128 colors) per frame.
In this example, we use a user-provided value for the monitor-mode. This rescales the video for display on a flat-screen that stretches the video to the full 1080p size. The rescaling ensure that the aspect ratio remains correct. This is a setting that many people use on a 1080p monitor. There also exists a fill1200 option.
This generates the video file myvideo.cdxl which can be played with agablaster on a high-end AGA Amiga. It uses HAM8 frames (24-bit color space), a width of 640 in hires mode, and the height is computed to ensure correct scaling on an Amiga 4:3 monitor (default setting).
This generates the video file myvideo.cdxl which can be played with agablaster on an OCS Amiga. It has encoded 18 frames per second, 15000 Hz stereo audio, HAM6 frames (12-bit color space), a width of 256, and the height is computed to keep the ratio of the original video on an Amiga screen.
Note that AGABlaster is optimized for AGA systems, it has no OCS specific optimizations or mode. When using AGABlaster on an OCS/ECS system to display CDXL videos use the additional AGABlaster command line option FMODE=0.
Here are some examples for generating a standard CDXL video with 12-bit color range which can be played with any CDXL player. However, note that other players than AGAConv will require additional command line options to provide some speed-stetting or they support only one. AGAConv does not require this because it picks up all necessary info from the additional information that AGAConv generates in the CDXL frame header.
This generates a standard CDXL file with 5 bitplanes (32 colors) and 12-bit color range. This is the fastest method to generate a video for OCS. About 1 minute for a 1 minute video. The default for std-cdxl is 15 FPS with 11025 Hz.
This generates a standard CDXL HAM6 video (with 12-bit colors) that can be played with every CDXL player. AGAConv adjusts the provided frequency (if necessary) such that correct audio/sound timing can be maintained with frames of equal size. In this example it will adjust the frequency to 15012 Hz. HAM6 conversion takes longer than the above, but gives better quality results. HAM6 conversion runs the tool ham_convert in the background.
This generates a standard CDXL file with Extra Halfbrite mode (EHB). ham_convert has a special optimization mode for sequences of EHB frames. This can give a more stable display than HAM6.
This is not recommended, but it works. This is a format that was used in several games in the late 90s to provide AGA HAM8 videos. It indeed uses HAM8 frames, but since it is a standard CDXL format which only supports a 12-bit color range for the color palette (same color range as on OCS systems) it is of much lower quality than possible on an AGA system. A true AGA HAM8 video can use the full 24-bit color range (see above for custom AGABlaster CDXLs with 24-bit colors). However, it does work also with other CDXL players, so this still can be fun to play with. These low-quality 12-bit HAM8 videos are like a HAM6 video with a 64 color palette (instead of 16). It will have less artifacts than a HAM6 video, but it uses the same color range as a HAM6 video.
This is not recommended, but it works. Similar to above HAM8 12-bit example, but with AGA8 (8 planes, 256 colors per frame). Conversion speed is about by a factor of 15 faster than for HAM8.
There exist several CDXL players. Listed here are only those that were used in testing generated CDXL videos.
AGABlaster can play every AGAConv generated CDXL video without any additional command line options. It can play standard 12-bit CDXL videos and custom 24-bit CDXL videos. Custom 24-bit CDXL videos give the best quality on AGA systems and can be smaller than standard CDXL videos.
ffmpeg's ffplay can play standard 12-bit CDXL videos. To my knowledge there is no way to select the display speed, it is the encoded audio frequency that determines the speed. To get a correct display-speed with ffplay select a frequency of 11025 Hz for mono audio videos. Select 22050 Hz for stereo videos (the different frequency setting is required because of an ffplay bug).
cdgsxl can play standard 12-bit CDXL videos and is a well-known CDXL player on the Amiga. It requires additional command line options to run a CDXL file.
Depending on the command line options, agaconv invokes 2-3 tools in the background. It ensures that the command line options between those tools are used consistently. It invokes at least ffmpeg and agaconv-encode. Options for HAM and EHB modes trigger to also invoke ham_convert.
The only required options are INPUTFILE and OUTPUTFILE. All other options are only necessary to select values different to the default options.
|INPUTFILE||provide name of input video file (e.g. myvideo.mp4)|
|OUTPUTFILE||provide name of output CDXL file (e.g. myvideo.cdxl)|
|--fps=NUMBER||specify number of frames per second in CDXL video (default: 24)|
|--color-mode=MODE||where MODE is aga8|aga7|...|aga3|ham8|ham6|ehb|ocs5|ocs4|ocs3 (default: aga8 with 24-bit colors)|
|--screen-mode=MODE||where MODE is lores|hires|superhires (default: lores)|
|--monitor-mode=MODE|| where MODE is amiga|keep_ratio|fill1080|fill1200 (default: amiga)|
The four options use scale factors of 1.15|1.00|1.24|1.37.
|--width=NUMBER||specify width of CDXL video (default: 320)|
|--height=auto|NUMBER||This value is automatically computed from the width and monitor mode. However, if NUMBER is provided it will use exactly this height.|
|--audio-mode=MODE||where MODE is mono|stereo (default: stereo)|
|--frequency=NUMBER||specify audio frequency of converted CDXL video (default: 28000). Maximum supported frequency is 28867 Hz.|
|--dither=MODE||where MODE is none|bayer|fs (default:bayer for OCS/AGA (ffmpeg), fs for HAM6/8, EHB (ham_convert))|
|--std-cdxl||generate standard CDXL file with fixed frame size, which can also be played with other CDXL players such as cdgsxl and ffplay. If necessary, AGAConv adjusts the audio frequency to ensure correct audio/video synchronization. This sets a default for FPS=15, Frequency=11025. Above options allow to set different values.|
|--version||print agaconv version, copyright info, and license info|
|--quiet||no progress output on screen during conversion|
|--help||print help text|
|--help-extra||print additional options (only for testing and developers)|
All options have good default values. If only the input file name and output file names are provided, then AGAConv generates an AGA8 24-bit CDXL video with 25 fps, 320 width, the height scaled for Amiga monitors, and 28000Hz stereo audio.
Thus, the shortest command line to generate a CDXL video is:
AGAConv encodes a sequence of PNG or IFF files and an 8-bit PCM audio stream into a CDXL video. The tool ffmpeg is used to extract the PNG files for a specified number of frames per second, and it can also extract a PCM audio stream for a specified frequency. The same frame rate and frequency that is used with ffmpeg is also be provided to agaconv-encode.
In addition, optional tools can be used to convert frames. For example, ffmpeg cannot convert extracted frames to HAM frames. For this purpose the tool ham_convert is invoked, to generate high quality HAM frames.
Therefore there are two possible variants of usage:
Each of the variants allows to specify a number of quality arguments to AGAConv which are used when calling the respective tools.
AGAConv release 1.0 will simplify the installation by providing a PPA package (this will make it available for all Ubuntu supported platforms). Currently only a manual installation is provided.
You can use agaconv now to convert mp4 videos to CDXL videos by typing
A Windows native installer is not provided yet. On Windows the only way to install the binary distribution of AGAConv is to install the Microsoft Ubuntu App, then install and run AGAConv in the Ubuntu terminal on Windows. All required command lines for installation are provided, but it's quite clunky to use. It does work though. It's easiest if you copy the original video into the directory where you unpacked agaconv.
You can use agaconv now to convert mp4 videos to CDXL videos by typing
Note, in the Ubuntu terminal you can use TAB for auto-complete of file names and directory names, hitting TAB twice lists the entire directory (all matches); CURSOR KEY UP gives the previous command.