Book Image

Python Multimedia

By : Ninad Sathaye
Book Image

Python Multimedia

By: Ninad Sathaye

Overview of this book

Multimedia applications are used by a range of industries to enhance the visual appeal of a product. This book will teach the reader how to perform multimedia processing using Python. This step-by-step guide gives you hands-on experience for developing exciting multimedia applications using Python. This book will help you to build applications for processing images, creating 2D animations and processing audio and video. Writing applications that work with images, videos, and other sensory effects is great. Not every application gets to make full use of audio/visual effects, but a certain amount of multimedia makes any application a lot more appealing. There are numerous multimedia libraries for which Python bindings are available. These libraries enable working with different kinds of media, such as images, audio, video, games, and so on. This book introduces the reader to the most widely used open source libraries through several exciting, real world projects. Popular multimedia frameworks and libraries such as GStreamer,Pyglet, QT Phonon, and Python Imaging library are used to develop various multimedia applications.
Table of Contents (13 chapters)
Python Multimedia Beginner's Guide
Credits
About the Author
About the Reviewers
Preface

Time for action – fading effects


Let's add fade-out effect to an input audio. We will use the same source file as used in the Adjusting volume section.

  1. If you haven't already, download the file AudioEffects.py that has the source code for this example.

  2. In the __init__ method of this class, you will need to do one small change. Set the flag self.fade_example to True so that it now runs the code that adds fade-out effect.

  3. We already reviewed the self.constructPipeline() method in Adjusting volume section. It calls the method self.setupVolumeControl().

    1 def setupVolumeControl(self):
    2     self.volumeControl = gst.Controller(self.volume,
    3                                          "volume")
    4     self.volumeControl.set("volume", 0.0*gst.SECOND,
    5                             self.volumeLevel)
    6     self.volumeControl.set_interpolation_mode("volume",
    7                                     gst.INTERPOLATE_LINEAR)
  4. The GStreamer Controller object is created on line 2. It is a light-weight object that provides...