Amiga.org

Amiga computer related discussion => Amiga Desktop Audio and Video => Topic started by: atron on December 03, 2016, 04:12:54 PM

Title: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: atron on December 03, 2016, 04:12:54 PM
Hi guys, in recent months I got back into actually doing something with my Amiga again. First, I ripped out this old green battery and after I had assembled the whole thing again, I got into a conversation with a friend about the capabilities of the Amiga. So I came up with the idea having the Amiga show a video of about 3-4 mins on an HD flat screen in exactly the same way as a PC does in full screen mode (in 16:9 format); in principle, that should be possible (I guessed :)

Looking around on youtube I found some converted videos playing on an Amiga, but all with lots of conversion artifacts, or just very short.

My goal became to create a HAM8 video where each frame has its own color palette and a *very* small (if at all) number of artifacts. Finally I found one tool, released in 2015, that gives excellent HAM8 results whereas other tools have some disadvantages:
* ppmtoilbm: generates a fixed grey palette. The result is to get several conversion artefacts.
* avi4hv doesn't generate separate palettes either. The player is well done (and fast), but the converted frames have lots of artifacts (didn't try avi4aga yet, but I guess it doesn't create different color palettes either?).

The best HAM8 converter I found is png2ilbm. It was released 2014/15 and generates really good HAM8 pictures: http://bgafc.t-hosting.hu/prgv.php?p=2

Players: cyberanim cannot play anim videos with different color palettes. I used viewtek to play the video.

My procedure was to decode it with ffmpeg into separate frames (=files), convert each frame to HAM8, and use the Amiga tool animconvert to put it into one anim file again.

Finally, I came up with a 3min video playing at 25 FPS (320x251) with a very small number of artifacts. Even text (black on an almost white wall) displays well in the presence of other colors.

The final video (with added original music) can be seen here:
[youtube]WwWEtXd_vDo[/youtube]

PS: I havent't tried AnimFX and Wavetracer yet (just learned about them some days ago). I'd be interested if anybody knows if they generate separate color palettes and what the HAM8 quality is (in comparison to the original video).
Title: Re: Having fun with HAM8 videos
Post by: skolman on December 04, 2016, 06:07:40 AM
https://youtu.be/NdFdmW4UFp0
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: kolla on December 04, 2016, 11:38:26 PM
Pretty cool, is the ham8 anim available somewhere? Would like to see how it appears on my various systems :)
Title: Re: Having fun with HAM8 videos
Post by: chris on December 05, 2016, 12:02:42 AM
Presumably it is "easy" to convert from what you have to a full CDXL file with audio?  You might have to lose some resolution though, I think CDXL only supports up to 3/4 screen resolution (although that may well have been a limit to what the hardware could play back, rather than the format).
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: atron on December 05, 2016, 05:21:35 AM
Quote from: kolla;817310
Pretty cool, is the ham8 anim available somewhere? Would like to see how it appears on my various systems :)

I am not distributing this anim file because it contains copyrighted content.
However, I can convert an other video if you send me a link.
Title: Re: Having fun with HAM8 videos
Post by: atron on December 05, 2016, 06:09:31 AM
Quote from: chris;817312
Presumably it is "easy" to convert from what you have to a full CDXL file with audio?  You might have to lose some resolution though, I think CDXL only supports up to 3/4 screen resolution (although that may well have been a limit to what the hardware could play back, rather than the format).

Yes CDXL looks interesting, but I couldn't find any player nor converter  for it. My main interest then became to use this new HAM8 converter  (png2ilbm, released in 2015) as it produces excellent HAM8 conversion  results. If the HAM8 conversion of a CDXL converter is of similar  quality and it also adds sound, then that would of course be awesome  (however, playing sound also requires some resources, etc.)
Title: Re: Having fun with HAM8 videos
Post by: vince_6 on December 05, 2016, 10:18:30 AM
Here are two of mine with sound:

https://www.youtube.com/watch?v=AOjgvLiEaEU

https://www.youtube.com/watch?v=fJnwSStRQjs

Real Amiga hardware.
Title: Re: Having fun with HAM8 videos
Post by: atron on December 05, 2016, 03:46:01 PM
Quote from: vince_6;817333
Here are two of mine with sound:
https://www.youtube.com/watch?v=fJnwSStRQjs
Real Amiga hardware.

I like this one, looks quite convenient with mainactor. It's also similar to what I did by loading it into memory. But why are the colors so different compared to the original video? Is this mainactor's HAM8 conversion or some other conversion effect?

What I mean is:
Original video at 3:05 : https://youtu.be/xyfu8pv5nws?t=3m5s
Your video at 1:46 : https://youtu.be/fJnwSStRQjs?t=1m46s
(the links should take you directly to the right frames)

In the original video Scrat's space suit is grey and his head is brown, but in your video Scrat's space suit is brown-ish and his head is blue!

So the sound file is loaded as a separate file? In principle I could do the same then, just need to play it with mainactor and figure out how to create this sound file format! Is it playing the iffs from memory, but the aiff sound file from disk?
Title: Re: Having fun with HAM8 videos
Post by: chris on December 05, 2016, 04:59:48 PM
Quote from: atron;817324
Yes CDXL looks interesting, but I couldn't find any player nor converter  for it. My main interest then became to use this new HAM8 converter  (png2ilbm, released in 2015) as it produces excellent HAM8 conversion  results. If the HAM8 conversion of a CDXL converter is of similar  quality and it also adds sound, then that would of course be awesome  (however, playing sound also requires some resources, etc.)


There are a few players.  Multiview is one, have a look on Aminet for others (looks like there's an improved CDXL Datatype on there too, which supports the palette-per-frame you will need).

As for creating them... the only tools I know of are the old Commodore ones (I've never used them).  I'll have a quick nose around the DevCD tonight and see what they do!
Title: Re: Having fun with HAM8 videos
Post by: vince_6 on December 05, 2016, 05:28:59 PM
There is an option to playback from hdd but can't really remember for sound.
As for the colors don't know what happened, probably it is the crappy usb composite capture card.
Same happened to amimastergear video and I did some color retouch before uploading cause looked kinda dull.
Title: Re: Having fun with HAM8 videos
Post by: chris on December 05, 2016, 06:22:08 PM
Quote from: chris;817350
As for creating them... the only tools I know of are the old Commodore ones (I've never used them).  I'll have a quick nose around the DevCD tonight and see what they do!


Right.. the XL Toolkit 1.10 is on the DevCD.  There's an AdPro loader/saver for CDXL.  It also contains a load of command line tools and limited documentation on how to use them, but running with no arguments gives a bit of info.
XLMake looks like it quite simply takes a batch of IFF files and compiles them into a CDXL. It has an audio option but I don't really understand it.
XLAudio inserts audio into an existing CDXL, I think it needs to be an IFF file again, I'm guessing 8SVX.
I didn't try them out but if they don't object to your frames they should just work!

There appears to be a legally dubious archive of the XL Toolkit on http://cd32-allianz.de/ under Entwickler - Einf├╝hrung.
Title: Re: Having fun with HAM8 videos
Post by: psxphill on December 05, 2016, 07:34:09 PM
Quote from: chris;817312
You might have to lose some resolution though, I think CDXL only supports up to 3/4 screen resolution (although that may well have been a limit to what the hardware could play back, rather than the format).

I believe the limitations are due to the CDTV (and later CD32) drives.

https://wiki.multimedia.cx/index.php?title=CDXL#File_format

This player should give enough information about what needs to be written.

http://aminet.net/package/gfx/show/cdxl_player

Audio needs to be 11025/8bits.
Video can be ham8, but you can only use 12 bit palette entries. It's still better than ham6 as you have 256 starting colours with 4 bits per channel and each pixel you can change 6 bits per channel. However it's not as good as real ham8.
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: magnetic on December 06, 2016, 02:29:34 AM
really cool bro!
Title: Re: Having fun with HAM8 videos
Post by: atron on December 09, 2016, 05:37:23 AM
Quote from: chris;817355

XLMake looks like it quite simply takes a batch of IFF files and compiles them into a CDXL. It has an audio option but I don't really understand it.


That's a nice website. convert2cdxl looks like the most convenient way of converting to CDXL. It converts it to videos with only 12 frames/s (hopefully there is a way to tweak this ;).
Title: Re: Having fun with HAM8 videos
Post by: NovaCoder on December 09, 2016, 06:09:36 AM
This is about the best I could do on real hardware with sound using MooVid

[youtube]PeGbGRJLxwE[/youtube]
Title: Re: Having fun with HAM8 videos
Post by: atron on December 09, 2016, 09:48:44 AM
Quote from: NovaCoder;817487
This is about the best I could do on real hardware with sound using MooVid


Looks nice. So this is running @80Mhz on your system? Is this playing from disk or memory?
Title: Re: Having fun with HAM8 videos
Post by: NovaCoder on December 10, 2016, 11:39:30 AM
Quote from: atron;817493
Looks nice. So this is running @80Mhz on your system? Is this playing from disk or memory?

Thanks, I did try a few different movies and got very different results....could never get it quite 'perfect' though

Yes this was using an 80Mhz 1260 Blizzard.   Not sure if this video was streaming from memory or disk, can't remember now.
Title: Re: Having fun with HAM8 videos
Post by: magnetic on December 10, 2016, 01:33:07 PM
Quote from: atron;817486
That's a nice website. convert2cdxl looks like the most convenient way of converting to CDXL. It converts it to videos with only 12 frames/s (hopefully there is a way to tweak this ;).


hmm could a CDTV disk be created that would play a movie from cd rom?
Title: Re: Having fun with HAM8 videos
Post by: skolman on February 20, 2017, 10:36:06 PM
New Amiga 1200 HAM8 video player
https://youtu.be/zuKQncH32sE
Title: Re: Having fun with HAM8 videos
Post by: NovaCoder on February 20, 2017, 10:55:00 PM
Quote from: skolman;822512
New Amiga 1200 HAM8 video player
https://youtu.be/zuKQncH32sE


Looks a bit too good to be true..
Title: Re: Having fun with HAM8 videos
Post by: paul1981 on February 21, 2017, 01:57:50 AM
Quote from: NovaCoder;822513
Looks a bit too good to be true..


I hope it is true, as the HAM6/HAM8 player from the AVI4HV converter package was shocking last time I checked (in 2012) due to NO BUFFERING of video! Talk about hard drive head killer - this thing was worse than a 10 year old installation of Windows XP.
I did make a video of my own and so had a bit of fun with it anyway. I even play it from time to time. :)
Title: Re: Having fun with HAM8 videos
Post by: saimon69 on February 22, 2017, 02:07:27 AM
Isn'it time to expand the CDXL format to do some more advanced stuff then? I know Amiga do this stuff, me and a friend of mine used to participate in animation competition with 12FPS videos in Anim7 but those are BIG and disk-grinding; for a more widespread use some optimization is needed IMO...
Title: Having fun with HAM8 videos
Post by: SamuraiCrow on February 22, 2017, 12:36:11 PM
I believe CDXL is not an openly documented format but there's still some room for improvement.  What do you have in mind?
Title: Re: Having fun with HAM8 videos
Post by: skolman on February 23, 2017, 07:54:37 PM
Quote from: NovaCoder;822513
Looks a bit too good to be true..


Unfortunately, the standard disk controller (PIO-0) is too slow. This HAM8 video file has over 600MB. https://youtu.be/nnJw-jaSUGs
Title: Re: Having fun with HAM8 videos
Post by: atron on February 24, 2017, 11:57:03 AM
Quote from: skolman;822512
New Amiga 1200 HAM8 video player
https://youtu.be/zuKQncH32sE

Awesome!!! I got it working in fs-uae in A1200 mode.

Good to see that the playing of videos is now picking up (again) for classic Amigas! Let's keep the chipset melting :)

PS:  I couldn't get it working on my A4000, there appears to be something  A1200 specific hiding in it ... A3000 mode in fs-uae plays the sound,  but not the video. It does work in A1200 mode.
Title: Re: Having fun with HAM8 videos
Post by: SamuraiCrow on March 09, 2017, 01:47:29 PM
Quote from: SamuraiCrow;822567
I believe CDXL is not an openly documented format but there's still some room for improvement.  What do you have in mind?
I found that there is a CDXL player with source on the Aminet at http://aminet.net/package/gfx/show/cdxl_player for OS 3 with graphics card or MorphOS and http://aminet.net/package/gfx/show/cdxlplay for OS 4 with heavier graphics card.  For AROS there's an SDL version at http://aminet.net/package/gfx/show/cdxlplay-sdl .

Apparently the cat is out of the bag after all!
Title: Re: Having fun with HAM8 videos
Post by: atron on April 25, 2017, 09:31:51 AM
Hi guys, finally I got some more tools working, wrote my own sound converter and "chunk shuffler" and can now get AnimFX running with sound and proper play rate. Here is a video with 5 HAM variants (HAM6/HAM8 with one shared palette and multiple palettes) and for dreamers a hires version. I can run V1-V4 on my Amiga, V5 is (as expected) too slow on my Amiga - but it is fast enough in FS-UAE ... which made me wonder a bit ...

https://www.youtube.com/watch?v=QQg7CcgQqOU

CDXL works too @ 25 FPS in lores for V1 without blit option (but  flicker) (in PIO-4 setting), and it  does appear to be fast enough - unfortunately I never got the CDXL  player working with multiple color palettes in HAM mode.

Next I may look at my CD32 or Picasso IV with MPEG (RIVA player is much better in skipping frames while still keeping the music playing properly) or I start writing my own HAM player .. :)
Title: Re: Having fun with HAM8 videos
Post by: kolla on April 25, 2017, 03:47:40 PM
Very cool.

Just for the heck of it, did you try PAL Hires Laced?
Title: Re: Having fun with HAM8 videos
Post by: gregthecanuck on April 26, 2017, 02:52:11 AM
THIS IS WHAT THE AMIGA IS ABOUT. Hacking around and pushing the boundaries on what can be done. Nice work and keep on hacking! :)
Title: Re: Having fun with HAM8 videos
Post by: atron on April 26, 2017, 05:41:30 AM
Quote from: kolla;824953
Very cool.
Just for the heck of it, did you try PAL Hires Laced?

No, because the full video wouldn't fit into memory :) But the short  one would fit, yeah worth a try. I still remember these laced modes on  my 1081 monitor .. that's why I probably avoided it also in lores ;)
Title: Re: Having fun with HAM8 videos
Post by: kolla on April 26, 2017, 05:48:58 PM
Interlaced is much better for video than for anything else ;)
Title: Re: Having fun with HAM8 videos
Post by: atron on June 23, 2017, 06:11:07 AM
Quote from: atron;824952
Here is a video with 5 HAM variants (HAM6/HAM8 with one shared palette and multiple palettes) and for dreamers a hires version.
https://www.youtube.com/watch?v=QQg7CcgQqOU

HI Guys,  I just found out that one of the tools that I used for converting the  pictures, png2ilbm, doesn't support HAM and the generated frames in  versions V3-V5 in this video are actually "only" AGA8 frames! Hence,  there might be even more possible (png2ilbm does an awesome job in  converting to AGA though). Versions V1 and V2 are indeed HAM videos.
Title: Re: Having fun with HAM8 videos
Post by: atron on August 05, 2017, 10:38:08 AM
And here is now a HAM8 video with color count ...

https://www.youtube.com/watch?v=nR3VC7QodFM (https://www.youtube.com/watch?v=nR3VC7QodFM)

[youtube]nR3VC7QodFM[/youtube]

The video description also contains sizes&color counts of downscaled variants of the same video as well. AGA8 doesn't look much different, anyways, the fun-part was the HAM8 decoder to compute the color count ;)
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Dynamic_Computing on August 28, 2018, 10:07:19 PM
Hmmmm... I watched the original Youtube video, and I declare shenanigans. I have been creating and testing HAM6 and HAM8 videos for weeks now. The results are incredible considering they are playing back on Amiga's - but they don't look even similar to the originally posted video. Of course they have fringing! HAM8 does! And video playback at the 700 something by 400 something at 25 FPS is not going to happen on an unexpanded A1200. I can get reasonable results at 320x216 on an '040 or at 288x188 on slower machines.
You can actually download some of my real samples at www.10marc.com (http://www.10marc.com) - 100% guaranteed to be free from shenanigans and playable on your Amiga!
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Karlos on August 28, 2018, 10:40:52 PM
I'm not convinced it is legitimate but it depends on the resolution. At 320*256@25fps would need around 2MB/s sustained write to chip ram. The footage looked rather higher resolution than this.
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Dynamic_Computing on August 29, 2018, 06:00:09 AM
I totally agree that HAM8 videos will playback on a reasonably powerful Amiga. Even 25 FPS is possible. But that original video was not on an unexpanded A1200 for sure. There was not even one single artifact that I could see from a HAM8 video. (Atron's original video seems to not be working - I was looking at the post below his original)

Just to be clear, the videos from Atron appear to be legitimate. I am looking forward to trying out the software that he is recommending to create the videos in 256 color AGA mode. If it works well I will certainly put some of those up on my website www.10marc.com
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Hans_ on August 30, 2018, 12:23:49 AM
I'm not convinced it is legitimate but it depends on the resolution. At 320*256@25fps would need around 2MB/s sustained write to chip ram. The footage looked rather higher resolution than this.
The video says it's 640x180 so the bandwidth is similar to 320x256@25fps. However, he played it on FS-UAE, and I doubt that it's emulating the chip RAM bandwidth limitations too.

I totally agree that HAM8 videos will playback on a reasonably powerful Amiga. Even 25 FPS is possible. But that original video was not on an unexpanded A1200 for sure. There was not even one single artifact that I could see from a HAM8 video. I have no idea why the original author of the post would be interested in lying about it.
The description of his last video says playback is in FS-UAE, so it's emulated hardware. From memory, HAM8 artifacts can be avoided/minimised via intelligent use of dithering. I can't remember what tools generated the highest quality HAM8 images, though. Added to that, it's clear that each anim frame has its own base colour palette; just look at the mouse pointer flashing different colours in the bottom right. That means that the colours of each frame have been optimized for that frame.

It would be nice if we could play the anim itself on our own hardware.

Hans
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Dynamic_Computing on August 30, 2018, 07:03:38 AM
 I need to clarify my post. Atrons videos seem legit. The YouTube video Skolmon linked to is bunk. The one that claims to be playing on an unexpanded A1200.
There are incredible things that can be done with these HAM8 videos for sure. I am looking forward to trying done of the utilities in this thread to improve my videos
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Dynamic_Computing on August 31, 2018, 05:36:10 AM
I did another HAM6 conversion tonight with DAMAGE_X's avi4hv and avi4aga tools - And I think they turned out well. I put up a Youtube Video of the HAM8 version playing back on my A4000D with a Warp Engine and nice SCSI drives. I find the AGA at 320x216 videos are too much for the onboard IDE of the A600, A1200 and A4000, but HAM6 at 288x188 plays nice, and the HAM8 plays OK at that resolution.

The actual playback on my machine is herehttps://youtu.be/VWkmV5R-Km8 (https://youtu.be/VWkmV5R-Km8) - and the actual files (both HAM6 and HAM8) are in LHA format on my website here https://www.10marc.com/p/fun-ham6-and-ham8.html (https://www.10marc.com/p/fun-ham6-and-ham8.html)

The players are linked there, too. All of my videos play back great in UAE, and they will play great on an expanded Amiga, too. They are stored on my Google Drive, so iBrowse on the Amiga can't download them. Download them in a modern browser.
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Hans_ on August 31, 2018, 09:53:10 AM
@Dynamic_Computing

Nicely done. Looks like atron has better tools for the conversion, because your video has definite HAM artifacting along the left edge. That's avi4hc/avi4aga's fault, unless you're cropping the HAM8 images that they produce. A better HAM6/8 encoder wouldn't generate those.

I wonder if it would be possible to come up with a better compression scheme for HAM6/8 to make streaming them from disk less taxing. There might be a way of doing motion compensation to reduce the size further beyond the basic compression CDXL and anim formats used. I'm too busy with AmigaOS 4.x graphics to try that out myself, though.

Hans
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Dynamic_Computing on August 31, 2018, 02:59:36 PM
@Dynamic_Computing

Nicely done. Looks like atron has better tools for the conversion, because your video has definite HAM artifacting along the left edge. That's avi4hc/avi4aga's fault, unless you're cropping the HAM8 images that they produce. A better HAM6/8 encoder wouldn't generate those.

I wonder if it would be possible to come up with a better compression scheme for HAM6/8 to make streaming them from disk less taxing. There might be a way of doing motion compensation to reduce the size further beyond the basic compression CDXL and anim formats used. I'm too busy with AmigaOS 4.x graphics to try that out myself, though.

Hans

Taking a look at the tools Atron used, it appeared that he captured each individual frame and then re-assembled them on the Amiga - wow. That must have been a lot of work. I can't find the pngtoilbm tool anymore, but I only searched for it briefly. I will look more for it tonight and see if I can use it to improve my videos.
I have done some higher quality versions using different filtering on FFMPEG and different ways to extract AVI files from MP4 files, but the file sizes get so huge they are almost unusable. I am trying to strike a balance between quality and size.
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Karlos on September 01, 2018, 10:41:45 AM
I wonder if it would be possible to come up with a better compression scheme for HAM6/8 to make streaming them from disk less taxing. There might be a way of doing motion compensation to reduce the size

So I once thought about this back in the day when I had the blizzardppc but not the Bvision to go with it. The biggest problem is that you can't readily do simple change application to HAM frames as they just get messed up for all the classic reasons. With modern hardware however it ought to be possible to develop an encoder that can perform HAM simulation from RGB and generate differential frames within some sort of error limit. If playback is all we care about, it might not matter if we need a core i7 to do the encoding.
Title: Re: Having fun with HAM8 videos @ 25 FPS for 3+ minutes
Post by: Hans_ on September 03, 2018, 02:57:19 AM
I wonder if it would be possible to come up with a better compression scheme for HAM6/8 to make streaming them from disk less taxing. There might be a way of doing motion compensation to reduce the size

So I once thought about this back in the day when I had the blizzardppc but not the Bvision to go with it. The biggest problem is that you can't readily do simple change application to HAM frames as they just get messed up for all the classic reasons. With modern hardware however it ought to be possible to develop an encoder that can perform HAM simulation from RGB and generate differential frames within some sort of error limit. If playback is all we care about, it might not matter if we need a core i7 to do the encoding.
Hehe, so you also thought about it until you had newer hardware. I wanted to create a more capable HAM8 video player when I still had my A1200. Back then I lacked the expertise needed to pull it off. Now I could probably figure it out, but am too busy with other stuff.

Your idea of doing HAM simulation from RGB is interesting. That should allow you to do lossy compression, trading image quality for smaller file size.  I was thinking of a simpler method where you'd search for blitter ops that reduce the compressed size of the residual image. Preferably with a method that the AGA blitter units could handle (assuming they're fast enough to handle it).

Hans