The author published this blog in order to get the sea Conway as the code flow fee Dickens, of course, may also be the author of the dish, but since the toss out, they share out for everyone to reference and study. Of course, if there is a better plan, I hope the brothers can share a good plan to come. Compile the installation process as follows:
1. Extract xvidcore_1.3.3.orig.tar.gz files into the xvidcore-1.3.3 folder, execute the following command
CD xvidcore-1.3.3/
CD build/generic/
./configure--prefix=/usr
make
sudo make install
2. Install libx264, execute command sudo apt-get install Libx264-dev
3. Compile and install FFmpeg, extract ffmpeg-3.1.2.tar.bz2 files to ffmpeg-3.1.2 folder, execute the following command:
./configure --prefix=/usr/local/ffmpeg/ --ENABLE-GPL--enable-libfaac--enable-libmp3lame- Enable-libopencore-amrnb--ENABLE-LIBOPENCORE-AMRWB--enable-libtheora--enable-libvorbis--enable-libx264-- Enable-libxvid--enable-nonfree--enable-postproc--enable-version3--enable-x11grab
make
sudo make install
sudo vim/etc/profile
Add at the bottom line
Export ld_library_path= "$LD _library_path:/usr/local/ffmpeg/lib/"
souce/etc/profile
4. Download opencv2.4.13, after decompression into the directory, the author is using opencv-2.4.13, execute the following command
CD ~/opencv-2.4.13/
mkdir build
CD
The following make command because the author installs the Cuda, therefore inside uses cuda_generation=auto this compilation option, does not use Cuda compiles the child shoe to be possible to delete this piece configuration to compile.
cmake-d cmake_build_type=release-d cmake_install_prefix=/usr/local-d build_tiff=on-d build_examples=on-d CUDA_ generation=auto-d build_new_python_support=on --withffmpeg .
Make
sudo make install
5. If the above libraries are successfully compiled and installed, you can execute the following test code:
Import cv2
cap = Cv2. Videocapture ("RTSP://ADMIN:ADMIN@192.168.2.64:554//STREAMING/CHANNELS/1")
print cap.isopened ()
while Cap.isopened ():
ret,frame = Cap.read ()
cv2.imshow ("frame", frame)
Cv2.waitkey (1)