Misadventures in the Movies.
A CiH tells of his recent movie conversion experiences for the Atari Falcon.
Looking back at the late lamented 'Low Res' webzine, one article which has provided continued interest and inspiration is Beetle's description of how to encode video for playback on the Falcon. This featured in issue three, inspiring an add-on for converting Youtube material for the Falcon from myself for issue four. It has been the driving force behind a number of movie encoding misadventures on my part since then.
So for this issue of Mag! I'll take some time to write a bit more about them.
Wiring for sound on MPlayer!
We firstly look at bringing Guilliame Tello's excellent multi-format movie player, MPlayer into use for playing back some of these converted movies on the Falcon. Beetle's original method was distinctly Aniplayer focused, especially with his suggestions for converting the audio to a native Falcon 030 playback frequency, Whilst this was fine with Aniplayer, loading the same movie into MPlayer came up with video playback (hurray!) but unsupported audio and therefore silent movie heaven.
I could have tried a few experiments of my own to bridge the gap, but as I was feeling lazy at that point a quick question on an internet forum to the author told me all I needed to know! Thanks Guilliame!
As it happened, I was already on the right lines with the Cinepak codec for the visuals. For the sound, an uncompressed format would be fine such as Microsoft ADPCM. The following further suggestions made sense.
It was recommended not to use 16 bits sounds as they would be reduced to 8 bit for the DMA sound system. These are loaded in but more work is needed to convert these down. Mono or stereo samples were okay, the latter taking more space of course. The most important thing to remember was that the frequencies had to be the standard PeeCee ones such as 11 kHz, 22 kHz or 44 kHz as there wasn't provision in MPlayer for native Atari frequencies. I tend to settle at 22 kHz and 8 bit for the best compromise between file size and playback quality. There is more background noise on these samples, but this is tolerable, and more importantly, a movie converted this way now also plays back fully on MPlayer.
These movies will still be compatible with Aniplayer. The only difference is that the resampling option will need to be selected now where it wasn't needed before.
I also found that MPlayer seems to allow better playback performance on lower powered hardware than my CT60. MPlayer converted movies in the region of a 320 x 240 screen size will play back decently on my Centurbo 2 Falcon. When you get performance issues with a lower end system generally, MPlayer will skip frames, or large sections of a movie, so you get a choppier playback rather than a slowdown on everything, including the audio.
I also found that the speed of the media a movie was played back from had a marked effect. A movie that played back at say 95 percent or better movie frames displayed from the CT2's IDE internal hard drive, went down to the region of 70 percent off my slower Adtron CF-card SCSI device, and it was even worse spooling off my very slow double speed SCSI CD-ROM.
With screen size reduced to something like 240 x 160 and the maximum data transfer per second reduced accordingly, a completely unexpanded Falcon should be able to cope too. Interestingly, according to Wikithingy, the original target architecture for the Cinepak Codec was successful movie playback at 320 x 240 resolution from a 25 MHz 68030 stuffed into a 1991 model Apple Mac. So we're not so far off it seems.
Another point to note, for those of you not equipped with FastRAM, MPlayer pre-loads the audio into memory before playback of the whole movie starts. This may well severely limit the overall size of movie you can play from a 4MB Falcy due to this strict upper size limit on the soundtrack. Or else limit you to audio quality of 11 kHz at 8 bits mono, which could sound grotty,
Although this is a brilliant method for expanding your options with movie playback on the Falcon, there are occasions when an Aniplayer targeted movie, done in the original manner specified by Beetle, is still the best quality option. I'll explain this later on in the article
Movies for Atari Falcon converted from your Mac with MPEG Streamclip!
Then there was the search for another method of converting mainstream .MP4 and .FLV clips to an Aniplayer and MPlayer friendly format. Beetle pointed us in a great direction with his original research into and use of 'VirtualDub', probably one of the freeware jewels in the crown for PeeCees. In my case, this involved transporting material between two computers (Mac desktop and Windowse laptop) for the end result. Maybe it was time to look for something that might be able to do the job without the extra transportation?
Note:- Mac for initial downloading and end product testing on Aranym, the PeeCee is used for the conversion process.
As well as requiring two computers on my part, the method for getting a finished conversion from VirtualDub also involved two separate conversion processes to get the end product. Could we reduce the hassle factor there too?
After a bit of fruitless searching around, under the category of 'Apple Mac' and 'freeware', I found something that I'd previously downloaded and kept, almost without realising it. Here was another potential way of converting otherwise indigestible movie footage to a suitable Aniplayer or MPlayer replayable format.
We now turn to something called 'MPEG Streamclip'. This is freeware and it is available at http://www.squared5.com/ - It features both Mac and PeeCee downloads and still appears to be intermittently supported, currently at v1.9.3b8 since last year. The original half-baked plan on my part was to convert .MP4 movies to something the VirtualDub software on the PeeCee could get to grips with, but I subsequently found it could be much more useful than that.
It can import multiple file types, most usefully .MP4 including those ones made by my own hands and iMovie and my current Samsung mobycam footage. With Perian installed, it can also import .FLV video as well.
The Mac version, which we are referring to for the rest of this article, is intended to offer easy movie conversion to a number of Apple friendly formats and devices, such as iPad, iPod and Apple TV, as well as other computers. The existence of a 'legacy' codec here such as Cinepak seems to be a fortunate accident, but it is very helpful for our purpose.
Using it is straightforward enough, the options can be navigated easily and there is a manual with it, most of which you won't need. Most importantly, it produces an output that can be played back on both real and emulated Atari Falcons.
I'd consider this as a system which is complementary to the VirtualDub program described so well by Beetle all that time ago in Low Res. I wouldn't quite recommend it as a complete replacement, or write off VirtualDub just yet. There are advantages and caveats to using MPEG Streamclip.
Most impressively, comparing with VirtualDub, using Streamclip is a one-stop process. An intermediate state is simply not needed as you go from original format to finished conversion in one place.
The starting point, once your target movie is loaded, is the 'export to' selection on the file menu. For this case, you will choose to export to .AVI.
This brings up the exporter menu, where you will be able to select 'Apple Cinepak', adjust the quality slider bar to your taste (100% is fine!) then choose whether or not to limit the data rate. I'd be guided by Beetle's original suggestion of around 300-350 Kilobytes per second for a movie of around 320 x 180 at 30 frames per second. Of course you can play with that, according to quality and size tradeoffs. Then you can select the frame rate, otherwise it will output as 'best available'. Beetle's original article strongly recommended not exceeding the original frame rate. For a very high frame rate, halving it, from say 60 to 30 frames per second would be helpful.
You can check the stream information for all the information about the original file, Codecs in use, stream rate etc, before attempting conversion.
Sound can be selected, and gives you a lesser choice than VirtualDub. Define as uncompressed, mono or stereo and 44.1 kHz for dual MPlayer and Aniplayer compatibility or a selection of 16, 24, 32, or 48 kHz for Aniplayer only. All of the above are 16-bit only. There is another export option for 'other formats', which seems to allow you a back way into .AVI exporting, apparently offering more ways to tweak the sound, but this does not carry over into your exported movie and you just get silence? (This support may have been broken from an earlier version?)
A range of video resolutions, or the chance to user define under the category 'other' is present, so you would enter a resolution for the intended target device, typically a variation on 320 x 200 or thereabouts assuming a fast Falcon. The lowest pre-packaged resolution is 176 x 144 pixels, so it looks like this is easy enough to downsize output to play back on an unexpanded Falcon too.
There is adjustments sub-menu to tweak the brightness, contrast and audio volume. Again, experiment to get the most comfortable settings for you.
It is possible to edit to cut and select the piece of video you want to export from a larger unified recording. There are other settings such as frame blending, interlaced scaling and enhanced downscaling. You can play with these, or leave to one side.
Rendering times are reasonable, a four minute movie taking roughly around that long to save out. (There isn't an estimated time to completion displaying whilst it is doing this, unlike for VirtualDub.)
The limitations are really encountered with the audio. An uncompressed audio option is offered, allowing you to play back. As mentioned beforehand, most of the detailed options for audio do not seem to be working. For audio to be heard through MPlayer, only 44.1 KhZ (16 bit, mono or stereo) is selectable. This will add to the data overhead if this is important to you. Sound plays back fine on MPlayer, but an annoying constant background clicking can be heard when resampling is selected on Aniplayer. If you knock the resampling off, the clicking goes away, but there is a slight tendency for munchkin voices to be heard where there is dialogue instead.
Conversely, it is possible to output a movie at 16, 24, 32 or 48 KhZ audio and the clicking disappears, but so does MPlayer compatibility. This of course is not a big deal if you are solely using Aniplayer as your movie watching tool of choice.
With MPEG Streamclip, their implementation of Cinepak is generally good, but high levels of artifacting can occur in places. Careful experimentation may be needed to get the best result for a given piece of movie footage.
For my 'test footage', I used the Samsung supplied 'Wonders of Nature' video which they bundled with my new phone. The original was an 800 x 480 .MP4 clip. The results from that were generally very good, seemingly a bit more vibrant than equivalent output from my VirtualDub settings, but where there was a lot of shadow, the artifacting became painfully obvious. I played around with it and managed to get this reduced satisfactorily. Frame rate and data rate per second are worth paying attention to.
The CPU percentage used for playback on 'original' 060 hardware, from Aniplayer is roughly equivalent to a converted movie from VirtualDub for the CT60, so there seems to be no issues there. I also found with a trial movie converted on both aforementioned applications, there is very little difference in the file size for the output between Streamclip and VirtualDub. The only factor having an effect being the size of the audio.
The movies made here transfer across well to my Centurbo 2 (CT2) system as well. The speed of the storage device, as mentioned before, playing a big part in the replay speed of a given movie. One test movie with MPlayer showing 97% of frames off the IDE drive, but only 67% from the Adtron SCSI. (Quick tip:- If you are getting a lot of frames dropped on playback or even places where the frames stop coming for a short time, then consider lowering the (truecolor) screen resolution that you're using on the Falcon you're playing back on. Software screen res boosters seem to impose a noticeable performance penalty.)
As I've said before, MPEG Streamclip is NOT a full replacement for VirtualDub. The latter still offers many more detailed options not found in MPEG Streamplay, such as detailed control over synching audio to video, a huge range of filters, custom audio output rate to match exactly to the Falcon etc.
However, as a quick and easy one-stop shop for the Mac (and PeeCee for those in a hurry), it is pretty damn good, it will do nicely for ninety percent of what you might want to convert and like VirtualDub, it is free!
So how hard can we push things?
I discussed this briefly with Beetle at an Outline party, as he had managed to port a feature length movie, which was displaying in a window on his CT60 expanded desktop at an extreme wide screen format, something like 480 x 180 pixels sticks in my mind for some reason. We speculated that this would be pretty close to the sensible limit even on a graphically enhanced CT6x Falcon, although the SuperVidel may offer dedicated support for higher movie resolutions later on. A suggested mode of 720 x 288 has been mooted on the Nature Brothers website
Of course, I had to try for myself. My initial target was the first placed entry for the Revision 2013 animation competition, namely the Lubeck 24x7x365 movie. This one was prepared on VirtualDub, with a resolution of 480 x 264. The audio was set at 32780 kHz, a native Falcon mode to eliminate the background hiss that came with the MPlayer friendly sound settings, so it was for Aniplayer only. This was intended for a CT6x system, preferably one that had been accelerated over and above the 66 MHz base level CPU.
At 90 MHz with CTPCI, it replayed perfectly in a window, peaking at 76% of CPU time used, but generally running in the 50 to 60% range. From brief tests carried out on a bare-booted CT60, without CTPCI and at 66MHz, this may be just about playable without obvious discomfort there too,
My second attempt was for the Hobbit 2 official trailer. This was converted within MPEG Streamclip in a suitable super-size format of 480 x 240 pixels. This one replays at around 50-60% CPU under Aniplayer on a CT60 at 90 MHz and CTPCI. It also plays back at a full frame count on MPlayer (assuming a 16-Bit True Colour mode on CTPCI.) It even manages to play back respectably on Aniplayer at 66 MHz with no CTPCI and also on MPlayer. Interestingly this one even replays at a still reasonable 73% of frames shown via MPlayer on my CT2 system.
So currently, Aniplayer and MPlayer will play back up to a 480 pixel horizontal resolution on CT6x class hardware, preferably graphically enhanced. For mid-range Falcons, such as Centurbo 2, then you can get away with 320 pixel horizontal resolution with MPlayer, less with Aniplayer. Mileage may vary with how accelerated your hardware is. For base Falcons at 16 MHz with no hardware acceleration, the suggested horizontal screen resolution is something in the order of 160 pixels for Aniplayer or 240 pixels width for an MPlayer format movie.
For fans of (hem!) non-interactive media content on the Falcon, I hope this article has been of some use and interest to you. Happy viewing, until the next time!
CiH, For Mag! - Various in 2013.