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 – creating custom audio by combining clips


Let's develop an application where we will combine multiple audio clips into a single audio file.

  1. Download the file CombiningAudio.py. This file contains all the code necessary to run this application. As done earlier, we will discuss only the most important methods in this class.

  2. Write the following code.

    1  import os, sys, time
    2  import thread
    3  import gobject
    4  from optparse import OptionParser
    5
    6  import pygst
    7  pygst.require("0.10")
    8  import gst
    9
    10 class AudioMerger:
    11     def __init__(self):
    12         pass
    13     def constructPipeline(self):
    14         pass
    15     def addFadingEffect(self):
    16         pass
    17     def setupFadeBin(self):
    18         pass
    19     def addGnlFileSources(self):
    20         pass
    21     def gnonlin_pad_added(self, gnonlin_elem, pad):
    22         pass
    23     def run(self):
    24         pass
    25     def connectSignals(self):
    26         pass
    27     def printUsage(self):
    28         pass
    29     def printFinalStatus...