This tutorial will explain how to create really nice HAM6 and HAM8 videos with audio for playback on your real Amiga. Most Amiga's with a good hard drive can play back the HAM6 videos with no problem, but the HAM8 (Besides needing an AGA machine) really is helped along with a fast CPU and plenty of RAM.
These files are quite big in Amiga terms - It is easy for a 5 minute video to be hundreds of Megabytes. So you need a way to transfer from your PC to your Amiga. A Compact Flash card works fine for our machines that can use it. I personally use a USB flash drive and my RapidRoad USB adapter to move the files.
Transferring them over your home network is not to difficult with Amiga Explorer from Cloanto.
Lets make a list of what you need:
1. FFMPEG program - a free command line utility for Windows, MAC, Amiga and Linux that converts from one type of file to another. This is an incredibly powerful program. Fast hardware is recommended.
2. The HAM6 & HAM8 creation and playback software
3. An MP4 video file (Really almost any kind would do)
For this tutorial, I am using C:\video as the storage location of the video files, and Blorb.mp4 as the name of the video.
1. Download and install the FFMPEG program from here. I will assume you are installing it in C:\FFMPEG - This will be used to convert the .MP4 files to separated .AVI and .WAV files for the conversion.
2. Download and install the AVI4HV program from Here. It is used to convert the new .AVI and .WAV files to either 6 bit or 8 bit HAM files. This ZIP file also contains the playback programs to play these files on your Amiga.
3. Open a command prompt as an administrator (Right click on the CMD file in Windows, run as administrator)
4. type CD C:\ffmpeg\bin and hit enter (Takes you to the FFMPEG executable)
5. Type this command in. Better yet, copy and paste it into your Command Line and edit it to reflect your specific video file :
ffmpeg -i c:\video\blorb.mp4 -map 0:a -ar 11025 -sample_fmt u8 -ac 1 -acodec pcm_u8 c:\video\blorb_ham6.wav -map 0:v -r 15 -s 320x216 -vcodec rawvideo -pix_fmt rgb555le -vf "vflip" c:\video\blorb_ham6.avi
6. Once you hit enter it will process the file. It could take several minutes. So what is this doing?
a. "-ar 11025 -sample_fmt u8 -ac 1 -acodec pcm_u8" - This tells FFMPEG to extract the audio from the file, convert it to 8 bit .WAV format at 11025 Hz. You can change the frequency for better quality sound at the expense of speed and framerate.
b. v -r 15 -s 320x216 -vcodec rawvideo -pix_fmt rgb5551e -vf"vflip" - This extracts an AVI file from your MP4 file at 15 frames per second, 320x216 resolution and 15 bit color. vflip turns the image upside-down. For some reason, the AVI4HV software needs that and flips it back over for you later. I dunno why... You can change the FPS to a lower number for a smaller file size and faster playback I find 10-12 FPS still looks good. The resolution can also be reduced with some quality loss, but substantial performance increase.
7. You now should have an AVI and WAV file in your C:\video folder.
8. Type C:\AVI4HV to enter the directory we need to be in.
9 . Type AVI4HV.EXE C:\VIDEO\BLORB.AVI and hit enter
10. The program should ask if it is a 15 bit video file. Just follow the prompts.
11. It will ask for the .WAV file next. That should be C:\video\blorb.wav
12. Hit enter. It will ask for the output file. I like to use this template. C:\video\BLORB.hv6 so I can tell the difference between a HAM6 and HAM8 file. You will see the results on screen as it converts your files to a HAM6 file. When it is done, just copy the HAM6 file over to your Amiga and follow the instructions on this page.
HAM 8 Conversion: Same as above, but use this FFMPEG command.
ffmpeg -i c:\video\blorb.mp4 -map 0:a -ar 16000 -sample_fmt u8 -acodec pcm_u8 c:\video\blorb_HAM8.wav -map 0:v -r 12 -s 320x216 -vcodec rawvideo -pix_fmt bgr24 -vf "vflip" c:\blorb_HAM8.avi
This is using a slightly higher quality audio sample, but does not need to. It is a 24 bit format instead of 15 bit. I generally use a smaller frame rate to control the size and performance. You can change it, but really don't go above 15 FPS.
To be honest, the 6 bit videos are almost as good as the 8 bit and run a lot faster. Try both and see how it works.
There is a lot more that can be done with FFMPEG to increase the quality of the images somewhat. But I find that the file size goes from 300 MB+ to 800MB+ without a huge quality difference.
I have researched many GUI front ends for FFMPEG and none offer enough features to do what this somewhat simple command accomplishes.
Thanks for posting this guide.
ReplyDeleteI tried it for the first time yesterday and can get to the point of having the upside down Avi and the sound file.
When I run avi4hv.exe I get the prompts and a small, blank window appears and then closed after a few seconds and I get the output file. There are no error messages. However this is always 14k and I just get a blank screen when I try to run it in WinUAE or my real A1200. Please could you help with any reasons why?
Thank you.
Sorry, re-read my comment and it needs some clarification.
DeleteRunning avi4hv.exe on Windows 10 appears to work and whilst processing the files a blank window appears and then closes. This appears for varying lengths, the longer the video, the longer it appears.
The resulting Ham Video output file is always 14k and, when I try to play it on an Amiga (emulated or real) a blank, black screen is shown.
I've resolved the issue by using an older version (4.1) of FFMPEG for Windows 64. These instructions work brilliantly.
DeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
DeleteTo fix the problem with AVI4HV giving you a blank screen you have to remove the metadata from the final AVI video before processing.
ReplyDeleteSo for HAM6 conversion...
ffmpeg -i c:\video\blorb.mp4 -map 0:a -ar 11025 -sample_fmt u8 -ac 1 -acodec pcm_u8 c:\video\blorb_ham6.wav -map 0:v -map_metadata 0:s:0 -r 15 -s 320x216 -vcodec rawvideo -pix_fmt rgb555le -vf "vflip" c:\video\blorb_ham6.avi
So for HAM8 conversion...
ffmpeg -i c:\video\blorb.mp4 -map 0:a -ar 16000 -sample_fmt u8 -acodec pcm_u8 c:\video\blorb_HAM8.wav -map 0:v -map_metadata 0:s:0 -r 12 -s 336x240 -vcodec rawvideo -pix_fmt bgr24 -vf "vflip" c:\blorb_HAM8.avi
Happy processing...