1 2 3This file lists some example of using XAnim. 4 5 61) View one: 7 8 xanim anim.mov 9 102) View several: 11 12 xanim anim1.mov anim2.avi anim3.mpg 13 143) View one and find out what it is: 15 16 xanim +v anim.mov 17 184) For those with only a 256 color display(myself included), there 19 are many options that can control how XAnim deals with the 20 very limited number of colors. 21 22 4a) Private Colormap. (the option turns of the cmap_play_nice flag). 23 Now your X11 Window Manager(not XAnim) is responsible for 24 changing the Colormap as the ColorFocus changes(Color Focus 25 typically follows your mouse ptr. See your X11 Window Manager 26 documentation for more info). 27 28 xanim -Cn anim.mov 29 30 4b) Since XAnim can only use 256 colors(usually significantly less 31 because other applications are already using them), just 32 how does it pick when an animation is potentially made of 33 thousands of colors? 34 35 By default, XAnim creates an RGB332 colormap. Iterates between 36 every combination of 3 bits Red, 3 bits Green and 2 bits of 37 Blue(which just happens to be 256). With the -Cn option, this 38 is the colormap, without the -Cn option, this colormap is 39 further reduced depending on which of those colors, XAnim 40 can actually allocate. 41 42 BUT! We can do better. If you use the +CF4 option. XAnim 43 will scan a preset number of equally spaced frames from 44 the animation in order to sample what colors are being 45 used and then select the "best" 256 colors from the thousands 46 that are sampled. (NOTE: you can change the number of frames 47 that are prescanned with the +Cs# option). "best" actually 48 means XAnim uses a variation of the Median Cut algorithm. 49 50 Later it utilizes a colormap caches to help speed up remapping 51 each pixel in the animation to one of the available colors 52 in the colormap. 53 54 xanim +CF4 anim.mov 55 56 xanim +CF4 -Cn anim.mov 57 58 xanim +Cs20 +CF4 -Cn anim.mov 59 60 61 One other thing to note. The +CF4 will also trigger the -F option 62 which shuts off dithering for the Video Codecs that support it. 63 See 4c). You can turn dithering back on: 64 65 xanim +CF4 +F -Cn anim.mov 66 67 4c) Dithering. Dithering is slow and while it increases color resolution, 68 it does so at the expense of spatial resolution. In XAnim, I've 69 worked dithering into the decompression routines of several Video 70 Codecs(actually it's a separate alternative routine for each one 71 for speed reasons). The following Video Codecs/formats support 72 this low level dithering. Cinepak, Indeo, MPEG, JPEG, MJPG 73 and IJPG. 74 75 This option (+F) is on by default if you have a 256 color display. 76 As noted above in section 4b), it gets turned off by +CF4, but 77 can be overridden. 78 79 Dithering does slow things down, but since it's built into the 80 decompression routines, I can take several opportunities to 81 speed things up that I couldn't do if the dithering was done 82 later at a higher level. 83 84 If you have a 256 color display, you should really take the time 85 to experiment with dithering, -Cn and +CF4 options to get 86 a feel for how they affect video quality and playback speed for 87 various formats and Video Codecs. 88 89 To start with, find an animation that uses one of the above mentioned 90 codecs and then run the following command lines: 91 92 xanim anim # Dithering and shared colormap 93 94 xanim -F anim # No dithering and shared colormap 95 96 xanim -Cn anim # Dithering and private colormap 97 98 xanim -F -Cn anim # No dithering and private colormap 99 100 xanim +CF4 anim # Median Cut, no dithering, shared colormap 101 102 xanim +CF4 -Cn anim # Median Cut, no dithering, private colormap 103 104 xanim +CF4 +F -Cn anim # Median Cut, dithering, private colormap 105 1065) Scaling animations. Scaling is very cpu intensive and will 107 cause slow downs in playback. Also, at the moment, XAnim 108 dithers before scaling and this causes/enhances artifacts in the 109 image. Best to use the +CF4 option instead. 110 111 On the fly scaling requires the +Sr option: 112 113 xanim +Sr anim.mov 114 115 See "xanim.readme" for a more detail discusion of image and buffer 116 scaling. 117 118 1196) Need for Speed! Almost all animations formats indicate how fast 120 XAnim play each frame. You can over ride this with the [-] and [+] 121 buttons of the remote control OR you can force frame timing 122 with the +j# option where # is given in milliseconds. If # is 0, 123 then forced timing is turned off and the timing specified by the 124 animation is used again. 125 126 This is useful in benchmarking where you want XAnim to play as 127 fast as possible(NOTE: see 7) for the +t option) 128 129 xanim +j1 +t +l5 anim.mov 130 131 Or for slideshows 132 133 xanim +bC1d +j5000 image1.jpg image2.jpg +j8000 image3.jpg 134 1357) Benchmarking. The +t option will indicate how long it took XAnim 136 to display the command line. Since XAnim loops on the command 137 line by default, you will get the time of each of these loops. 138 Typically, the +j1 option is used to force as-fast-as-possible 139 playback. 140 141 xanim +tj1 anim.mov 142 143 If the animation is short, you might want to time it over a longer 144 period of time. Since the timing is done over the entire command 145 line, you can use the +l# option to loop the animation. In the 146 example below, anim.mov is looped 5 times each time the command 147 line is looped. 148 149 xanim +tj1 +l5 anim.mov 150 151 Since +t also reports how many frames were dropped because of 152 audio/video synchronization, it's sometimes useful to not 153 specific +j1. 154 155 xanim +t anim.mov 156 1578) Audio, what? AUDIO! Audio is enabled by default. You can 158 turn it off with -Ae 159 160 xanim -Ae anim.mov 161 162 You can select the speaker output with the SPEAKER env variable: 163 164 setenv SPEAKER INTERNAL 165 setenv SPEAKER HEADPHONES 166 setenv SPEAKER EXTERNAL 167 168 The above is for csh, for bourne shell(sh) do the following 169 170 SPEAKER=INTERNAL 171 export SPEAKER 172 173 Note: No spaces around the "=" sign are allowed. 174 175 176 You can also specify audio port with the +Ap# command. See xanim.readme. 177 178 179 Currently, XAnim automatically sets the volume. This will change in 180 the near future, but until then you can use the +Av# option to 181 set the volume. The range is bewteen 0 and 100. You can also 182 compile this in. See the DEFAULT_XA_AUDIO_VOLUME define in 183 the "xa_config.h" file. 184 185 186