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 – crop a video


Let's add another video manipulation feature to the command-line video player developed earlier.

  1. The file we need here is the one used in the earlier section, VideoManipulations.py.

  2. Once again, we will focus our attention on the constructVideoPipeline method of the class VideoPlayer. The following code snippet is from this method. The rest of the code in this method is identical to the one reviewed in the earlier section.

    1  self.videobox = gst.element_factory_make("videobox")
    2  self.videobox.set_property("bottom", self.crop_bottom )
    3  self.videobox.set_property("top", self.crop_top )
    4  self.videobox.set_property("left", self.crop_left )
    5  self.videobox.set_property("right", self.crop_right )
    6
    7  self.player.add(self.videoQueue,
    8                  self.autoconvert,
    9                  self.videobox,
    10                 self.capsFilter,
    11                 self.colorSpace,
    12                 self.videosink)
    13
    14 gst.element_link_many(self.videoQueue,
    15    ...