Ask Your Question
0

Trying to load a .mp4 Video fails

asked 2017-02-18 11:43:50 -0600

Hey guys,

I've installed ffmpeg and opencv on my linux server, like that:

git clone <ffmpeg_git_repositiory>
cd FFmpeg
./configure --enable-shared
make
sudo make install

sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

git clone <opencv_git_repositiory>
cmake <path to the OpenCV source directory>
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install

I wrote a little Python script:

import cv2
cap = cv2.VideoCapture('video.mp4')
total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))

But I'm not able to load that video and total_frames are always 0.

I did some research why this doesn't work and found tons of answers tried so many ways to install it, but it didn't worked for me.

What did I do wrong? Am I missing some detail?

I'm really annoyed and from installing it

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-20 05:16:35 -0600

pi-null-mezon gravatar image

updated 2017-02-20 05:16:59 -0600

Install cmake-gui and try to generate make file for the opencv build by it. You can see if ffmpeg support is enabled or not.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-02-18 11:38:11 -0600

Seen: 1,044 times

Last updated: Feb 20 '17