home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / graphics / apps / mac / sparkle / sparkle233b folder / (docs) / readme 2nd < prev    next >
Encoding:
Text File  |  1995-03-21  |  42.0 KB  |  820 lines

  1. Sparkle: A new mac MPEG player.
  2. -------------------------------
  3. Documents for version 2.3.0
  4. This document looks best in 9 point monaco.
  5. On an MPW marks aware editor (like Alpha) this document has marks for 
  6. each section.
  7.  
  8. This document contains the following sections:
  9. INTRODUCTION
  10. LEGALITIES
  11. SAVING TO MPEG
  12. FAQs
  13. WHY DOESN'T SPARKLE DO....
  14. SMALL THINGS YOU MIGHT NOT HAVE NOTICED
  15. THE FUTURE
  16. HOW CAN YOU HELP IMPROVE SPARKLE?
  17.  
  18. ------------------------------------------------------------------------------
  19. INTRODUCTION
  20.  
  21. Hi there, friendly users. This is release 2.3.0 of my mac MPEG player.
  22.  
  23. Version 1.0 of this code was based on the Berkeley MPEG unix code.
  24. (Anyone who wants to play with the Berkeley code can get it from 
  25. toe.cs.berkeley.edu in pub/multimedia/mpeg.) It was released as soon as 
  26. it was usable. This version no longer makes use of Berkeley code and uses 
  27. my own algorithms for greater speed, smaller memory footprint, and more 
  28. flexibility.
  29.  
  30. Version 2.0 of this code made use of the Berkeley MPEG encoder, available 
  31. from the same place as above. This encoding code has now been almost 
  32. completely rewritten by me, and uses substantially less memory than 
  33. before. For this release I merely concentrated on rewriting my own encoder.
  34. As a result, the encoder behaves just like the old encoder except for 
  35. being a little faster and a whole lot less memory intensive.
  36. In the near future I will add rate-controller to the encoder but that's 
  37. not yet ready for this release.
  38.  
  39. Notice that there is a section of this document called FAQs.
  40. Please read it before sending me mail, thus avoiding wasting your time and 
  41. mine.
  42.  
  43. Please read all of this document before playing with the program. While 
  44. actually using the program is pretty simple, there are a few things you 
  45. should be aware of. Many of you may not care when I waffle on about 
  46. technical details. However I would ask all programmer readers (especially 
  47. people knowledgable about QuickTime, and especially Apple [and 
  48. ex-Apple :-( employees] to look at the tech sections and help me out with 
  49. comments and suggestions. Each time someone gives me a pointer on how to 
  50. do something it cuts a week or more off the release date of the next 
  51. version of Sparkle. 
  52.  
  53. Features:
  54. Ñ    Standard mac interface with menus and windows.
  55. Ñ    Uses the QuickTime movie controller to control the MPEG viewing.
  56. Ñ    MultiFinder friendly, with good backgrounding behavior.
  57. Ñ    Saves MPEGs to QuickTime movies.
  58. Ñ    Can open multiple files at once.
  59. Ñ╩  Can open QuickTime movies and sets of PICTs.
  60. Ñ   Can encode MPEGs.
  61. Ñ     PowerMac native.
  62. Ñ    Free.
  63.  
  64. To run it needs at least:
  65. I do not support Sparkle on less than System 7.5. If you refuse to 
  66. upgrade to 7.5, it is your responsibility to try to track down every 
  67. extension Sparkle needs. I no longer keep track of this info and cannot 
  68. help you in your search.
  69. If you refuse to upgrade to 7.5, here's what you will need.
  70. Ñ    System 7.
  71. Ñ    QuickTime 1.6 (QT 2.0 with the QT PowerPlug on PowerMacs)
  72. Ñ   Sound Manager 3.0.
  73. Ñ    The Thread Manager (2.0 or higher on PowerMacs).
  74. Ñ   ObjectSupportLib and AppleScriptLib on PowerMacs.
  75. Ñ   Works much better with SCSI Manager 4.3
  76. Ñ    A 68020 or better.
  77. Ñ    1200K to play one 160x120 MPEG. Almost all memory allocation is done 
  78.     through temporary memory, so if you get a low memory message, close other 
  79.     applications. Increasing the partition size of Sparkle will not help 
  80.     much and will take memory from other applications.
  81.     
  82. This program works fine, with good handling of errors, on my Quadra 610, but 
  83. that's the only machine I have to test it. If you find a bug that is not 
  84. caused by the various things listed below, please mail me with as many 
  85. details as possible, both about your machine and about what the  program 
  86. was last doing before it died on you.
  87.  
  88. I don't think there's much to say on the use of this program---you pretty 
  89. much run it like any other mac program. There is a section in this 
  90. document on tips that may not be obvious. 
  91. When opening files, you can choose to show all files, or only files with a 
  92. .mpg suffix.
  93. If you choose the "show all files" option and open some random file, don't 
  94. be surprised when you are told that that is not a valid MPEG file.
  95. If you set the option to change file types, the file type of the MPEG file 
  96. you are changing will be changed to a Sparkle file, which will give it a 
  97. nice icon and allow you to open the file by double-clicking on it.
  98.  
  99. Underneath the movie controller for each window is a progress bar which 
  100. will update itself when slow things are happening. If you have a fast 
  101. machine (say a Quadra or Centris) this won't have to update itself much, 
  102. except if you open large (and not too common) MPEGs---say 320x240. If you 
  103. really want to see what the progress update looks like, try having lots of 
  104. MPEGs playing at once, then switch Sparkle into the background. 
  105. If you save an MPEG to QuickTime using Cinepak, your machine may appear to 
  106. freeze while each frame is being converted. I have installed code to 
  107. reduce the extent of the freeze, but basically this is a bug with 
  108. QuickTime---the system just grabs control and won't let go for about five 
  109. seconds. Maybe this'll be fixed in QuickTime 2.0 if we're lucky.
  110.  
  111. I have tested this program extensively under low-memory conditions when it 
  112. opens files and plays them.  It should never crash under those conditions.  
  113. In 600K you can easily open, play and save to QT a 120x160 I-frame MPEG.  In 
  114. 1500K you can open, play and save to QT a 320x240 IBP-frame MPEG.
  115.  
  116. Disk errors in various forms (bad sectors reading an MPEG file, no disk 
  117. space writing an QuickTime file, etc) will not crash, but the system will 
  118. put up an error alert and not handle the error very well (for example you 
  119. won't be given a chance to destroy old files to free up space on a disk). 
  120. Decent recovery from disk errors is on the list of things to do.
  121.  
  122. ------------------------------------------------------------------------------
  123. LEGALITIES
  124.  
  125. This program can be freely distributed.
  126. If you want to include it on a CD-ROM collection, please ask me first, 
  127. but I'll probably allow you.
  128. NOTE: Some authors will not allow their stuff to be distributed on CD-ROMs 
  129. for which people have to pay. I would ask these authors to consider things 
  130. more carefully. Many people (like myself) do not have very good ftp access 
  131. and a CD ROM of stuff is a godsend, even if we do have to pay a little for 
  132. it. Think about it.
  133.  
  134. If you feel a desperate need to thank me for this program, send me a 
  135. floppy of interesting MPEGs or QT movies you've picked up. 
  136. (Please don't e-mail me large files without warning.)
  137. My paper-mail address is 
  138.     Maynard Handley
  139.     20975 Valley Green Drive, Apt 226
  140.     Cupertino, CA 95014
  141.     USA
  142.     
  143. ------------------------------------------------------------------------------
  144. SAVING TO MPEG
  145.  
  146. The dialog box offering options when you save to MPEG is not that great 
  147. right now if you don't know what you're doing. I'm sorry---I'll fix it 
  148. when I have time, like everything else.
  149.  
  150. For a better explanation of how MPEG works, read the Technical Notes file 
  151. in this package, but here are rough details.
  152.  
  153. When encoding your MPEG you will need to decide what types of frames you 
  154. want to use. If you want your MPEG to be read widely, ie on PC systems, 
  155. you should consider using only I-frames. The most common MPEG decoder on 
  156. PCs is the Xing decoder which only understands the simple I-frame MPEG 
  157. format. If you want to get the best possible compression you should use 
  158. I, P and B frames, but then your MPEG will only be able to be read by 
  159. smarter decoders. A compromise is to use only I and P frames. This will 
  160. give you a lot of the compression benefit of I, P and B frames, but will 
  161. be faster to encode. 
  162.  
  163. If you don't want to know the details of these frames, choose a frame 
  164. pattern from the popup menu. 
  165. If you want to create your own frame pattern, here are some details:
  166. (If you don't want to create your own frame pattern, ignore these.)
  167. 1) The first frame in the MPEG will always be I. That implicit I frame is 
  168.     displayed in front of the frame pattern text you enter because it is 
  169.     always there and you don't need to put it in. That implicit I frame is 
  170.     only used for the first frame, after that your pattern is repeated as 
  171.     necessary. Thus if your pattern is BBPBBI, the encoder will encode frames 
  172.     using the sequence I BBPBBI BBPBBI BBPBBI ...
  173.     (For people who care about MPEG details, this is the playback order
  174.     of the frames. The actual order of the frames stored in the file 
  175.     will be be I PBBIBB PBBIBB PBBIBB.)
  176. 2) If you are using B frames, you have to start off with two referential 
  177.     frames, the initial I frame then either an I or a P frame.
  178. 3) The last few frames of the MPEG, if they would be B frames, will be 
  179.     converted to I-frames. (If this didn't occur, like in the original 
  180.     Berkeley encoder code before I munged it, you will lose those final 
  181.     frames.)
  182. 4) Don't create too long a pattern of Ps or Bs. You'll start to lose 
  183.     quality and random access into the movie will become more granular. The 
  184.     presets I've given should guide you as to sensible selections.
  185.  
  186. Once you have chosen a frame pattern, you'll need to select the amount of 
  187. compression you want to use. This is set by the I, P and B quantization 
  188. levels. The values the dialogs gives as defaults will usually make sense 
  189. but if you want to change them:
  190. 1) The values are restricted to the range 1 through 31 inclusive.
  191.     A quantization of 1 is the highest quality, a quantization of 31 is the 
  192.     lowest quality.
  193. 2) Normal quality is a quantization of about 8. Low quality is a 
  194.     quantization of about 16. High quality is about 6.
  195.  
  196. You can choose from various algorithms for generating P and B frames. I 
  197. haven't explored these in detail and they may change when I have time to 
  198. look at them. For now the important things to note are 
  199. 1) They all seem to generate about the same quality, and about the same 
  200.     file size.
  201. 2) They are ordered in the menus by speed, with the fastest ones first.
  202. 3) The B-frame exhaustive search will take approx forever to do anything. 
  203.     Try it once to see what I mean, but don't expect to use it for anything 
  204.     useful.
  205. As I explore these more and start diddling the code, I'll provide more 
  206. explanation.
  207.  
  208. If you save to MPEG, because of the non-causal algorithms used by MPEG 
  209. compression, frames are not compressed in the order they are displayed. 
  210. This means that if you are using B-frames and stop the compression before 
  211. it reaches the end of the source movie, the encoder may have queued up 
  212. some frames it needs to compress to make the MPEG file consistent. 
  213. If this is the case, Sparkle will have to encode those queued frame before 
  214. it stops the compression, so it won't stop immediately. 
  215. The message window will tell you how many frames have been queued so you can see 
  216. how things are going. If you have the speech manager installed, Sparkle 
  217. will also tell you how many frames are left, which you may find more 
  218. convenient.
  219.  
  220. You can set the frame rate from a popup menu. When the dialog box opens, 
  221. the frame rate of the MPEG or QT movie you are converting has its frame 
  222. rate read in and used to set the initial frame rate. So usually you won't 
  223. want to change the frame rate. Note that there are a limited set of frame 
  224. rates because MPEG only supports a very few frame rates. So the best one 
  225. possible is chosen.
  226. Note also that frames are laid down with that frame rate which may cause 
  227. the movie to speed up or slow down. No frame interpolation is done to 
  228. ensure that perception remains correct across frame rate variation. 
  229. This'll be changed at some point, but is not a high priority compared to 
  230. sound.
  231.  
  232. When an MPEG is encoded the frame currently being encoded may be compared 
  233. to the original version of a previous frame, or to what you get when you
  234. decompress the MPEG compressed version of the earlier frame. The latter 
  235. alternative is called ``Decoding Reference Frames''. If you use this 
  236. latter alternative the compression takes a little longer but results in 
  237. files a few percent smaller and slightly better quality. I'd recommend 
  238. you leave this option selected.
  239.  
  240. An MPEG can be encoded using using what are called half-pixels which means 
  241. that some pixels in a P- or B-frame are specified as an average of pixels 
  242. around them.  If you use half-pixels the MPEG created will be a few percent 
  243. smaller than if you don't use half-pixels and the quality will appear 
  244. better IF you play the MPEG on an MPEG player that handles half-pixels.  
  245. However if you use an MPEG player that does not understand half-pixels the 
  246. result may look pretty shabby in places where there is a lot of action.  
  247. Also, using half-pixels makes encoding slower and increases the amount of 
  248. memory used by almost two-thirds. For these reasons I'd recommend not 
  249. selecting this option.
  250.  
  251. ------------------------------------------------------------------------------
  252. MENU OPTIONS
  253.  
  254. Here are various points related to the menu options:
  255.  
  256. Ñ File| Save As: 
  257.     This allows you to start saving a movie or pseduo-movie 
  258.     (made from a set of PICTs) as an MPEG or QuickTime file. Once you start 
  259.     the save it continues in the background. This menu item changes to 
  260.     File| Stop Saving which will stop the saving at once. 
  261.     You may want to pause the saving but not stop it, for example so that 
  262.     you can play another movie at top speed. To pause, simply click anywhere 
  263.     in the movie controller or type any key.
  264.     When the saving is busy working away the movie controller play button 
  265.     shows a pause symbol, because if you click there it will pause the saving.
  266.     When the saving is paused, the movie controller play button shows a play 
  267.     symbol because if you click the saving will resume.
  268. Ñ Image|Grow or Shrink
  269.     The scaling of the window at any time is given in the title bar. 
  270.     When the title starts with *1, the movie is its natural size. 
  271.     With *2 the movie has been doubled in size. 
  272.     With /2 the movie has been halved in size.
  273.     For now if you expand or shrink movies beyond their natural size 
  274.     playback will be much slower and quality may not be as good. I'll be 
  275.     adding code to fix this soonish.
  276.     
  277. Ñ Image| Hide All
  278.     You can hide or show all the decorations below the movie windows. The 
  279.     easiest way to do this is with the tab, shift-tab and control-tab keys, 
  280.     or with command-H. You may want to do this because the decorations 
  281.     irritate you or because hiding the decorations makes playback speed a 
  282.     few percent faster.
  283.  
  284. Ñ Playback| Play All Frames: 
  285.     If this is set, every frame of the movie will be played. The movie will 
  286.     try to play in real time, but may be slower than real time if necessary. 
  287.     It will never be faster than real time. 
  288.     With quicktime movies sound is disabled when this option is on.
  289.     When this option is off, the movie will play back in real time which may 
  290.     mean skipping some frames. For MPEGs, how well this works depends on how 
  291.     fast your mac is. (Also read the section on play rate below.)
  292.     
  293. Ñ Playback| Play at Double Speed:
  294.     These options set the  movie to play twice as fast, at the normal rate, 
  295.     or twice as slowly. Note that if Play All Frames is active, playing the 
  296.     movie at double speed may be no faster than playing it at normal speed 
  297.     because both ways the calculation of each frame is overloading the mac.
  298.     Some MPEGs look jerky and too fast when played at their normal speed and 
  299.     with Play All Frames switched off. This is because the MPEGs have been 
  300.     encoded at too high a frame rate. For example the original movie may 
  301.     been sampled at 12 frames per second but it's encoded as an MPEG of 24 
  302.     (or 23.976) frames per second. This happens because the lowest possible 
  303.     frame rate with MPEG is 23.976 fps. So if this happens, you may want to 
  304.     set the MPEG to play at half speed. 
  305.     You can also control the speed at which movies play by command-clicking 
  306.     in the steppers of the movie controller.
  307.  
  308. Ñ Edit| Preferences| Faster Mode: 
  309.     If you set this option, whenever Sparkle is busy, either playing movies 
  310.     or encoding movies, it will not yield time to background applications. 
  311.     This makes playback a little faster and smoother. 
  312.     However if you have an application doing something in the background,
  313.     for example a modem download or a background compile, you might want to 
  314.     deselect this option.
  315.     By my testing, when Faster mode is on Sparkle uses up about 90% of the 
  316.     CPU. When faster mode is off Sparkle uses up about 70% of the CPU.
  317.     (When Sparkle is in Faster mode it still has to use the EventAvail() trap 
  318.     every so often to see if the user has issued a command, moved the window, 
  319.     grown it or whatever. It's these calls to EventAvail() which can yield the 
  320.     CPU to other processes that suck up the 10% of the CPU not used by 
  321.     Sparkle in Faster mode. Anyone know how to perform the equivalent of 
  322.     EventAvail() without allowing the Process Manager to yield?)
  323.  
  324. ------------------------------------------------------------------------------
  325. MPEG PLAYBACK PREFERENCES
  326.  
  327. The MPEG Playback Preferences dialog (use command-R or look under the 
  328. Preferences menu under the Edit menu) allows you to set general playback 
  329. preferences. Most of these are concerned with how you wish to balance 
  330. playback speed against playback quality. Note that whatever settings you 
  331. choose for playback, when you save an MPEG file to another format all 
  332. settings are switched to the highest quality while the save is in 
  333. progress, so you don't need to worry about losing quality that way.
  334.  
  335. Ñ Clip YCrCb:
  336.     What this refers to is an intermediate stage in the MPEG decoding. The 
  337.     values for Y, Cr and Cb should be between 0 and 255 but some MPEGs are 
  338.     encoded so that some Y or Cr or Cb values are calculated to be below 0
  339.     or above 255. If you don't select this option, Sparkle doesn't check the 
  340.     Y Cr Cb values and clip them if they are out of bounds. This makes 
  341.     playback about 10% faster, but may (if the values are out of bounds) 
  342.     lead to dots of incorrect color or black dots in areas of white or 
  343.     suchlike.
  344.  
  345. The other quality options are used depending on the screen depth of the 
  346. screen on which the MPEG is playing. So if your MPEG is on a 16-bit 
  347. screen, the 16-bit color options are used.
  348. Ñ Use 4x4 IDCT:
  349.     One time-consuming part of MPEG decoding is the IDCT which is somewhat 
  350.     like a Fourier transform. This should be performed using a matrix of 8x8 
  351.     coefficients. If you select this option only a 4x4 subset of that matrix 
  352.     will be used. This makes the calculation a lot faster, but the cost is 
  353.     some blurriness to the image which is usually acceptable.
  354. ÑUse half-pixels:
  355.     Half-pixels are a scheme whereby certain pixels in the image are 
  356.     represented in the MPEG file as an average of nearby pixels. Calculating 
  357.     these averages takes time but improves quality. I'd recommend not 
  358.     bothering with half-pixels on an 8-bit color screen because the dithering 
  359.     hides the fine detail they reveal. For other screen depths you decide.
  360.     Some MPEGs will not be affected by this setting, because they were coded 
  361.     not to use half-pixels.
  362.  
  363. Ñ 24-bit screens display options:
  364.     The high quality setting corresponds to clipping RGB while the faster 
  365.     setting does not clip RGB.
  366.     This is the same sort of issue as the Clip YCrCb note above, only 
  367.     occurring at a later stage in processing. Some MPEGs look fine with 
  368.     neither form of clipping, some only need one or the other, and some need 
  369.     both. (This option is not an issue for 8 and 16 bit screens because they 
  370.     use a different way of calculating RGB for their display---not as high 
  371.     quality as the 24-bit method, but good enough for the given screen 
  372.     depth.)
  373. Ñ 8-bit color screens display options:
  374.     You have a choice of three dither options on an 8-bit screen. 
  375.     * Fast dithering uses an algorithm I invented. It is phenomenally fast, 
  376.     but not the greatest quality. It looks especially bad for things that 
  377.     need very sharp edges, like text. (It also uses 128K of storage to do its 
  378.     thing, so if you're low on space you may want a different option.
  379.     When this option is activated for the first time --- for example when 
  380.     you switch to 8-bit colors screen depth from some other depth, or when 
  381.     you first open an MPEG under 8-bit screen depth --- these 128K of tables 
  382.     have to be calculated which takes about 1.5 sec on my Quadra 610. 
  383.     In a future version of the code I'll implement ideas I have for removing 
  384.     this delay.)
  385.     * Use 16-bit pixmap calculates everything using a temporary 16bit pixmap 
  386.     which is then dithered on the screen using QuickDraw. It's a compromise---
  387.     the quality is better than fast dithering and it uses less memory than 
  388.     the 24-bit scheme.
  389.     * Use 24-bit pixmap works like 16-bit pixmaps, but all calculations are 
  390.     performed on a 24-bit pixmap (using RGB clipping). 
  391.     This gives the best results, but is slower than the 16-bit pixmap case and 
  392.     uses more memory.
  393.     * I hope to improve the quality of the fast dithering algorithm in the 
  394.     near future. 
  395.     * Also at some point I'll add code to allow you to set an optimal palette
  396.     when playing on 8-bit color screens. At present I simply use whatever 
  397.     palette the screen is using, usually the system palette.
  398. Ñ 16-bit screen display options:
  399.     You have three options. 
  400.     * The fast option uses a lookup table directly on the MPEG YCrCb data to 
  401.     get RGB values. This is faster but gives lower quality.
  402.     * The 16bit high-quality option calculates the RGB values properly (with 
  403.     greater precision than using a lookup table). It gives better quality 
  404.     but is slower. (At present I haven't yet written the code for this 
  405.     option so it is disabled.)
  406.     * The 24bit pixmap option calculates results using a 24-bit pixmap (and 
  407.     RGB clipping), then dithers the result to the 16bit screen. It gives the 
  408.     best quality but is slowest.
  409.  
  410. Ñ For 8-bit grey screens:
  411.     Two points to note. 
  412.     * Is your graphics card set to grey mode? If you have a grey screen but in the 
  413.     monitors control panel you have set your graphics card to color, Sparkle 
  414.     will think it's on an 8-bit color screen. This will give you slower 
  415.     playback and lower-quality results.
  416.     * For the fastest possible playback, I assume that the screen palette is 
  417.     set to the system palette. On an 8-bit grey screen there is never any 
  418.     reason to change this. Nonetheless, some applications feel they simply 
  419.     have to perform this pointless exercise whose only effect is to reduce 
  420.     the quality of what's displayed by other applications. (Would you be at 
  421.     all surprised to learn that Word, one of the masterpieces from those 
  422.     geniuses at Redmond, is such an application? I though not.) 
  423.     What this means is that if you are running Word (or another of these 
  424.     ill-behaved applications) in the background, Sparkle will playback MPEG 
  425.     files somewhat slower than it should.
  426.  
  427. In summary: 
  428. The fastest playback possible is on a 8-bit grey screen, followed by 
  429.   8-bit color, then 16-bit color, then 24-bit color. 
  430. For fastest playback, deselect the ClipYCrCb option, 
  431.   select the Use 4x4 IDCT option, 
  432.   deselect the Use Half-Pixels option
  433.   for 8-bit screens use fast dithering 
  434.   for 16bit screens use 16bit fast
  435.   for 24bit screens use 24bit fast
  436.   use command-H to hide all the decorations below the video window.
  437. For highest quality playback, use the deepest screen-depth you can,
  438.   select ClipYCrCb 
  439.   deselect the Use 4x4IDCT option,
  440.   select the Use Half-Pixels option
  441.   select the 24-bit pixmap option
  442.  
  443. Decoding MPEGs requires lots of computation, but can be made faster by 
  444. sacrificing some quality. I've tried to allow you to make your own choice 
  445. about which you prefer. But remember I can't work miracles. For example I 
  446. can't magically give you an 8-bit color dither algorithm that gives the 
  447. same quality as the QuickDraw but runs at the speed of my fast dithering. 
  448. I'll try to improve the quality of the high-speed options in future, but 
  449. I can't promise anything.
  450.  
  451. The one other item in this dialog box is the 
  452. "Prefer 8-bit color to 8 bit-grey" checkbox. This is only relevant to 
  453. people who have more than one screen, at least one of which is grey and 
  454. at least one of which is color. 
  455. When Sparkle opens a file it orders all the screns available by screen 
  456. depth and tries to open a window on the deepest depth screen. But if you 
  457. have one screen set to 8-bit grey and the other set to 8-bit color it 
  458. can't know which you'd prefer, hence this setting. You may prefer the 
  459. color screen because any color is better than none, or the grey screen 
  460. because it gives faster playback and no fuzziness from dithering.
  461. (After ordering the screens by depth, Sparkle notes where other movie 
  462. windows have been placed and tries to place the new window so it doesn't 
  463. overlap any of the old windows. Also, if the window opened is large than 
  464. any screen, it will be opened at half size or whatever so it does fit on 
  465. the screen. I hope you like this algorithm. It works better than what 
  466. every other program I've seen uses. If you have comments about it, please 
  467. mail me.)
  468.  
  469. ------------------------------------------------------------------------------
  470. PICT FILES AND PSEUDO-MOVIES
  471.  
  472. Sparkle can open a set of PICT files to convert them to an MPEG or QT 
  473. movie. This may be useful if you have enough program, like a graphing 
  474. program, that creates a set of PICTs, or if you have a set of medical 
  475. scans or such. 
  476.  
  477. The only picture format Sparkle understands is PICT, the Mac standard 
  478. picture format. I do not plan to change this because there are lots of 
  479. programs out there, many of them free and many of them capable of running 
  480. in batch, that will convert whatever format you have to PICT.
  481.  
  482. Once you have your pictures in PICT format, they need to be in the same 
  483. folder and given the same name so that Sparkle can link them together.  For 
  484. example, if these pictures represent x-rays of your head, call them 
  485. myHead.1, myHead.2, etc.  They must be named name.# where name is common to 
  486. all files and # is a number.  The numbers don't have to start at zero or 
  487. one, and don't have to be contiguous.  However they must all be positive 
  488. integers.
  489.  
  490. From the open files dialog open one of your PICTs---whichever one you get 
  491. to first, it doesn't have to be the lowest numbered one. Sparkle will 
  492. scan the folder for other PICT files with that name and a number added, 
  493. order the files it finds, and display them all in a movie window. 
  494. You can now treat this pseudo-movie like any other movie. You can grow or 
  495. shrink the window, step forwards or backwards, etc. You can play the 
  496. movie if you like, but for these PICT pseudo-movies I set the framerate 
  497. to only one frame per second. Decoding a PICT can be fairly slow---it 
  498. involves disk access and lots of memory---so don't expect this to work 
  499. wonderfully. You can now save the pseudo-movie as an MPEG or QT movie 
  500. just as you would normally.
  501.  
  502. The PICTs may be different sizes, but the window opened will be the size of 
  503. the PICT you select in the open file dialog box. The other PICTs will be 
  504. scaled to fit this size window and may not look too good. I wouldn't 
  505. recommend using a set of PICTs that aren't all the same size.
  506.  
  507. Note that for now I don't do anything special when I draw the pictures. 
  508. In particular this means on screens that aren't 24-bit or 16-bit I don't 
  509. dither the picture. This will be fixed fairly soon. For now everything 
  510. all works and it doesn't affect the quality of movies you create.
  511. I'll also be adding code to save MPEGs or QuickTime movies as a set of 
  512. PICTs fairly soon.
  513.  
  514. ------------------------------------------------------------------------------
  515.  
  516. QUICKEYS AND BATCH CONVERSION
  517.  
  518. I won't have AppleScriptability in place for a few months, but I have 
  519. been asked by some users for a rudimentary support for batch conversions. 
  520. Specifically people wanted a way for Sparkle to indicate that it was done 
  521. encoding a given file.
  522.  
  523. I have provided such a capability for QuicKeys users in a very crude 
  524. fashion. When Sparkle has finished converting a file to a different 
  525. format it will toggle the cursor from the standard arrow cursor to a 
  526. thick cross for one second. 
  527. Note which cross this is: It is not a thin one pixel wide cross, neither is
  528. it a spreadSheet like cross with arms a few pixels wide. This cross has 
  529. arms that are two pixels wide.
  530.  
  531. To use this capability in QuicKeys, you want to put in your sequence a 
  532. Wait..  command. Make the Wait command a WaitForCursor variant, and set 
  533. the options to wait until the cursor becomes ``Other...''. In the 
  534. ``Other'' dialog box choose the appropriate cursor---in my version of 
  535. QuicKeys it's the fourth cursor along. UnSet the Test for Mask box and 
  536. set the Test for Cursor box.
  537.  
  538. I would recommend that you structure your sequence like this:
  539.     Wait ...      ---Wait for the cursor
  540.     Pause...    ---Pause for a second
  541.     Pause...    ---Pause for five seconds or so
  542.     Do your thing.
  543.  
  544. The first pause in the above is to wait until Sparkle finishes its one 
  545. second flash of this cross cursor. The second is to wait for general disk 
  546. activity and such to finish. At that point you can then go on to whatever 
  547. the rest of your sequence does, like maybe close Sparkle then open it 
  548. again with a new file. 
  549.  
  550. ------------------------------------------------------------------------------
  551.  
  552. FAQs (Frequently asked questions).
  553.  
  554. Ñ╩I try to play MPEGs but my Mac starts speaking numbers or asks me over and 
  555. over to select a voice.
  556.     You have the Speech Manager installed on your Mac including a little 
  557.     extension called ``Speech Media Handler''. Speech Media Handler speaks
  558.     the text of movies that include a text track, and Sparkle plays MPEGs 
  559.     by creating a dummy text track as part of the process of faking QuickTime 
  560.     into accepting MPEGs. I'd recommend ditching Speech Media Handler. I've 
  561.     never seen a place where it is useful and right now it's kinda a cute toy 
  562.     idea that escaped from Apple. Maybe in a few months they'll give it a 
  563.     programmer interface and make it more useful.
  564.     
  565. Ñ╩I've downloaded (or uploaded) an MPEG using Mosaic/WWW and when I try to 
  566. play it Sparkle says it's not an MPEG file. But if I ftp the file with 
  567. Fetch or suchlike it works fine. What's happening?
  568.     Be very careful when transferring files over the Internet with MacBinary.
  569.     Fetch and many such programs automatically strip MacBinary from files,
  570.     but Mosaic does not appear to (maybe this will be fixed soon). So 
  571.     if an MPEG is stored at a Mosaic site using MacBinary, all Mosaic users
  572.     trying to download it will have problems.
  573.  
  574. Ñ Why does my MPEG have the occasional block of garbage, mostly colored 
  575. green?
  576.     Some part of the MPEG file has become corrupt. This usually happens with 
  577.     MPEG files that have been uuencoded and have had a character or two lost 
  578.     or changed.
  579. Ñ Why are large parts of my MPEG filled with green garbage, or with parts 
  580. of earlier scenes.
  581.     You have probably downloaded the MPEG file using gopher or ftp in ASCII 
  582.     format. The file is now useless. Download it again using BINARY mode. 
  583.     Better still, set your gopher or ftp application always to download .MPG 
  584.     suffix files in BINARY---don't trust its AUTOMATIC mode.
  585. Ñ Why is the first frame of my MPEG all green?
  586.     Some people out there when they create an MPEG file, randomly start it 
  587.     where they feel like it. 
  588.     The consequence is that the first some bytes of the file are garbage and 
  589.     appear as an all green first frame. 
  590.     If you have one of these MPEGs, whenever you jump to the first frame, you 
  591.     won't see the first frame, but simply the last frame you were looking at. This 
  592.     is a consequence of the way Sparkle handles errors in the MPEG file format. 
  593.     Mostly it works well, but in this particular case it isn't great.
  594.     It is not too easy to work around this because of the many different ways
  595.     in which the MPEG can have garbage at the start before valid data begins.
  596.  
  597. Ñ Why at the end of an MPEG is the last frame the same as the second to 
  598. last frame?
  599.     Some MPEGs just are created this way, with the last two frames as 
  600.     duplicates. This is a problem with those files, not a bug in Sparkle, and 
  601.     one just has to accept it. 
  602.     A similar type problem is that some video that's been converted to 30fps 
  603.     from 24fps film has duplicate frames every so often, and agin one just 
  604.     has to accept this for now.
  605.  
  606. Ñ What does the Thread Manager do? Why do you make such a fuss over it?
  607.     The Thread Manager provides a way for a programmer to create a number of 
  608.     tasks within an application and have those tasks all run together. So 
  609.     with Sparkle every time the user asks for something that will takes some 
  610.     time, like playing an MPEG or saving a file in some different format, I 
  611.     create a task that does that work. If the Thread Manager isn't present, 
  612.     you, the user, can't create a number of these tasks and switch between 
  613.     them---you are restricted to doing only one thing at a time.
  614.  
  615. Ñ╩When I started saving a file to MPEG, it got through two frames then sat there
  616. doing nothing for a long long time. Did it crash?
  617.     Especially when saving to MPEG, Sparkle creates a large number of blocks 
  618.     of memory. If the mac runs out of memory partway through performing 
  619.     this saving, it will run around trying everything it can to scrounge memory.
  620.     On my Quadra 610 I have seen it sit there for 45 seconds trying to free up 
  621.     memory before it concludes that there's nothing it can do and pops up an
  622.     error message. I guess on slower machines it might sit there for up to two
  623.     minutes. Just be patient and wait a while before concluding things
  624.     have crashed.
  625.  
  626. Ñ Where can I get MPEG files?
  627.     An ftp sites is 2k-ftp.CS.Berkeley.EDU in pub/multimedia. 
  628.     (This site used to be called toe.cs.berkeley.edu.)
  629.     
  630.     Here are some WWW sites
  631.     http://www.ccsf.caltech.edu/~johns/sl9.html  (CalTech)
  632.     http://newproducts.jpl.nasa.gov/sl9/images.html  (JPL)
  633.     http://seds.lpl.arizona.edu/sl9/sl9.html  (U. Arizona)
  634.     
  635.     This phillips site sometimes has MPEGs.
  636.     ftp.cdrom.com: /pub/cdrom/incoming
  637.     
  638. Ñ Where can I find more about MPEG?
  639.     Read the UseNet MPEG FAQ. This is published in news.answers every so 
  640.     often, and can be ftp'd as         
  641.         host: ftp.cs.tu-berlin.de
  642.         file: /pub/msdos/windows3/graphics/mpegfaXX.zip
  643.     (XX is a version number).
  644.      Yeah, it's a zip file and that sucks, but that's life. There are a bunch 
  645.      of mac deZip'ers around so grab one and use it.
  646.      The latest version of this file as of July 94 to be 3.1.
  647.  
  648. Ñ How can I deal with AVI files?
  649.     At mac.archive.umich.edu (and probably at sumex) 
  650.     in /mac/graphics/graphicsutil is vfw1.1utilities.sit.hqx
  651.     which handles AVI files and is supposed to work pretty well. 
  652.     I've also been told about 
  653.     ftp://ftp.ctr.columbia.edu:/pub/DA/incoming/vfw11mac.hqx
  654.     which looks the same to me, judging from the name, but which I'm told is 
  655.     better than the above.
  656.  
  657. Ñ What can I do about MPEG sound files?
  658.     Use this program for now, till I include this functionality in Sparkle.
  659.     ftp://mrcnext.cso.uiuc.edu//pub/info-mac/snd/util/mpeg-audio-032.hqx
  660.     Also look at the Internet Underground Music Archive (IUMA) ftp site, 
  661.     sunsite.unc.edu (152.2.22.81) /pub/electronic-publications/IUMA
  662.     for various MPEG audio files and code/apps for a variety of machines.
  663.  
  664. ------------------------------------------------------------------------------
  665. WHY DOESN'T SPARKLE DO...
  666.  
  667. Ñ    Why doesn't Sparkle read .gl, .dl and .fli files?
  668. One reason is that those file formats are awful. They give these dinky 
  669. low contrast horribly dithered images no-one would want to look at, and 
  670. they usually only have about 10 frames. Maybe, years from now, I'll add 
  671. those conversions, but they're about as low a priority as you get.
  672. At mac.archive.umich.edu (and probably at sumex)
  673. in /mac/graphics/graphicsutil is macanimviewer1.05.sit.hqx 
  674. which handles these various cheapo formats so you might want to grab it.
  675.  
  676. Ñ    What about audio?
  677. MPEG has audio compression as well as video compression. I've been doing 
  678. lots of reading into this and pretty soon will start coding for it.
  679.  
  680. Ñ    What about Video for Windows?
  681. I would be nice to support .AVI files. But right now I know nothing about 
  682. .AVI beyond the fact that it exists. Again any info anyone has is 
  683. appreciated. Until I know how .AVI works, how it fits into the windows 
  684. environment etc, I can't even tell you if it's practical for Sparkle to 
  685. try to support .AVI, let alone start the necessary coding.
  686.  
  687. Ñ    Why don't you write an MPEG codec?
  688. MPEG support under QT is through the emchanism of a new Media Handler, not 
  689. simply a codec. This si being worked on but it's a  non-trivial problem.
  690.  
  691. ------------------------------------------------------------------------------
  692. SMALL THINGS YOU MIGHT NOT HAVE NOTICED
  693.  
  694. The movie controller behaves pretty much like a standard QT controller. 
  695. You can step forward and backwards, hold down those buttons to play 
  696. forwards or backwards and click or drag in the central region to go to a 
  697. random point. 
  698. You can use the forward and backward arrow keys to step. 
  699. You can option click in the forward and backward steppers to go to the 
  700. beginning or end of the MPEG. Likewise using option forward or backward 
  701. arrow.
  702. You can start the movie playing using either return, spacebar, or 
  703. command forward arrow. You can stop playing using spacebar or return.
  704. You can yet play backwards by using command backward arrow. 
  705.  
  706. The visual clue that the movie is being saved is that 
  707. the movie controller loses its controls and shows only a relative position. 
  708. This is not a particularly obvious fact and may at some point be changed. 
  709. For now it works once you realize this fact.
  710.  
  711. When a movie is being saved, you can either stop the conversion 
  712. or pause it. To stop the conversion, use command-S (or the equivalent 
  713. menu option.) This will save the movie using the frames created so far.
  714. To pause the conversion use command-P, or the equivalent menu option, or 
  715. click in the movie controller. 
  716. The  saving will stop until you start that movie playing again. This is 
  717. occasionally useful if you want to pause a cinepak conversion to do a 
  718. short job on your mac.
  719. You can tell whether a movie is actively being saved or paused being 
  720. saved by looking at the indicator in the title bar. 
  721. If the first character in the title bar is 
  722.   S the movie is actively being saved,
  723.   P the movie is paused being saved,
  724.   R the movie is in realtime playback mode
  725.   A the movie is in play-all-frames playback mode.
  726.  
  727. If you are partway through a movie and save, the movie will be 
  728. rewound to the beginning for you. You do not need to be at the start of a 
  729. movie to save.
  730.  
  731. You can save only part of a movie by selecting that portion (using the 
  732. shift key and the arrow keys or the mouse), then hitting command-S.
  733.  
  734. You can set the temporal quality options when saving to QuickTime 
  735. separately from the spatial quality options. If you need to do this, hold 
  736. down the option key while using the quality slider, and it will become a 
  737. temporal quality slider. 
  738.  
  739. ------------------------------------------------------------------------------
  740. THE FUTURE
  741.  
  742. The basic outline for now is
  743.     2.5 Cleaned up faster, smaller version of 2.0.
  744.     3.0 Handles sound.
  745.     3.5 Cleaned up faster, smaller version of 3.0.
  746. While adding these large additions I'll fix small things as I go, and as 
  747. I have time. I don't see the user interface improving much for some 
  748. time---more important things need my time.
  749.  
  750. I also want to add stuff to allow us to create movies. Morphs, special 
  751. effects, that sort of thing.
  752.  
  753. ------------------------------------------------------------------------------
  754. HOW CAN YOU HELP IMPROVE SPARKLE?
  755.  
  756. Ñ    Any info on psycho-acoustic encoding?
  757. Ñ    Any info on Microsoft Video for Windows?
  758. Ñ    Any bug reports.
  759. Ñ    Any ideas you have or suggestions. Your suggestions may go onto the 
  760.     list of things to do (currently two pages of single line items) but will 
  761.     probably be acted upon at some point. People have suggested several 
  762.     things to me I would not have thought of myself, so I do want your 
  763.     feedback.
  764. ------------------------------------------------------------------------------
  765. THANKS
  766.  
  767. * Many people all over the internet have helped me write this code.
  768. * Thanks to the people at Berkeley. Even though I've completely replaced 
  769.     their MPEG playback code with my own, they helped get this project started.
  770.     And, until I rewrite it, I'm using their MPEG encoding code.
  771. * Thanks to various usenet personalities who answered mac programming 
  772.     questions, mailed me quicktime header files and such. Special thanks to 
  773.     ldo in New Zealand, and Jon W{tte in Sweden, and bryanw, keeper of the 
  774.     MPEG FAQ, who mailed me about the Stanford MPEG encoder.
  775. * A special individual thank you goes to DS (he didn't want me to give his 
  776.     name but he knows who he is.) DS mailed me a CD ROM and ten floppies of 
  777.     information about QuickTime components after I complained that Apple was 
  778.     not making this information easily available. He's also provided me with 
  779.     information on QT 2.0 which will gradually be assimilated into Sparkle.
  780. * Thanks to Gene Chalfant who passed on a paper from NASA containing some 
  781.     interesting ideas on IDCT alternatives. 
  782. * Thanks to the mystery person in Britain who sent me some QT 2.0 
  783.     information in an envelope with no name attached to it.\
  784. * Thanks to Jamie McCarthy for code for touching Finder folders.
  785. * Thanks to Troy Gaul for the Infinity Windoid.
  786. * Thanks to Richard Lim for the current set of icons used by Sparkle.
  787.     (Which I modified a little so it's probably best to blame me rather than 
  788.     him for poor design choices if you don't like them.)
  789. * Thanks to Stuart Cheshire for mailing me a QT 2.0beta CD-ROM and misc 
  790.     useful info.
  791. * Thanks to everyone who's mailed in bug reports or suggestions. Even when 
  792.     I can't implement suggestions at once, they go on the list for inclusion 
  793.     in a few months. 
  794. * Thanks to Apple for making the greatest computers in the world. 
  795.     (Though sadly they seem to be going completely clueless with regard to 
  796.     how to distribute their various new ideas. I fear if they don't get their 
  797.     act together about this soon, NO-ONE will support these new things 
  798.     because developers will have no idea whose machine has what on it.)
  799. * Thanks also to Symantec for creating such a great programming environment.
  800.     This program was written with Think C 5, then Think C 6  and now Think C 7 
  801.     using the Think Class Library. Having coded on Windows, X-windows, and 
  802.     the Mac, I can unreservedly say that the Mac is by far the most pleasant 
  803.     platform for a programmer.
  804. * Thanks to Richard Cowgill for providing me with the cool looking 
  805.     picture to use for a startup screen.
  806. * Thanks to Stuart Cheshire (again!) for nagging me about very MPEGs in 
  807.     very small windows and getting me to make the window-shrinking code behave
  808.     a little nicer.
  809. * Thanks to Chris Petersen for the nice new Sparkle folder icon.
  810. * Thanks to Apple (again!) for sending me a PowerMac to use so I could 
  811.     code up a native version.
  812. * Thanks to everyone who submitted bug reports and ideas. 
  813.  
  814. (If I've forgotten your name here by mistake and you really deserve to be 
  815. here, please remind me.)
  816.  
  817. Maynard Handley 
  818. maynard@elwing.otago.ac.nz
  819. March 14 1995
  820.