0

I am trying to run some code from the internet (which works perfectly fine on another computer). But the software doesn't work because it can't open video files in openCV. According to a person I had the chance to meet, it is because I didn't install a specific thing when installing openCV or codeblocks.

I would like to know how I can figure out what I need to install to get the code to work and how I can afterwards install it.

  - I am using linux mint 
  - openCV 3.x in Code::Blocks IDE

EDIT:

The code compiles and runs perfectly fine, but what I get is the message on line 54 of my software. Yes the path to the video is correct and doesn't contain spaces! Yes I am talking about the openCV library.

This is the relevant code:

// Camera Capture
VideoCapture test("/home/john/car.mpeg");

if (!test.isOpened())
{
    cout << "file not opened"<<endl; // <- this is line 54
}

The output is file not opened.

The code I am trying to run is from this tutorial.

| improve this question | | | | |
  • 1
    What error message are you getting? Does the code compile? What do you mean by "can't open video files in openCV"? Are you talking about the openCV library? Why would it be able to open video files? It's a library, not a video player! – terdon Mar 11 '17 at 13:05
  • @terdon the code compiles and runs perfectly fine, but what I get is the message on line 54 of my software. Yes the path to the video is correct and doesn't contain spaces! Yes I am talking about the openCV library. It should be able to work with video files to do image processing. – LandonZeKepitelOfGreytBritn Mar 11 '17 at 14:45
  • then please edit your question and add this information. What error? What line? All of that should be in your question as well. We can't help unless you explain what you are doing. – terdon Mar 11 '17 at 14:47
  • @terdon updated my post :) , any suggestions? – LandonZeKepitelOfGreytBritn Mar 11 '17 at 15:08
  • @trilolil you still haven't told us what "the message on line 54 of my software" is. If the file you are trying to open readable? does it contain a valid video file or image sequence? – steeldriver Mar 11 '17 at 15:40
0

You are searching for the codec to open MPEG-1 videos:

You need libavcodec-dev to be able to decode and encode videos: https://community.linuxmint.com/software/view/libavcodec-dev

You need libmpeg2-4-dev to support MPEG-1: https://community.linuxmint.com/software/view/libmpeg2-4-dev

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.