Video and Animation
Open in the Padhaiko app4.1 Digital Video
Digital Video
Digital video represents moving visual scenes as a discrete time-ordered sequence of digital raster images (frames) captured and displayed at a constant frame rate (). Because of human persistence of vision, displaying at least creates the illusion of smooth, continuous motion.
Key Digital Video Parameters
- Spatial Resolution & Aspect Ratio: Width Height in pixels (e.g., ), with display aspect ratio ( standard TV, widescreen HD/UHD).
- Frame Rate (): Standard rates are (cinema), (PAL), (NTSC), and (high-motion gaming/sports).
- Progressive (
p) vs. Interlaced (i) Scanning:- Progressive (
1080p): Draws all horizontal scan lines sequentially () in every frame; sharp motion without combing artifacts. - Interlaced (
1080i): Splits each frame into two half-resolution fields—odd lines first, then even lines—halving transmission bandwidth at the cost of motion combing.
- Progressive (
- Chroma Subsampling: Exploits human vision's lower spatial sensitivity to color () than brightness () by sampling chrominance at reduced horizontal/vertical resolution over every pixel macro-block:
- : Full , , at every pixel ( samples/pixel average).
- : Full , half horizontal ( samples/pixel average; data reduction).
- : Full , half horizontal and half vertical ( samples/pixel average; data reduction; used in JPEG, H.264, Blu-ray).
4.2 Video signal representation
Analog and broadcast video signals are transmitted using three primary electrical signal representations:
| Representation | Physical Channels / Wires | Signal Structure | Visual Quality |
|---|---|---|---|
| Component Video | separate cables | or / kept completely isolated | Highest: zero color crosstalk or dot crawl |
| S-Video (Separate) | separate channels | Luminance () on one wire, modulated chrominance () on the second | Medium-high: eliminates luma-chroma interference |
| Composite Video | single wire | Luminance (), modulated chrominance (), and sync pulses combined | Lowest: susceptible to dot crawl and color bleeding |
Analog Broadcast Television Standards
| Standard | Region | Total Scan Lines | Frame Rate | Color Encoding |
|---|---|---|---|---|
| NTSC | North America, Japan | ( visible) | () | YIQ (Quadrature Amplitude Modulation) |
| PAL | Europe, Nepal, India, Australia | ( visible) | () | YUV (Phase Alternating Line to cancel hue errors) |
| SECAM | France, Russia, Eastern Europe | ( visible) | () | YDbDr (FM-modulated color difference signals) |
4.3 Computer Video Format
Computer video standards evolved from low-resolution display adapters to high-definition digital interfaces and modern compressed video containers:
Display Resolution Standards
| Format | Resolution () | Aspect Ratio | Typical Color / Era |
|---|---|---|---|
| CGA | / | (non-square) | colors / colors (1981) |
| EGA | colors from -color palette | ||
| VGA | colors () or colors () | ||
| SVGA | / / | ||
| XGA | True Color | ||
| HD () | Progressive YCbCr | ||
| Full HD () | Progressive YCbCr | ||
| 4K UHD () | / HDR |
Container Formats vs. Video Codecs
A container format (wrapper) multiplexes compressed video, audio, subtitles, and metadata, whereas a codec (coder-decoder) compresses and decompresses the raw pixel stream:
- Containers: MP4 (
.mp4, MPEG-4 Part 14), AVI (Microsoft RIFF), MOV (Apple QuickTime), MKV (Matroska), WebM (open web container). - Video Codecs: H.264 / AVC, H.265 / HEVC, VP9, AV1.
4.4 Computer- Based animation
Computer-Based Animation
Computer-based animation is the creation of moving images using computers by updating visual attributes—position, orientation, shape, color, transparency, or camera viewpoint—across successive frames over time.
Categories of Computer Animation
- 2D Animation: Operates in the plane using raster sprites, layered cels, or vector shapes (e.g., cartoons, UI micro-interactions, 2D games).
- 3D Animation: Models objects as 3D meshes, rigs them with hierarchical skeletons, applies lighting/materials, and renders scenes from a virtual camera:
- Forward Kinematics (FK): Animator sets each joint angle from root to end-effector (e.g., shoulder elbow wrist).
- Inverse Kinematics (IK): Animator places the end-effector (e.g., hand or foot), and the solver computes intermediate joint angles automatically.
- Motion Capture (Mocap): Records real human performers' joint trajectories using optical markers or inertial sensors and maps them onto 3D character rigs.
4.5 Animation Language
An animation language provides formal syntax or scripting constructs to specify how objects move, deform, and synchronize over time. They fall into three main classes:
- Linear-List Notations: Tabular frame-by-frame specifications listing frame number, target object, action, and parameters (e.g.,
42, 53, ROTATE, "wheel", 1, 360). - Declarative / Web Animation Languages: High-level markup or stylesheets describing keyframes and timelines directly:
- SMIL (Synchronized Multimedia Integration Language), SVG
<animate>, and CSS@keyframes.
- SMIL (Synchronized Multimedia Integration Language), SVG
- General-Purpose & Scene-Graph Scripting Languages: Full programming languages or 3D tool APIs controlling complex physics, conditionals, and loops (e.g., C/OpenGL, JavaScript
requestAnimationFrame, Python in Blender, Maya MEL).
@keyframes slideBounce {
0% { transform: translateX(0px); opacity: 0.2; }
50% { transform: translateX(180px); opacity: 1.0; }
100% { transform: translateX(240px); opacity: 1.0; }
}
.ball { animation: slideBounce 1.5s ease-in-out infinite; }4.6 Timeline and frame based animation
In timeline and frame-based (cel) animation, the timeline is divided into discrete frame slots (e.g., or slots per second), and the artist or system explicitly supplies the complete visual state for every single frame.
- Advantages: Total frame-level artistic freedom; ideal for complex non-rigid motion (fluid splashes, facial expressions, hand-drawn traditional animation, stop-motion).
- Disadvantages: Extremely labor-intensive to author, large memory/file footprint because every frame stores independent artwork, and tedious to edit timing globally.
4.7 Timeline and Tween-Based animation
In tween-based (keyframe) animation, the animator defines only the major keyframes (start, turning points, and end states) on the timeline, and the computer automatically generates the intermediate frames (in-betweens or tweens) via mathematical interpolation.
Types of Tweening
- Motion Tweening: Interpolates rigid geometric properties—position , rotation , and scale .
- Shape Tweening (Morphing): Interpolates vertex coordinates/contours to smoothly transform one shape into another.
- Color / Attribute Tweening: Interpolates fill color, opacity (), or lighting intensity.
Mathematical Interpolation (Linear & Easing)
Given keyframe values at time and at , normalized parameter computes intermediate value :
- Linear Interpolation (Constant Velocity):
- Non-Linear Easing (Slow-In / Slow-Out): Replaces with a smooth S-curve such as smoothstep so motion accelerates smoothly from rest and decelerates naturally before stopping.
| Aspect | Frame-Based Animation | Tween-Based (Keyframe) Animation |
|---|---|---|
| Authoring Effort | Every frame must be drawn or edited manually | Animator defines only sparse keyframes; computer interpolates |
| File Size | Large (stores full artwork per frame) | Very compact (stores keyframes + interpolation curve) |
| Smoothness Scaling | Doubling frame rate requires redrawing twice as many frames | Doubling frame rate simply evaluates at finer steps |
| Best Suited For | Hand-drawn character expressions, stop-motion, frame sprites | UI motion, mechanical parts, camera flythroughs, skeletal rigs |
4.8 Methods of controlling Animation
Animation systems control object motion through five primary mechanisms:
- Full Explicit Control: The animator manually defines every keyframe, motion path, or scripting parameter directly (keyframing, spline paths).
- Procedural Control: Motion is computed dynamically from algorithms and physical laws—particle systems (smoke, fire, rain), rigid-body dynamics, gravity, springs, and flocking simulations.
- Constraint-Based Control: Objects obey geometric or physical rules (e.g., Inverse Kinematics joints, feet staying planted on the floor, non-penetration collisions).
- Live-Action Tracking (Motion Capture / Rotoscoping): Real-world actor or camera motion is tracked electronically and transferred directly to digital characters.
- Interactive / Behavioral Control: User inputs (game controllers, touch gestures, VR headsets) or AI finite-state machines dynamically branch and blend animations in real time.
4.9 Display of Animation
Smooth on-screen display of animation requires synchronizing frame generation with the display hardware's refresh cycle:
- Double Buffering & V-Sync: Rendering directly into the visible screen memory causes flickering and screen tearing (top half showing frame , bottom half showing frame ). Double buffering renders the next frame completely inside an off-screen back buffer while the monitor scans out the front buffer, then swaps pointers instantaneously during the Vertical Blank Interval (V-Sync).
- Sprite & Blitting Engines: Moving 2D animated characters quickly over static backgrounds by copying rectangular pixel regions (BitBLT) with transparency masks or alpha channels.
- Color-Lookup-Table (CLUT) Animation: Cycling palette entries in an indexed-color framebuffer to animate waterfalls, blinking lights, or radar sweeps without touching pixel memory.
- GPU Hardware Acceleration: Offloading vertex transforms, skeletal skinning, and fragment shading to parallel GPU pipelines to sustain .
4.10 Transmission of Animation
Delivering animations over networks balances bandwidth against client rendering capability:
- Pre-Rendered Video Stream Transmission: The animation is rendered on a server/workstation into raster frames and compressed with a video codec (H.264/HEVC/AV1). Requires moderate-to-high bandwidth, but even a thin client with a basic hardware decoder can play complex photorealistic CGI.
- Symbolic / Vector & Keyframe Transmission: Instead of pixels, the server transmits compact geometry, textures, and keyframe/procedural instructions (e.g., SVG/Lottie JSON, glTF 3D scenes, game-engine state updates). Uses orders-of-magnitude less bandwidth and scales cleanly to any resolution, provided the client device has CPU/GPU power to render frames locally.
- Frame-Difference (Delta) Transmission: Sends only the dirty bounding rectangles or changed pixel runs between consecutive frames (used in animated GIFs, remote desktop VNC, and simple 2D screen sharing).
Worked Examples
1
An uncompressed () digital video runs at with per color sample. Compute the raw video bit rate in () under three chroma subsampling schemes:
- (no subsampling)
Compute average samples per pixel for each subsampling format:
Calculate bit rates ():
- :
- : ( reduction)
- : ( reduction)
2
In a tween-based animation, a sprite starts at keyframe at position and reaches keyframe ( later) at position .
- Compute the sprite's interpolated position at frame () using linear tweening.
- Recompute the position at frame using smoothstep ease-in/ease-out , and explain the visual difference.
Linear interpolation at :
Smoothstep ease-in/ease-out at : First evaluate the easing parameter:
Now interpolate:
Because , smoothstep moves slower near the start keyframe (gradual acceleration) before speeding up in the middle, giving natural physical momentum instead of abrupt robotic motion.
- Linear tween at frame : .
- Smoothstep ease-in/ease-out at frame : (starts slower for natural acceleration).
3
A animation runs at ( RGB). Compare the data volume required to transmit it over a network using:
- Uncompressed raster video frames (in , ).
- A symbolic vector/keyframe stream averaging (in , ).
Explain when each transmission approach is preferred.
Uncompressed raster video volume:
Symbolic keyframe stream volume and trade-off:
- Pre-rendered video (compressed with H.264/AV1) is preferred for photorealistic CGI or thin clients lacking 3D rendering GPUs.
- Symbolic/keyframe transmission is preferred for UI animations, vector graphics, and interactive games where ultra-low bandwidth and crisp resolution independence matter.
- Uncompressed raster video ().
- Symbolic keyframe stream (). Symbolic streams save massive bandwidth when the client can render locally; pre-rendered compressed video suits complex CGI and thin decoders.
Exercises
Practice Exercises — Video and Animation
Compare Component Video, S-Video, and Composite Video signal representations, and contrast the NTSC, PAL, and SECAM analog broadcast standards. Also explain the difference between progressive and interlaced scanning.
Video Signal Representations:
- Component Video sends three completely separate channels ( or ), eliminating crosstalk for the highest analog quality.
- S-Video separates luminance () from modulated chrominance () over two lines, preventing dot crawl.
- Composite Video multiplexes luma, chroma, and sync on one cable, trading lowest cost for color bleeding.
NTSC vs. PAL vs. SECAM and Scanning Modes:
- NTSC: lines ( visible), , YIQ color. PAL: lines ( visible), , YUV with phase alternation. SECAM: lines, , FM-encoded YDbDr.
- Progressive scanning (
p) draws all scan lines sequentially per frame; interlaced scanning (i) alternates odd and even half-resolution fields to halve bandwidth at the expense of motion combing.
Component isolates all three channels (best quality), S-Video separates and , and Composite combines all signals on one wire. NTSC uses lines at , while PAL and SECAM use lines at . Progressive renders complete frames every refresh, whereas interlaced alternates odd and even fields.
Distinguish between frame-based animation and tween-based (keyframe) animation. Explain motion tweening versus shape tweening, and list the five major methods of controlling animation.
Frame-Based vs. Tween-Based Animation:
- Frame-based animation defines every frame manually on the timeline—offering complete pixel/cel artistic control at high authoring cost and large file size.
- Tween-based animation specifies sparse keyframes while the computer interpolates intermediate frames—yielding small files and easy frame-rate scaling. Motion tweening interpolates position, rotation, and scale; shape tweening (morphing) interpolates outline geometry between shapes.
Five Methods of Controlling Animation:
- Full Explicit Control (manual keyframing/scripting).
- Procedural Control (physics equations, particle systems).
- Constraint-Based Control (Inverse Kinematics, joint/collision limits).
- Live-Action Tracking (optical/inertial motion capture).
- Interactive Control (real-time user input and state machines).
Frame-based authors every frame individually; tween-based interpolates automatically between keyframes (via motion or shape tweening). Animation is controlled through explicit, procedural, constraint-based (IK), motion-capture, or interactive methods.
Explain how double buffering with V-Sync prevents flicker and tearing during the display of animation, and compare pre-rendered video streaming against symbolic/keyframe transmission for delivering animation over networks.
Display of Animation (Double Buffering + V-Sync): If a program draws directly into the active display buffer while the monitor scans out pixels, the viewer sees partial frames (tearing) and erasure flicker. Double buffering renders the upcoming frame into an off-screen back buffer while the display reads the front buffer, swapping buffers atomically during the vertical blanking interval (V-Sync).
Transmission of Animation:
- Pre-rendered video streaming sends compressed raster pixels (e.g., H.264), requiring higher bandwidth but minimal client rendering hardware.
- Symbolic/keyframe transmission sends compact geometric objects, rigs, and interpolation curves (e.g., SVG/Lottie/glTF), using minimal bandwidth and scaling cleanly, provided the client renders frames locally.
Double buffering + V-Sync prevents tearing and flicker by rendering into an off-screen back buffer and swapping pointers only between display refreshes. Pre-rendered video transmission sends compressed pixels (higher bandwidth, thin client), whereas symbolic/keyframe transmission sends geometry and motion parameters (minimal bandwidth, local client rendering).
A PAL-rate Full-HD video ( pixels, , ) uses chroma subsampling.
- Calculate the uncompressed bit rate in ().
- Calculate the uncompressed storage needed for of this video in ().
- If compressed at a ratio, what is the compressed bit rate in ?
Uncompressed bit rate with ():
Uncompressed storage and compressed bit rate:
- Uncompressed bit rate .
- uncompressed storage .
- Compressed bit rate at .
An animated object moves and rotates linearly between Keyframe at frame () and Keyframe at frame ().
- Compute at frame using linear tweening.
- Compute the -coordinate at frame if smoothstep easing is used instead.
Linear tweening at frame ():
Smoothstep -coordinate at :
- Linear tween at frame : .
- Smoothstep -coordinate at frame : .