AGAConv - Commodore Amiga CDXL Video Converter
Recent Updates
You can follow release updates on X/Twitter: https://twitter.com/AGABlaster
- 14-JUL-2024: agaconv 1.1.0 released (with binary PPA Installer for Ubuntu 24.04, 22.04, 20.04) (How to upgrade)
- 26-AUG-2023: agaconv 1.0.3 released (with binary PPA Installer for Ubuntu 22.04, 20.04) (How to upgrade)
- 11-JUN-2023: agaconv 1.0.2 released (with binary PPA Installer for Ubuntu 22.04, 20.04)
- 28-MAY-2023: agaconv 1.0.1 released (with binary PPA Installer for Ubuntu 22.04, 20.04)
- 14-MAY-2023: agaconv 1.0.0 released (with binary PPA Installer for Ubuntu 22.04, 20.04)
- 21-FEB-2021: agaconv 0.9.7 released
- 17-JAN-2021: agaconv 0.9.6 released
- 26-APR-2020: agaconv 0.9.5 released
- 30-NOV-2019: agaconv 0.9.4 released
AGABlaster YouTube channel showing agaconv converted Amiga videos.
When a new version of agaconv is released, run the following commands to upgrade to the new version
- sudo apt update (updates database)
- sudo apt upgrade (upgrades to new agaconv version)
For more information on how to install AGAConv see the Installation Instructions.
Overview
This is a retro computing just-for-fun project started in 2019. 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+.
Overview of supported features
- CDXL Formats:
- Standard CDXL with optimized bitplanes and frequency adjustment
- Standard CDXL with fixed frames and frequency adjustment
- Custom CDXL with optimized color palette and bitplanes, and exact frequency
- Configuration file allows to set any options as default.
- Each frame with its own color palette
- Color modes:
- AGA8 to AGA2, 24 bit colors
- OCS5 to OCS2, 12 bit colors
- HAM8, 24 bit colors (requires ham_convert) [since 0.9.5]
- HAM6, EHB, 12 bit colors (requires ham_convert) [since 0.9.5]
- Screen (resolution) modes:
- Audio
- Encoding of custom CDXL videos (minimal number of bitplanes in each frame)
- With 24-bit color palette and variable length frames
- Allows any frequency
- Encoding of standard CDXL videos (fixed number of bitplanes)
- Frequency is automatically adjusted (if necessary) such that all frames have the same size and data sections are 32bit aligned on disk
- 12-bit colors are supported in 2-byte format
- 24-bit colors are supported in RGB 3-byte format (same as IFF/ANIM CMAP chunk body data)
The generated videos were tested on a classic Amiga 4000/60 with AGABlaster and Amiga OS with original graphics and sound hardware.
Integrated Tools in AGAConv
- AGAConv invokes ffmpeg to extract and convert frames to PNG files.
- Starting with version 0.9.5 it can also invoke the graphic converter ham_convert to generate HAM8/HAM6/EHB frames.
- AGAConv encodes extracted graphics and audio data into a CDXL video file.
Documentation (Manual)
The AGAConv Manual describes all command line options, the use of configuration files, and contains a list with several usage examples (see Section Examples).
Linux Binary Distribution - PPA Installer - Installation Instructions
Binary distribution is available for
- Ubuntu 22.04 (Jammy Jellyfish)
- Ubuntu 20.04 (Focal Fossa)
The binary distribution can be downloaded and installed with apt on Ubuntu as follows (the right Ubuntu version is selected automatically):
- sudo apt update - start here if this is the very first PPA being added to your system
- sudo apt upgrade
- sudo apt install software-properties-common
- sudo add-apt-repository universe
- sudo add-apt-repository ppa:m-schordan/agaconv - start here if you have added other PPAs before
- sudo apt update
- sudo apt install agaconv
This downloads and installs the AGAConv package and all required dependencies. After these steps AGAConv is ready to convert any MPEG4 video (and other formats) to CDXL for Amiga AGAx and OCSx screen modes. For HAM6/8 videos ham_convert must be installed as well.
After installation a video can be converted as follows: agaconv myvideo.mp4 myvideo.cdxl
The package also installs the manual as a Linux man page. The manual can be viewed with the command man agaconv.
Details about the PPA Package can be found on the AGAConv PPA page. However, above command lines are sufficient for installation, you do not need to visit the PPA webpage for installation of the package.
When a new version of agaconv is released, run the following commands to upgrade to the new version
- sudo apt update (updates database)
- sudo apt upgrade (upgrades to new agaconv version)
Installation of ham_convert (optional)
For HAM conversions the tool ham_convert can be added to AGAConv. It is not included in the PPA package because it is not open-source software.
Here are the steps to download and integrate it with AGAConv:
- sudo apt install wget zip default-jdk xvfb (xvfb is only required when using the Microsoft Ubuntu App)
- wget -O ham_convert.zip http://mrsebe2.bplaced.net/ham_convert/ham_convert_latest.zip (Download ham_convert)
- unzip ham_convert.zip
- agaconv --change-config --hc-path=$PWD/ham_convert
ham_convert is now installed on your system and integrated into the AGAConv conversion pipeline. Step 4 stores the absolute path to ham_convert in AGAConv's default config file. agaconv --help should show this path as default value for the '--hc-path' option now.
To convert a video into a HAM8 CDXL file: agaconv --color-mode=ham8 myvideo.mp4 myvideo.cdxl
Note that ham_convert is about 10-15 times slower than ffmpeg. If you want to see some output during conversion use the additional option --verbose=2. This produces some output for each converted frame.
Reporting bugs and resolving installation issues: visit the following EAB forum thread
Open-Source Distribution
Available on github: https://github.com/mschordan/agaconv
License
AGAConv is distributed with a GPL v3 open-source license.
Getting Started - Converting Your First CDXL Video (with test video download)
In this quick example session we (1) install wget, a program for
downloading files, (2) download a test video, (3) and convert it with agaconv. It can then be played on an Amiga or Amiga emulator such as WinUAE or fs-uae.
- sudo apt install wget
- wget -O testvideo.mp4 https://docs.google.com/uc?id=1gA5wr7O-FKzBFOesZej03fPZ-WxqL_UH
- agaconv testvideo.mp4 testvideo.cdxl
The CDXL video testvideo.cdxl is now ready. It runs at 24 FPS with stereo audio at 28032 Hz. It can be played with AGABlaster on an Amiga (or emulator) with
-
agablaster testvideo.cdxl
Installation on Windows (in Ubuntu App/Terminal)
On Windows AGAConv can be installed in the Microsoft Ubuntu App. After installation you can see the Ubuntu Linux file system as mounted as a Windows drive 'Linux'. The Windows drives are also mounted drives in the Ubuntu App's file system. Following are instructions for Windows installation.
- Install the Microsoft Ubuntu app from the Microsoft App Store (it's free!).
- Start the Ubuntu App (search for 'Ubuntu App' in the Windows search box and select it)
Now copy and paste the following commands ('paste" is Windows Key + 'v', or middle mouse button, or on a Laptop 'two-finger click' on touch pad)
- sudo apt update
- sudo apt install wget software-properties-common
- sudo apt upgrade - this also upgrades ffmpeg to the newest version and may take a while
- sudo add-apt-repository ppa:m-schordan/agaconv - now we are ready to install AGAConv
- sudo apt update
- sudo apt install agaconv - this installs the newest version
Now let's convert our first CDXL video. We will download a test video and convert it to a CDXL video.
- wget -O testvideo.mp4 https://docs.google.com/uc?id=1gA5wr7O-FKzBFOesZej03fPZ-WxqL_UH
- agaconv testvideo.mp4 testvideo.cdxl
That's it. We have created a CDXL video 'testvideo.cdxl' in AGA8 color mode, with 24 FPS and stereo audio at 28032 Hz. This video can be played on an AGA Amiga with AGABlaster.
To copy the video from the Ubuntu Terminal's file system to the Videos folder on Windows we can use
- cp testvideo.cdxl /mnt/c/Users/yourwindowsusername/Videos
We are done!
Making things even easier for future sessions on Windows
To make things even easier in future we can create some symbolic links and for example convert any videos directly into an Amiga emulator's directory.
To make the file path shorter, we can create a symbolic link to the Windows folder:
- ln -s /mnt/c/Users/yourwindowsusername mywindows
Now we can copy the test video from the Ubuntu terminal to the Windows file system's Video directory with
- cp testvideo.cdxl mywindows/Videos
If WinUAE is installed with the default file path C:\Users\Public\Documents\Amiga Files\WinUAE we can also create a symbolic link to the WinUAE directory as follows and copy the file directly into the WinUAE folder:
- ln -s "/mnt/c/Users/Public/Documents/Amiga Files/WinUAE" mywinuae (the double quotes are necessary because of the space in the name)
- cp testvideo.cdxl mywinuae
Now that we have these two symbolic links, we can in future sessions also simply go to the Windows Videos folder right away and convert videos directly into the WinUAE folder:
- Start Ubuntu App
- cd mywindows/Videos
- agaconv myvideo.mp4 ~/mywinuae/myvideo.cdxl
The tilde ~ is necessary to refer to our home directory, where we created the symbolic link (creating symbolic links in the Windows file system from Ubuntu is not supported).
Start WinUAE, start AGABlaster, select testvideo.cdxl in the File Requester, and play it! Make sure to go full screen in WinUAE!
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); If there is no match, hit TAB twice to list the entire directory. CURSOR KEY UP/DOWN allows to select previous commands.
Playing AGAConv Generated CDXL videos on an Amiga
There exist several CDXL players. Listed here are only those that were used in testing generated CDXL videos.
AGABlaster (Amiga)
AGABlaster can play 24-bit custom CDXL videos and standard 12-bit CDXL videos. Custom 24-bit CDXL videos give the best quality on AGA systems.
Convert with: agaconv testvideo.mp4 testvideo.cdxl - by default this creates a custom 24-bit CDXL video with stereo audio and 24 FPS.
Play the video on an AGA Amiga with:
- agablaster testvideo.cdxl - plays the video that we just generated
- agablaster video1.cdxl video2.cdxl - plays a list of videos
- agablaster - starts AGABlaster on the workbench and allows to select a list of videos in the file requester
- Select the AGABlaster icon on the workbench and select the video in the File Requester.
AGABlaster does not require any additional parameters to play a CDXL video that were generated by AGAConv.
cdgsxl (Amiga)
cdgsxl is a CDXL player from 1995 that can play standard 12-bit CDXL videos. It requires additional command line arguments to run a CDXL file.
cdgsxl myvideo.cdxl dosxl multipal blit lmbabort xlspeed=NUM where NUM is the number of blocks per second (block=2048 bytes).
ffmpeg's ffplay CDXL mode (on multiple platforms)
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 and mono audio videos. The AGAConv default of 24 FPS works fine then.
Example for generating a CDXL video with HD dimensions of 1920x1080, playing at 24 FPS (only playable on PC)
- agaconv testvideo.mp4 testvideo.cdxl --format=std-fixed --width=1920 --frequency=11025 --audio-mode=mono --screen-mode=unspecified --force-color-depth=12
- ffplay testvideo.cdxl -fs
The option --screen-mode=unspecified is necessary to tell AGAConv not to adjust the aspect ratio of the CDXL video for the Amiga screen mode(s). The other options are required for ffplay to play the CDXL video properly. Note that STD CDXL uses 12-bit colors (not 24-bit AGA colors), so this is a video with 8 bitplanes and 256 colors per frame, but only 4096 color range, because ffplay can only play standard 12-bit CDXLs videos. However, HD resolution is a plus in this CDXL conversion variant.
Release Notes
- 14-JUL-2024: agaconv 1.1.0:
- Added command line option --format=ctm-opt|std-opt|std-fixed for selecting custom and standard format modes
- Made STD CDXL the default mode (including 24bit color mode)
- Fixed 2nd frame previous-frame-link = 0 bug
- Fixed last frame audio-spike bug (user contribution by Emiliano Esposito)
- Added MacOS Layer support (user contribution by Emiliano Esposito)
- 26-AUG-2023: agaconv 1.0.3:
- Fixed OCS 12-bit color palette
- Changed --std-cdxl with AGA modes to keep 24-bit mode by default
- 11-JUN-2023: agaconv 1.0.2:
- Fixed hires/superhires flag in auto screen mode
- Enabled overscan width in auto screen mode (requires agablaster 0.9.92)
- 28-MAY-2023: agaconv 1.0.1:
- Fixed invocation of ham_convert for Microsoft Ubuntu App (terminal)
- Increased width and height range and maximum plane size.
- Enabled option 'unspecified' for screen mode.
- 14-MAY-2023: agaconv 1.0.0:
- Added support for configuration files (default and user configs).
- Eliminated the agaconv script and integrated its functionality into agaconv.
- Added 'auto' modes to several options, simplifying its use.
- Added manual (man page on Linux). Also available on-line as AGAConv Manual
- Created AGAConv PPA package, making it available with an Ubuntu PPA installer.
- 21-FEB-2021: agaconv 0.9.7:
- Improved 12-bit color conversion quality (also requires agablaster 0.9.83)
- 13-FEB-2021: agaconv 0.9.6.1:
- Fixed bug in combination of options --std-cdxl --color-mode=ham6/8
- Reverted back to default --monitor-mode=keep_ratio
- 17-JAN-2021: agaconv 0.9.6:
- Simplified command line options and auto-complete (TAB) works now on input/output file names.
- For those who enjoy generating gigantic CDXL files - the frame number is encoded as 32-bit number now. This allows more than 65535 frames.
- Enabled ham_convert's new EHB anim mode (gives more stable frame sequences, reduces noise).
- Added support for standard CDXL 12bit color videos with fixed frame size. Generated standard CDXL videos can also be played with other CDXL players such as cdgsxl and ffplay now. Note that standard CDXL videos only use 12 bit colors and are of lower quality also on AGA systems.
- Added automatic adjustments for standard CDXL format. If necessary, the audio frequency is adjusted to ensure that the audio-video synchronization can be maintained in the CDXL video.
- Fixed CDXL PlaneArrangement entry bug. This is now set as BIT_PLANAR (instead of BYTE_PLANAR). Generated videos also work with ffplay now.
- Fixed memory leak in IFF-file-based conversion.
- 03-JUN-2020: agaconv 0.9.5.4 to 0.9.5.1 (script tweaks and ham_convert updates):
- HAM conversion also works in a Windows 10 Ubuntu Terminal now
- Improved HAM conversion speed with ham_convert 1.6.2 beta (27-MAY-2020)
- 26-APR-2020: agaconv 0.9.5: open-source release
- 30-NOV-2019: agaconv 0.9.4: initial binary release