This package contains support for Video I/O in Bob. Video reading and writing
is implemented using either FFmpeg or LibAV, whichever is installed.
This package contains support for Video I/O in Bob.
Video reading and writing is implemented using either FFmpeg or LibAV, whichever is installed.
By importing this package, you activate a transparent plugin that makes possible reading and writing video files using :py:mod:`bob.io.base` functionalities.
Installation
------------
Install it through normal means, via PyPI or use ``zc.buildout`` to bootstrap
the package and run test units.
External Library Requirements
=============================
To properly install this package, you will need the following C/C++ components
pre-installed:
1. ``bob-io >= 2.0.0a2``
2. ``libavformat >= 52.31.0``
3. ``libavcodec >= 52.20.0``
4. ``libavutil >= 49.15.0``
5. ``libswscale >= 0.7.1``
.. note::
``libavformat``, ``libavcodec``, ``libavutil`` and ``libswscale`` are
components which are part of `FFmpeg`_ or `libav`_. We support any of these
two.
The minimum version for `FFmpeg`_ is ``0.5``, while the minimum version for
`libav`_ should be ``0.8``.
To test for the availability of the libraries listed above, use the command
``pkg-config``. For example::
$ pkg-config --modversion libavformat
55.33.100
$ pkg-config --modversion bob-io
2.0.0a3
If any of the components is not installed on paths accessible by
``pkg-config``, you have two options:
1. Set the environment variable ``PKG_CONFIG_PATH`` so that ``.pc`` files for
each of those distributions can be properly located (see ``man pkg-config``
for details);
2. If you are using ``zc.buildout`` to setup your working environment, you can
use the buildout variable ``prefixes`` to define the path to the
installation area for your external packages.
To install this package -- alone or together with other `Packages of Bob <https://github.com/idiap/bob/wiki/Packages>`_ -- please read the `Installation Instructions <https://github.com/idiap/bob/wiki/Installation>`_.
For Bob_ to be able to work properly, some dependent packages are required to be installed.
Please make sure that you have read the `Dependencies <https://github.com/idiap/bob/wiki/Dependencies>`_ for your operating system.
Documentation
-------------
For further documentation on this package, please read the `Stable Version <http://pythonhosted.org/bob.io.video/index.html>`_ or the `Latest Version <https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.io.video/master/index.html>`_ of the documentation.
For a list of tutorials on this or the other packages ob Bob_, or information on submitting issues, asking questions and starting discussions, please visit its website.
The latest version of the documentation can be found `here <https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.io.video/master/index.html>`_.
Otherwise, you can generate the documentation for this package yourself, after installation, using Sphinx::
$ sphinx-build -b html doc sphinx
This shall place in the directory ``sphinx``, the current version for the
documentation of the package.
Usage
-----
In order to enable support for video file reading and writing in your
application, make sure to import this module, before calling
:py:func:`bob.io.base.open` or similar::
>>> import bob.io.base
>>> import bob.io.video
>>> bob.io.base.open('myfile.avi', 'r')
Testing
-------
You can run a set of tests using the nose test runner::
$ nosetests -sv
.. warning::
If Bob <= 1.2.1 is installed on your python path, nose will automatically
load the old version of the insulate plugin available in Bob, which will
trigger the loading of incompatible shared libraries (from Bob itself), in
to your working binary. This will cause a stack corruption. Either remove
the centrally installed version of Bob, or build your own version of Python
in which Bob <= 1.2.1 is not installed.
You can run our documentation tests using sphinx itself::
This package provides support for dealing with videos in an equivalent way to
dealing with other data files in |project|:
This package provides support for dealing with videos in an equivalent way to dealing with other data files in |project|, i.e., by using :py:func:`bob.io.base.load` and :py:func:`bob.io.base.save`.
.. doctest::
...
...
@@ -28,11 +27,11 @@ dealing with other data files in |project|: