A ZIP reader can open the first test file below. The second file has the same extension and plays in the same viewer, but needs a different decoder.
Read movie.spec with Python
Download the 96 × 64 SVGA 1.x test pattern. Run this code in the download directory with Python 3. The output gives a 96 × 64 canvas, 12 frames per second, 12 frames, 12 images and 12 sprites.
import json
from zipfile import ZipFile
with ZipFile("test-pattern-1.x.svga") as archive:
spec = json.loads(archive.read("movie.spec"))
movie = spec["movie"]
print(movie["viewBox"], movie["fps"], movie["frames"])
print(len(spec["images"]), len(spec["sprites"]))
In this archive, movie.spec is a JSON document at the root. Follow the first sprite’s imageKey into the images map to find the bitmap named img_0001.png. Its visibility and transform on each frame live in the sprite’s frames array. Another file may reuse one bitmap for many frames. SVGA 1.x specification
Read a 2.x animation
Download the 640 × 640 SVGA 2.0 sample. Inflate this file with zlib, then decode the result as a Protobuf MovieEntity. Canvas size, FPS and frame count are in params. Sprites refer to entries in images by key. Some ZIP containers carry a binary description named movie.binary, which also needs a Protobuf decoder. 2.x schema · Android parser
Open the second file in the SVGA viewer. You should see 24 FPS and 120 frames, or five seconds per loop. If your own asset plays here and fails in your app, try the same sample in the app and check which file versions its player accepts.
For the complete magic-byte container rules, movie.spec vs movie.binary comparison, and field-by-field Protobuf definitions (MovieEntity, SpriteEntity, FrameEntity, ShapeEntity, AudioEntity, and matteKey), read the SVGA format specification or download svga.proto directly. To automate parsing, asset extraction, or SVGA 2.0 packing in Python, continue to the SVGA Python guide and test samples library.
