Movie playback on Atari ST(E)

 
  Development reached stage when we can make overview of video modes available:

 But first little refreshing of memories :

 Hi-color here means more than 16 colors at once on screen. Based on fast palette change during video displaying, with special, synhronised code. First SW using it was Spectrum 512.  In meantime some newer SW is developed, on same base, but with more options, better quality, and SW for PC - what is important when we need to convert thousands of pictures for animations.

 Hi-color can have 4096 colors at once on STE, or even about 30K perceptual, if alternating 2 little different palettes between fields (2 fields make 1 frame by TV) .  But 4096 colors per screen means not that any pixel may have any of 4096 colors - we have maximum of colors per horizontal line - what is less than line pixel count, because palette change speed is limited. Color/line count goes usually from 48 to 80 (later only with CATA) . It is usually enough for pretty good quality.
Interesting is to compare it with 256 color, indexed mode - what may see on Falcon or TT (+VGA, etc) :
256 color, indexed mode means that any pixel can have any of 256 colors, defined in palette, what holds 256 different color nuances, usually defined with 18 bits - so from 256K colors (like 512 by ST).  In most of cases, 256 colors will look better than 4096. Why ? Because there is more nuance selectable in palette, and no special line color count limit.  RAM usage of 2 ways is pretty similar. And STE hi-color occupies CPU heavily during line displaying - CPU is free for other things only in top and bottom border periods.

After this rhetoric, let's see available modes developed by me, and supported by Photochrome and HigheSTcolor converters - still developed by Douglas Little and Cyg :

First param. is resolution Hor x Vert pixels, then frames per second, palettes - SP or DP (single or dual) and colors per line.
Data rate is with audio (what is only 25KB/sec in all cases)

Mode 1: 
320x158px, 12.5 fps, 48c/l.  SP.  Data rate:  519 KB/sec.
   Only this and mode 9 work on UltraSatan - if SD card is enough fast.
 
  Following modes are all for CATA, fast read:

Mode 2:
320x159px, 25 fps, 48c/l - standard PCS timing. SP. Data rate :  1013 KB/sec.
   Good compatibility with possible timing variations.
 
Mode 3:
320x199px, 25 fps, 48c/l - standard PCS timing. SP. Data rate :  1427 KB/sec.
   Good compatibility with possible timing variations.  Obsolete - will be not supported in standard CATA ROM.

Mode 4: 
320x198px, 25 fps, 80c/l . SP or DP. Data rate: SP: 1625 KB/sec . DP: 2450 KB/sec.
  Indeed best quality.

Mode 5: 
416x228px Overscan, 25 fps, 48c/l. DP (can SP too, but not recommended - gives not lower datarate).    Data rate:  2375 KB/sec.
  More res=more details. Ideal for less colorful stuff.

Mode 6: 
320x199px. 25 fps, 54c/l. SP or DP. Data rate SP:  1425 KB/sec. DP: 2050 KB/sec .
  Uses Cyg's  54c/l . Good for animated/cartoon.

Mode 7: 
320x198px. 50 fps. 48c/l. SP (of course) . Data rate: 2500 KB/sec .
  STE display is actually 50fps, progressive - so why not playing in it's native mode, if disk transfer is fast enough. And era of HFR is coming (High Frame Rate - Hobbit, Avatar 2) .  It is easy to convert usual TV, 25 fps interlaced to 50 fps progressive, lower vertical res - exactly good for our prehistoric STE !

Mode 8: 
320x240px, 25 fps, 48c/l.  DP . Data rate:  2088 KB/sec .
 Good for old-fashion 4:3 AR material.

Mode 9:  320x78px, 25 fps, 48c/l.  SP. Scanline grille - see screenshots lower. Data rate:  517 KB/sec.
   Only this and mode 1 work on UltraSatan - if SD card is enough fast.


For now, audio is always  mono, 25033 Hz, and 8-bit (that can not be other).
May go on stereo, 25033 Hz in some cases - will see it later.

After couple months spent with this, I must say that results are better than I ever thought. Proper error diffusion and 30K colors make it really good. And even 50 fps is possible with hi-color.  From now, I focus on finalising and polishing SW, publishung CATA design and ROM code. And: new internal IDE adapter for STE, ST machines, where same speed can be achieved - so same AV modes. For people may be interested:  CATA is designed with speed as main concern. It is not much compatible - max. potential can reach only on STE, with simple HW mod in machine. It can not work together with any other cartridge port adapter - only if attached alone. You need some newer, faster Compact Flash card for AV playback.  Because it works on port not designed for hard disks, it boots not in usual way - like ACSI hard disks (SCSI via ACSI/SCSI adapter, Satandisks). Driver installs via cartridge auto-run code of TOS. It executes before regular hard disk booting. In any case, CATA can work together with some ACSI attached disk - only need to take care about max. 14 logical drives limit.
Driver SW:  it is my 'regular' TOS/DOS compatible driver, with selectable boot partition  etc.  You can attach CF card simply to PC, MAC and transfer files via Total Commander or other file manager.


 

  Some may ask:  why this was not made around 1990, when Atari STE arrived on market ? As I know, AV playback on any home, PC computer was not possible in those years.  Here mean some quality playback (so 25fps, decent resolution) , of recorded content (by camera, from TV, or like). Even if now I managed it on 8Mhz STE, in 1990 some requirements missed.  In first place: hard disks were too slow for this, and capacity was low. Digital video processing was in very early stage, and people had no access to content, processing SW. And no quality video grabbers were available. For instance, around 1996 I bought not cheap Asus graph. card with grabbing (capturing) capability. It was limited on some 10 fps at 320x240, and colors were not much accurate.


  Of course, this is just demonstration of what is possible with good SW on prehistoric HW aided with modern storage. Watching movies with 16 or 4096 colors and low resolution  is not exactly what we want in 21st century. And compression is not an option - 8MHz CPU is simply not capable for decoding video of some bigger resolution at decent framerate. But we can achieve smooth motion of 25 frames/sec (PAL) with prepared frames, and just reading them in sequence into video RAM from hard disk with basic sync. and audio. It has price: need very fast hard disk (card) + adapter, and plenty of disk space.
 
  Hi-color AV playback on STE, equipped with UltraSatan:

 
25 fps, using old technique "scanline grille" :
p/tr1eg.jpg

 Because limited disk speed, showing only every second line - this allows 25 fps with UltraSatan !
And what is better example for this if not Tomb Raider clips - where I saw it first.  Original is 320x120px, 15fps. Converted to 320x80, 25fps, without speed change.
 DL player and 2 clips  62 MB .

Another PC game intro, converted from 15 to 25 fps, resolution is same as org.  BZintro  14MB avi .




 
Here is preliminary version of playback SW for UltraSatan and interesting demo video, from 1987:   USdemo   29MB.     Thanks to Atarimania for hosting this old video.
 Before copying files on your SD card, you need to defragment target partition. It must be one of first 2 partitions if you have 512MB large ones (AV file must be in first 1GB). For now, only ACSI target 0 is supported (default one). If you copied files on target partition in order, and did not delete, then it must be defragmented. Otherwise run some defrag. SW. It may take some time, but is useful overall. In case of TOS/DOS partition you may defrag on PC too. But Windows XP defragmenter is not really good for this - it will not defragment free space. Then whatever you copy on, will become fragmented. So, run Windows XP defragmenter after you copied large AV file on SD card.
You need fast SD card for this - min transfer rate is 1100 KB/sec.  Please run speed test in case of not knowing speed, and/or if playback is bad.  Speed t. 
You may try in emulators Steem or Hatari (the real thing is STE, of course) - then must use ACSI hard disk emulation (Hatari), Pasti in Steem, and using image file of hard disk. If this confuses you, search little around - was explained, discussed many times. May try with ST too - then will be no sound, and may look ugly at some places (less colors).  Tested with PP, AHDI, ICD, Hddriver .

 Updated player  3KB . Plays from any ACSI target, any location on Flash card, no 1GB limit, BigDOS support too.

 Capture of good playback   8MB

 When SD card is slow  700KB

 With classic hard disk 
700KB

 Same video, with overscan and CATA  8MB

 Anime  it is only 12 fps in many parts originally, so lower fps here is not big drawback. Many of older, hand-drawn animes are made with 12fps.

 Guide how to make STE hi-color AV by self

 Expected question:  I want to convert myself some video for STE . How to do it ?  Link to page with detailed description is right above. For beginning some hints:  you need SW capable of extracting audio and image sequence from usual sources like AVI, DVD, Mpeg, Mov, FLV etc. Virtual Dub is certainly one of the bests for that - and has lot of external filters avaialable - freeware. Then need SW for audio manipulation - like Audacity.  Need SW for converting standard format images (PNG, BMP) to Atari STE hi-color format - Photochrome  and/or Cyg hi-color converter. Both are currently under improvement. Some special SW for muxing images and audio to AV file - will be posted here. When you have completed AV file, just need to copy on your SD card and run playback SW.  Currently, I update Drive Image too, so can handle larger flash cards.  Stay tuned :-)    Technical background for interested   .

p/fragm1.png

 So looks map of fragmented partition in CHKDSK3 . With it you can defragment - called "Compress Disk" in CHKDSK3. By larger partitions it may take some time ..
Hint for fast defragment of SD card:  attach to PC with card reader. If it is TOS/DOS compatible, you may use Total Commander for instance. Then move all files, directories from partititon to some DIR on PC. After it, just copy files back to SD card. They will be defragmented.

  Hi-color playback with CATA:
I currently work on high-color movie playback for Atari STE - where can play AV of any length, even with only 512KB in machine. Only limit is storage capacity - and speed. By using Photochrome PCS images and displaying code. It allows up to 4096 colors on 1 screen. Or even 30000 (perceptual) if we alternate colors slightly for 1 frame (which shows 2x at 25fps and 50Hz display rate).
Significant quality improvement is achieved in last month - thanks to Douglas Little's updates of Photochrome,  doing better preprocessing of images + making 80 colors/line mode with CATA (thanks to Cyg for idea)..
I think that at moment (Nov. 20 2012) we reached aprox. maximum what is possible with STE machine. It stays for 320x200 resolution, 25 fps with 30K colors, using cartridge port IDE adapter and small mod in STE (to get enough load speed). Data rate is extremely high:  2.5 MB/sec. You need some faster CF card for it - my 4GB Kingston can not ensure stable work with it - there is many error during playback. Sandisk Ultra (30MB/sec) is OK .
The key for good looking video on STE:  proper preprocessing of video. To have nice gradients (like sky, human face and similar) we need to use dithering (called error diffusion too) during color reduction.
Photochrome current dev. version does error diffusion pretty good. But there are still some smaller errors sometimes. I looked for longer time SW capable for quality dithering/ED . For single palette (4096 c.) is best to use Photoshop and XiQuantizer plugin, Sierra 24a error diffusion during color reduction - because it produces stable pattern on static parts. Similar would be good by reduction to 30K colors (15bpp), but don't see SW capable. Instead , I used ImageMagick ordered-dither o8x8,32  (32 means color/channel, with 3 base colors it makes 32 pow 3 = 30K colors). Even better is to use Virtual Dub filter 'Error diffusion' - can set bit depth for each channel, etc. More about preprocessing and what SW to use - soon.

 Overscan playback:
 416x228px, 30K perceptual colors. But only 48 colors/line - no time for more. Still, looks pretty good, and bigger res. makes details better:

  Overscan  7.5MB. this really pushes STE to limits. Used overscan 416x228px, mostly based on Alien's article about overscan on ST(E), then last beta of Photochrome with support for custom width, superfast loading from cartridge port, where part of bitmap is loaded interleaved with color data, ahead - only way to achieve loading of some 50KB/frame, only for bitmap, + 50K for colors.

p/ovo.png

  I'm a leaf ..  14.5 MB.

  In space  7 MB.

  Test  700 KB.  6 sec clip. Src. from 1995. May be familiar for PC users from that period. It was actually first really good video I saw on PC.
  Comparing playback on PC and STE:  Needed PC with min 4MB RAM, faster 486, but recommended was Pentium (100MHz) and 8MB RAM. Mpeg1 packed demo of 5-6 sec is 700KB.
  STE: 8MHz, 512KB RAM enough. Need special hard disk adapter and small mod. File size is 15MB - price you must pay when no CPU power for depacking.
  Reminder: Mpeg1 was used by VCD - first commercial media/format for digital AV. Quality was little better than VHS, on 1CD could put max some 80 min. It was never much popular - couple years later        DVD came.

  I don't give demos now, runnable on emulators, because:  mode with alternating color data will not look well on usual monitors (which can not work at 50Hz). Files would be pretty long. Steem and Hatari show overscan, but not flawless - Steem cuts off 16-16px left and right, Hatari has error at right side. Not to mention additional time needed for doing them.


Following examples are all made with 80 colors/line, 320x200px, dual palette and mostly 
'ordered-dither o8x8,32' preprocessing. I can not give demos usable on emulators - 80 colors/line mode works not on them.
So, STE video/audios captured.

  How bad can I be  2m 51s , 20MB. Very colorful.

  Everybody..   Cartoon, improved. 4min, 29MB .

  Fly  2min . 15MB.

  p/afly.jpg


  Pelikan attack  1m 33s. 11MB. Compare it with older one, below.

  At skull  1m 9s. 8MB.

 
Wanted  2m. 15MB. Compare with 'Hard case' below.
 
  Promo  Promotional video of popular Atari ST game. Src. looks nothing better. 2m 47s. 20MB.



 Older txt. and conversions:

 However, it is very demanding considering data rate needed for fullscreen, 25 fps playback - about 1250 KB/sec is needed. Worse: hi-color displaying occupies CPU 100% during scanlines, so we have only about 35% (max) CPU time available for loading from disk. DMA transfers ? Not possible - DMA will destroy accurate timing of hi-color displaying. So, 1250 KB/sec in 1/3 time ? Far from possible with usual disk transfer speeds. Not to mention that FAT16 filesystem adds additional slowdowns.  Still, it is possible, but only with little reduced screen size and CATA IDE adapter + small mod in STE. With reducing line count to 160, what is btw, good for 16:9 AR sources, we will have more CPU time avail. (48%) and less data rate (1050KB/sec). With that datarate, about 1 hour of AV will fit on average 4GB CF card (3700MB).  I will not write here more details for now, because CATA is not yet available. Made some demos, how it looks, and you can try them with Steem or Hatari.

Hard case   Anim   Flying

How it looks on real STE: 
p/hicMovSTE.jpg
   DL AVI (7.5MB)

 
 With subtitles :  DL 2 min AVI  15MB

  TV recording converted  16MB

  Little more res:  p/bunny.jpg

    DL AVI (8MB)  This is 320x176 px. Absolute maximum with CATA and reading in black periods.. About 40% of time is available for loading, and 1125 KB/sec is needed. Possible only with very fast hard disk IF + fast disk or CF card - later is better.
p/supfast.png
  Measured with CATA on STE with mod on R/W line, 4GB Kingston CF card.
 

   Fullscreen playback:  
DL AVI (6.5MB)  Funny scene :-)   3 min cartoon (22MB AVI)
This is made by loading color data during scanlines, what requires accurate CPU timing + using little irregular disk access - because I can not use Read Multiple. Tested with 4GB Sandisk and Kingston cards, newer ones, which are pretty fast. On older ones will for sure not work. Disk space for this resolution is 80MB/min. About pic. quality:  don't expect miracles. We are very limited - 4096 colors is just not enough. As I see, day scenes in nature usually look very good. Dark scenes will never be good, right because low color count . Can make to look little better with more dithering, but it may be not good for some other scenes. Basically, best is to convert every scene with best settings for it. Cartoons usually look very good.


 We talk here about 4096 colors, but it is simplification - so much colors can be only on whole screen. Used techniques, which update palette during scanlines can achieve around 50 colors max per 1 hor. line. It may be serious problem by gradients for instance.

p/hand.png   org img.           p/handMPP.png  with 54 colors/line (MPP)           p/handEd.png  with 48 colors/line + error diffusion

Even with less colors/line, error diffusion makes it much better. Human eye is more sensitive for color differences in small areas, than on accurate colors self.









  16 color playback:

  After couple years from first videos and playing SW I did some major changes, improvements:  changed structure of interleaved LAV (limited audio/video) files. With old format playback was not smooth from hard disk partitions bigger than 128MB, because of AHDI large sectors. New format will play well even from 1GB partitions with sector sizes of 16KB (Falcon). Made new player SW, what works with less CPU load, dropped not really necessary seeking options - there is only abort key. And it works well on Falcon now.

SerForGif.gif 

  All files are with audio, but audio works only on STE & Falcon (TT ?) machines.

Trailer for well known game  14MB.
The complete gameplay 5MB RAR, LAV is about 100MB, but well packable.


    New playback program

  lavp2.png  lavp2w.png


 Keys during playback:     Right Shift - abort play & select other LAV or exit   Left Shift - deinterlace

 
To have smooth playback without slowdowns, audio repeating and desync  fast hard disk/Flash card and adapter are necessary. Playback program has speed (transfer rate) measuring. Select some file with size of min. 5MB (best some LAV file, of course) for test. It will display after few secs transfer rate in KB/sec. About 1000 KB/sec is usually good enough. So, no Satandisk, but UltraSatan may be OK, however speed depends from used SD card too.  IDE should be about 1200 KB/sec with any decent driver and CF card or drive. Of course when no byte-swap (then may using twisted cable and special driver).  5785 KB/sec is speed in Steem, with emulated ACSI hard disk, just to mention (on real ST not possible). Other requirement is 50 Hz video refresh rate, so PAL only. Falcon not with VGA, but RGB monitor or TV, set to PAL mode.

Guide for creating LAV files, with SW, examples




PP  Jan  2007 - Jan. 2013 .



Send mail with suggestions, questions, critic etc. to site maintainer: Before it enter name of animal on small picture:
qani


Menu Properties Quick Reference

hcnt: 32791