Animation and Video Basics: Frames, Duration and File Size
Learn frame rate, duration and bitrate, build and measure a real GIF, estimate video file sizes, and choose between GIF and MP4.
In this lesson you will
- Explain frames, frame rate and duration
- Estimate a video file size
- Choose between GIF and MP4
- Use animation to guide attention
About 22 minutes
A poster that moves
Anil wants the reading club announcement to move on the library screen: the title slides in, then the date. He has never made a video and thinks it is complicated. It is less complicated than it looks, because a video or an animation is only a long list of still pictures, called frames, shown quickly one after the other. Once you know the three numbers that describe it, you can plan an animation, estimate its size and choose the right file type.
Three numbers
- Frame rate, written as fps (frames per second): how many pictures are shown each second. Films often use 24, and many online videos use 30. A simple animation can look fine at 10 to 15.
- Duration: how long it lasts, in seconds.
- Size in pixels: width and height, as for any design. The number of frames in the finished piece is the frame rate times the duration.
Canva lets you animate pages and individual elements, add transitions between pages, and add music or video clips, and it can download the result as an MP4 video or a GIF. The help pages describe a GIF as a good choice for short looping animations and an MP4 for designs that include video and sound. Which animation styles and export options you see can depend on your plan and device.
A real animation, built and measured
The program below builds a tiny animation from scratch: twelve frames in which a pink circle crosses a dark square, saved as a GIF with 100 milliseconds on each frame. Then it reopens the file and asks it about itself, which is a good habit with any file you make. It finishes with some video maths.
import os
from PIL import Image, ImageDraw
N, SIZE, MS = 12, 360, 100
frames = []
for i in range(N):
img = Image.new("RGB", (SIZE, SIZE), (20, 17, 46))
x = 40 + i * (SIZE - 120) / (N - 1)
ImageDraw.Draw(img).ellipse((x, 140, x + 80, 220), fill=(240, 108, 194))
frames.append(img)
frames[0].save("move.gif", save_all=True, append_images=frames[1:], duration=MS, loop=0)
g = Image.open("move.gif")
print("frames:", g.n_frames)
print("ms per frame:", g.info["duration"])
print("loop forever:", g.info.get("loop") == 0)
print(f"length: {g.n_frames * g.info['duration'] / 1000:.1f} s")
print(f"frame rate: {1000 / g.info['duration']:.0f} fps")
print(f"gif size: {os.path.getsize('move.gif') / 1024:.1f} KB")
# video maths: frames and a rough file size from the bitrate
seconds, fps, mbps = 15, 30, 4
print()
print("15 s at 30 fps:", seconds * fps, "frames")
print(f"at {mbps} Mbit/s: about {mbps * seconds / 8:.1f} MB")
colours = {c for f in frames for n, c in f.getcolors()}
print("colours in the frames:", len(colours))
frames: 12
ms per frame: 100
loop forever: True
length: 1.2 s
frame rate: 10 fps
gif size: 6.2 KB
15 s at 30 fps: 450 frames
at 4 Mbit/s: about 7.5 MB
colours in the frames: 2
The file reports 12 frames at 100 milliseconds each, which makes the animation 1.2 seconds long and a frame rate of 10 frames per second. It loops forever, as a banner or social animation usually should. The file is only 6.2 KB, tiny, but that is because the pictures are simple: only 2 different colours appear in all twelve frames. A GIF can show at most 256 colours per frame, so it suits flat graphics and handles photographs badly, which is why the same trick with a photo makes much bigger, grainier files.
Now the video maths in the last lines. A 15 second video at 30 frames per second needs 450 frames. The file size depends mainly on the bitrate, how much data is used for each second of video. At a bitrate of 4 megabits per second, 15 seconds comes to about 7.5 megabytes, found by multiplying and dividing by 8, because there are 8 bits in a byte. That is only an estimate, because real encoders vary the bitrate with the amount of movement, but it is good enough to know whether your video will be 5 megabytes or 500.
Choosing the right file
- GIF: short loops, simple graphics, no sound. Limited colours.
- MP4: longer videos, photographs and sound. Much better quality per kilobyte for anything complex.
- Still image: if the movement adds nothing, a still is smaller, faster and more accessible.
Animation that helps
Movement draws the eye, which is both its power and its risk. Use it to guide attention to one thing at a time, such as the date appearing after the title. Keep movements short and calm, usually under a second each, and avoid animating everything at once. Loops that flash rapidly can be uncomfortable or even harmful for some viewers, so avoid flashing and keep your animation gentle.
Planning a short animation
- Decide the one thing that should move and why.
- Choose the length, often 5 to 15 seconds for social media, and the size.
- Build the still version first, so the layout is solid.
- Add animation to a few key items only, and keep timing consistent.
- Preview it, then download it as GIF or MP4 and check the file size.
- Watch the finished file on a phone, with the sound off, to see whether it still makes sense.
Making a GIF out of a photograph or a long video clip. The file becomes huge and grainy. Use MP4 for photographs and long clips, and keep GIFs for short, flat-colour loops.
Many people watch with the sound off. If your message is in the sound, add on-screen words, so that the video still works in silence.
Practice for this lesson
Check what you learned
Five quick questions. Pick an answer and you will see straight away whether it is right and why.
What is a frame?
- A picture border
- A font weight
- A page size
- One still picture in an animation
An animation is a list of still pictures, called frames, shown quickly in order.
How do you find the number of frames in a video?
- Width times height
- Frame rate times duration
- Bitrate divided by two
- File size minus one
A 15 second video at 30 frames per second has 15 times 30, or 450, frames.
Which file type suits a short, flat-colour loop?
- A document file
- A font file
- A logo file
- GIF
GIF works for short loops of simple graphics but handles photographs poorly.
What does bitrate mainly decide?
- How big the video file is
- The colour of the video
- The page margin
- The font
Bitrate is data per second, so a higher bitrate makes a larger file.
Why add words to a video?
- Videos need text to play
- Words make videos longer
- Many people watch with sound off
- It changes the frame rate
On-screen words keep the message clear when the sound is off.
Summary
- Animations are lists of frames, set by frame rate and duration.
- File size comes mostly from bitrate, and a rough estimate is bitrate times seconds divided by 8.
- GIFs suit short flat loops, MP4s suit photographs, sound and longer clips.
- Keep motion short and gentle, and design for silence.
Questions
What frame rate should I use?
Many online videos use 30 frames per second. Simple animations can look fine at 10 to 15. Higher rates make larger files.
Why is my GIF so large?
GIFs store each frame as a picture, so photographs and long loops make large files. Use MP4 for those, or shorten and simplify the animation.
Can I add music in Canva?
Canva offers audio you can add to designs, subject to its licence rules and your plan. Check the rules before using music commercially.
