A boot animation consists of several parts. In the root of a boot animation zip archive, there are usually two folders named part0 and part1, and a file called desc.txt.
#typical desc.txt 854 480 30 p 1 0 part0 p 0 0 part1
The first line of desc.txt contains the screen resolution (horizontal then vertical), followed by the frames per second at which the animation should be displayed. The next lines in the file depend upon the boot animation. The order that the lines appear is the order that they get displayed in. The first part of the second line is the letter "p". The next part is the amount of times that the animation folder in question gets repeated. For an animation to be repeated infinitely (until boot), use "0". The number following that is used to "pause" the animation. If you give a pause value of 10, the animation will pause on the last frame of the animation in question for 10fps. Finally, we declare the folder that contains the animation. Repeat this process for the number of animations you would like displayed.
From the example desc.txt above, we can determine that the resolution is 480x854, the frames per second of the animation is 30, the first animation, which is contained in the folder part0, will be played once, and the second animation, contained in the folder part1, will be played infinitely (until boot).
The "X", conventionally, indicates the order in which animations are played (ex: part1 comes after part0). The images (usually .png's) in these folders have a specific naming convention. This naming convention indicates the order of the images in the animation, and reiterates the resolution of the screen they are to be displayed on. It is good practice to use a 5-digit identifier for order (ex: 00000 is first, 00001 is second, etc.)
An example of a (very small) boot animation would be structured like the following:
+bootanimation.zip | | +part0 | | 480_854_00000.png | | 480_854_00001.png | | 480_854_00002.png | | 480_854_00003.png | | 480_854_00004.png | | 480_854_00005.png | +------------------ | +part1 | | 480_854_00000.png | | 480_854_00001.png | | 480_854_00002.png | | 480_854_00003.png | | 480_854_00004.png | | 480_854_00005.png | +------------------ | desc.txt +--------------------
There is a specific way that a boot animation must be archived. They need to be packed into a zip file with no compression. This is also known as a store only zip. It serves only to contain the files, not to compress them. An easy way to do this through the command line (with the zip binary installed) is:
zip -r0 bootanimation.zip desc.txt part0
The "-r" flag enables recursing into directories, and the "-0" flag chooses the store-only compression mode. Ensure that all of your animation folders are included if you have more than just a part0 folder.
For your boot animation to be played on boot, it needs to be named as bootanimation.zip and has to be located in either "/data/local/" or "/system/media/".