OpenCV with video support in recent Linux distros

There were days when we had to painstakingly go through the manual install process for getting OpenCV running on our systems. Those days are long gone, and for the good. Current day distros bundle both OpenCV and ffmpeg in their repositories, making life extremely easy for enthusiasts and geeks alike. The following 4 steps provide a fully functional OpenCV install on Fedora:

  • sudo yum groupinstall “Development Tools” “Development Libraries”
  • sudo yum install eigen2-devel CTL CTL-devel OpenEXR_CTL-libs tbb yasm yasm-devel tbb-devel OpenEXR CTL-devel  gstreamer-plugins-base-devel libsigc++20-devel glibmm24-devel libxml++-devel gstreamermm xine-lib libunicapgtk-devel xine-lib-devel gstreamermm-devel python-devel sip-macros sip vamp-plugin-sdk audacity sip-devel xorg-x11-proto-devel libXau-devel libX11-devel automake libogg-devel libtheora-devel libvorbis-devel libdc1394-devel x264-devel faac-devel xvidcore-devel dirac-devel gsm-devel zlib-devel faad2-devel speex-devel lame-devel orc-compiler orc-devel libvdpau cppunit libvdpau-devel schroedinger-devel dirac x264 lame faad2 amrwb-devel opencore-amr-devel amrnb amrnb-devel
  • sudo yum install ffmpeg ffmpeg-devel opencv opencv-devel opencv-python
  • sudo updatedb

That’s it! Dont believe me, well run a sample python or c code and see for yourself! 🙂 You can download this PDF file containing a sample code written in both python and C. Provide the video file appropriately and enjoy seeing your OpenCV installation playing a video file.

P.S : For C based codes, run gcc as:

gcc -L/usr/include/opencv -lopencv_core -lopencv_highgui -lm -o a.out fileName.c

For python based codes:

python fileName.py

Video in OpenCV

Video files in OpenCV
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s