• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Compact Mac Transcoded Video Idea

superjer2000

Well-known member
I have been playing around with @fstark 's awesome MacFlim (now with audio) and it struck me how great it would be to watch non-pre-prepped content on my SE/30.

Stealing @tashtari 's Elevator Pitch proposal style...

Elevator Pitch:
It's a hardware/software solution that allows full screen video (with audio) to be transcoded in real time for display on a compact Mac.

Hardware: Something similar to @saybur's ScuzNet or RaSCSI that would allow a SCSI volume to be mounted which would house the file being transcoded on the fly. This might operate similar to the EtherDFS client/server that I use on my vintage IBM PC (EtherDFS is an 'installable filesystem' TSR for DOS that maps from a remote computer (typically Linux-based) to a local drive letter, using raw ethernet frames to communicate.) Note that something like this might be useful in general to essentially add a networked drive via SCSI/Ethernet instead of AppleShare. (You would have a disk image on your linux box which your ScuzNet would point to as a datasource (rather than the SD card) so it essentially becomes SCSI over Ethernet.

Software: When a flim is selected for viewing, the MacFlim transcoder on the linux box would stream the video to a file on the disk image (hfs image mounted in linux) which would then be played back by the Mac's MacFlim client.

Not sure how much of the above is possible (i.e. MacFlim transcoding on the fly and having both the linux box writing to the streaming file and the Mac reading from an earlier point in the same file.
 

marciot

Well-known member
I had the similar idea of building a game streaming client for the Mac Plus, then blow people's minds on YouTube or Twitch by pretending to play modern games like Crysis or Grand Theft Auto on a vintage Mac 😁

Anyhow, currently I am occupied with my VNC server, but this might be a fun idea for me to pursue next!

PS: What is Mac Flim? Where can I try it out?
 

marciot

Well-known member
This is incredible! I've been teaching myself 68x assembly lately, so I should be able to tweak this or at least learn from it!
 

fstark

New member
Hi, didn't realize someone was talking MacFlim over here! (I haven't been active here since the great crash, and I must confess being a bit bitter that all the great exchanges about MacFlim were lost. It is this forum users that convinced me to do the sound version and helped me on how to get the sound driver working!)

Anyway, answering a bit late:

Transcoding on the fly is technically possible, but would need a lot of changes in the encoder (that is badly written due to the requirements changing all the time).

Also, there is a key feature missing from the player (seek) that is *hard* and needs a modification of the file format.

However, a lot of the work on the second version was about being able to control the byterate, so I would say the hardest pieces are there. Don't hold your breath, but it is definitely something I've been thinking about a lot. If it happens, it will probably take a couple of major version iterations. I have other non-mac projects I'd like to do in between, though.

> I've been teaching myself 68x assembly lately, so I should be able to tweak this or at least learn from it!

There are only a couple of assembly routines in MacFlim.

Computation of fletcher16 checksum for flim integrity (with the reference implementation in C):


The couple of core decoding routines, (with ref implementations in C) not unrolled yet, will do that only at the very end:


My assembly probably sucks, btw :)

PS: that VNC server is awesome. I wouldn't have believed that you could do that on a MacPlus. I *think* the way I would go would be javascript client and custom protocol. Something like a 16/32bits RLE of the XOR of the previous and current screen areas (which was my original idea for MacFlim, but was waaaaay to slow in that context).
 

marciot

Well-known member
@fstark: I've been thinking a lot about what you did with MacFlim and I thought this info might benefit you. Are you familiar with "8808 domination" from the PC side of the world? This is a video encoder and player for the IBM PC XT that is able to show color video at 24 fps:


Keep in mind that that is an 8-bit processor running at 4.77 MHz, vs. the Mac Plus's 16-bit processor running at 8 MHz, so it suggests that theoretically, the Mac Plus might be capable of similar performance.

The author made a pretty good writeup of how it was done and I'm thinking you might enjoy reading it:


A few observations:
  1. He makes use of the "REP MOVSB" and "REP STOSB" for fast writes of repeated runs of bytes. The 68000 does not have an instruction like this, alas, although the 68010 did introduce a two instruction cache to speed up such loops.
  2. That said, it might be possible to make use of "MOVEM" on the 68000 to blast up to 64 bytes into memory using one instruction, which might be good enough for the majority of runs.
  3. The most crucial thing, however, is that his encoder spits out instructions, rather than data, which are then loaded into memory and executed directly. The 68000 lacks a data and instruction cache, so you're pretty fetching instructions and data at each cycle. By making the video stream itself code, I bet performance could be doubled.
Anyhow, I realize 3 might be very challenging, as you're basically building an encoder that is also a compiler, but I think it's an approach worth thinking about. I might be able to help out!
 

marciot

Well-known member
I seriously want to see Bad Apple running on a Macintosh!

EDIT: Oh, I see you have it already for the SE/30. But I mean I want to see it on my Mac Plus, lol
 
Last edited:
Top