Video and Animation
Prof. S. Shakya
                        1
Motion
   Both video and animation give us a sense of
    motion
   They exploit some properties of human eye’s
    ability of viewing pictures
   Motion video is the element of multimedia
    that can hold the interest of viewers in a
    presentation
                                                  2
Visual Representation
   The visual effect of motion is due to a biological
    phenomenon known as persistence of vision
   An object seen by the human eye remains mapped on the eye’s
    retina for a brief time after viewing (approximately 25 ms)
   Another
    A    th phenomenon
               h            contributing
                                t ib ti  to
                                         t the
                                            th vision
                                                i i   off motion
                                                            ti   is
                                                                 i
    known as phi phenomenon
   When two light sources are close by and they are
    illuminated in quick succession,
                          succession what we see is not two
    lights but a single light moving between the two points
   Due to the above two phenomena of our vision system, a
    discrete sequence of individual pictures can be perceived as
    a continuous sequence
                                                                  3
Visual Representation
   Temporal aspect of Illumination—To represent
   visual reality, two conditions must be met the rate of
    repetition of the images must be high enough to guarantee
    smooth motion from frame to frame
   the rate must be high enough so that the persistence of
    vision extends over the interval between flashes
   The frequency at which the flicking light source must be
    repeated before it appears continuous is known as the
    f i
    fusion  frequency
            f
•   This depends on the brightness of the light source
•   The brighter the light source the higher the fusion frequency
   It is known that we perceive a continuous motion to happen
    at any frame rate faster than 15 frames per second
   PAL television system
                     y      has a frame rate of 25 frames/s
                                                                    4
Visual Representation
   Another problem known as flicker occurs
    due to a periodic fluctuation of brightness
    p
    perception
          p
    A technique known as interleaving
    improves the view by
    -dividing a frame into two fields, each contains
  t ea
  the alternative
        te at e sca
                  scan lines,
                          es, a
                              and
                                d
- displaying the field in twice of the frames rate
                                                       5
Video resolution
    The smallest detail that can be reproduced in the image is a
     pixel
       i l
     Practically, some of the scene inevitably fall between
     scanning lines, so that two lines are required for such
     picture elements
    Only about 70% of the vertical detail is presented by
    the scanning lines
     Aspect ratio is the ratio of the picture width to height.
    It is 4:3 for conventional TV
    The picture width, horizontal resolution and the total detail
     content of the image can be calculated
                                                                     6
Video resolution
  Conventional video systems have relative low resolution
- compare to computer screens: typical resolution of
 640 x 480, even up to 1024 X 768
 One consequence
               q       of this low resolution is that video played
                                                            p y
   on computer screen are usually in a small window
 On the other hand, even with this low resolution, the amount
   of data in video is huge
Consider PAL TV at 25 frames per second, if we sample at
352 x 288 with 16 bits per pixel, the raw video size is
352 x288 x16 x 25 = 40.55Mbit/s = 5Mbytes/s
-Compare this with a typical Ethernet bandwidth of 10Mbit/s
-or a double speed CD-ROM drive of 300Kbyte/s
   Therefore we need to compress the video data
    Therefore,
                                                                 7
Digitalising Video
   We need to capture or digitize video for playing back on
    comp ters or integrating into m
    computers                       multimedia
                                       ltimedia applications
   We need to take a lot of samples
   At 25 frames per second, each frame requires 1/25 = 40ms
   There 625 scan lines in each frame
                                   frame, giving each scan line is
    40ms/625 = 64µs
   At a horizontal resolution of 425 pixel, the time for sampling
    each ppixel is 64µs/425
                     µ      = 0.15µs
                                  µ , i.e.,, sampling
                                                p g rate is at least
    7Mhz
   This requires very fast hardware
   Hardware required to capture video:
•   Video sources: TV, VCR, LaserDisc player, Camcorder
•   Video capture card
•   Storage space: large hard disk
                                                                   8
Video capture cards
 There are many different video capture cards on the market
The common features in these cards are:
 Can accept composite video or S-VHS in NTSC or PAL;
  high-end capture cards can accept digital video (DV)
  Video input mixer and ADC— to select/combine video
  sources, to convert analog video signal to digital samples
 Video frame buffer— temporary storage for video frame
  Video processor— to filter or enhance the video frame, e.g.,
  reduce noise, adjust brightness, contrast and colour
 Compressor/encoder—
       p                   to compress
                                 p     and encode the digital
                                                         g
  video into a required format
  Interface to the system PCI bus
                                                              9
Video capture cards
                      10
Video formats
   AVI (Audio Video Interleaved) format was defined by
    Microsoft for its Video for Windows systems
   It supports video playback at up to 30 frames per second on
    a small window (typical size 300X200 with 8 or 16 bit colour)
   It is a software-only system
    It supports a number of compression algorithms
    QuickTime was originally developed by Apple for storing
    audio and video in Macintosh systems
   It supports video playback at up to 30 frames per second on
    a small window (typical size 300X200 with 8 or 16 bit colour)
   It is a software-only system
    It supports a number of compression algorithms
                                                                11
Animation
   To animate something is, literally, to bring it to life
    An animation covers all changes that have a
    visual effect
   Visual effect can be of two major kinds:
   motion dynamic— time varying positions
    update dynamic— time varying shape, colour,
    texture or even lighting,
    texture,         lighting camera position,
                                        position etc
                                                 etc.
   The visual effects is the result of exploiting the
    properties of human vision system as described
    above (in the section about video)
    A computer animation is an animation performed
    by a computer using graphical tools to provide
    visual effects
                                                          12
Input process
   The first step in producing computer animation is input
    process
    Key frames have to be created and input into the computer
   Key frames are the frames in which the objects being
    animated are at extreme or characteristic positions
   They can be drawn using traditional artistic tools, such as
    pen and brush, and then digitised
   The digital images may need to be cleaned up
   They can also be created using drawing or painting tools
    directly
    In composition stage, the foreground and background
    figures are combined to generate the individual frames
                                                                  13
Inbetween process
   The animation of movement from one
    position to another needs a composition
    of frames with intermediate p
                                positions in
    between the key frames
   The process of inbetweening is performed
    in computer animation through
    interpolation
         p
   The system is given the starting and ending positions
   It calculates the positions in between
                                                            14
Inbetween process
   The easiest interpolation is linear interpolation
   It has many limitations: the object does no move smoothly, look
    unreal
   Spline interpolation can make object move more smoothly
   I b
    Inbetweening
               i   also
                    l involves
                        i   l   interpolating
                                i      l i    the
                                               h shapes
                                                  h     off
    objects
   Some animation involves changing the colour of objects
   This is
    Thi  i usually
                ll done
                   d    using
                           i colour
                                l     look-up
                                      l k     table
                                                bl (CLUT)
   By cycling through the colours in the CLUT, the objects’ colours will
    change
   Morphing is a popular effect in which one image transforms
    into another
                                                                            15
Controlling animation
    Full explicit control —the animator provides a description of
    everything that occurs in the animation
    either by specifying simple changes, such as scaling,
    transformation
   or by providing key frames
   Procedural control —using a program to calculate the position,
    angle, etc. of the objects
   In physical systems, the position of one object may influence the
    motion of another
    Constraint-based systems —movement of objects that are in
    contact with each other is constraint by physical laws
   An animation can be specified by these constraints
   Tracking live action —
   People or animals act out the parts of the characters in the
    animation
   The animator trace out the characters
                                                                        16
Controlling animation
   Kinematics refers to the position and velocity of points
   The ball is at the origin at time t = 0. It moves with a constant
    acceleration in the direction (1,1,5) thereafter.
   The final result of an animation is the sum of all the steps. If
    it does not fit
                fit, the animator has to try again
                                             again. This is known
    as forward kinematics.
    Inverse kinematics (IK) is concerned with moving a
    skeleton from one pose to another.
                                 another
   The animator specifies the required position of the end effecter, the IK
    algorithm will calculate the joint position, angle, etc.
   Dynamics
      y      takes into account the p
                                    physical
                                       y     laws that g
                                                       govern
    the masses and forces acting on the objects
   The ball is at the origin at time t = 0 second. It has a mass of 200 grams. The
    force of gravity acts on it.
                                                                                      17
Displaying animation
   The rules governing the showing of video apply to
    animation as well
                    ell
   The frame rate should be at least 10, preferably 15 to 20, to
    give a reasonably smooth effect
    There are basically three common ways to display
    animation
    Generate a digital video clip
   Manyy Animation tools will export
                                 p an animation in common digitalg
    video format, e.g., QuickTime
   Create a package including runtime system of the animation
    tool
   F example,
    For       l DiDirector
                        t can createt a projector
                                           j t including
                                                  i l di allll casts.
                                                                  t
    The projector can then be distributed and play the animation.
   Show the animation in the animation tool
                                                                    18
Animation tools
   Macromedia Director and Flash
   It is one of the most popular interactive animation
    tool for generating interactive multimedia
    applications
    MetaCreations Poser
   It understands human motion and inverse kinematics, e.g., move an
    arm the shoulders will follow.
   Discreet 3D Studio Max
   Very
       y popular
         p p     for creating
                            g 3D animations
   Animation language—VRML (Virtual Reality
    Modeling Language)
                                                                        19
Video formats
MPEG (Motion Picture Expect Group) is a working group under
  ISO
  There are several versions of mpeg standard.
 The most commonly used now is mpeg-1
  It requires hardware support for encoding and decoding (on
  slow systems)
  The maximum data rate is 1.5Megabit/sec
 The next generation mpeg-2 is now getting popular
  Mpeg-2 improves mpeg-1 by increasing the maximum data
   rate to 15Mbit/sec
 It can interleave audio and video
                                                            20