Solved

avi file created with Opencv under Linux fails although in Windows it succeeds ?

Posted on 2010-08-19
5
859 Views
Last Modified: 2013-11-13
Hi,

I have a Opencv program under windows that create an avi file from images buffer.

the main code in Opencv to save video file is that:

  CvVideoWriter* writer;
  writer=cvCreateVideoWriter(avi_name,CV_FOURCC('I','Y','U','V'),fps,cvSize(frame_w,frame_h),0);

  IplImage* img = 0;  
....
  img=cvLoadImage("img_0213.jpg");
  cvWriteFrame(writer,img);      // add the frame to the file
  img=cvLoadImage("img_0214.jpg");
  cvWriteFrame(writer,img);
....
  cvReleaseVideoWriter(&writer);




In windows, with this :" CV_FOURCC('I','Y','U','V') "  the outputed result is an raw avi file
and I can read it with VLC or WMP .

BTW the outputted avi file coming from Windows system can be too read in Linux correctly (I use Noatun)

But the problem is when I compil and run this same program in Linux (Debian), I have too an avi file (but with more small size) and  this avi file can't be read correctly (only green color is seen) under Linux and under Windows.  So it is like an encoding problem in Linux ?

The problem is under Linux but not in Windows seems like Opencv is not working well under Linux isn't it?
I heard that in Linux before installing Opencv we must Install ffMPEG first ! Is this maybe the reason ?
Or simply that the fourcc 'I','Y','U','V' is not compatible under Linux  ?

Thank you
 

0
Comment
Question by:Develprog
  • 4
5 Comments
 

Author Comment

by:Develprog
Comment Utility
Hi,

After googling I understand that ('I','Y','U','V') are compatible windows and linux so what is wrong ?

Thank you

0
 

Author Comment

by:Develprog
Comment Utility
Hi,

How to ensure that I have good installed ffmpeg in Linux ?

Thank you
0
 

Author Comment

by:Develprog
Comment Utility
Hi,

Maybe I posted on wrong topic , could someone help me ?

Thank you
0
 
LVL 69

Expert Comment

by:Merete
Comment Utility
Hi Develprog, oh dear you seem alone here talking to yourself,
Since noone has offered anything and sorry this outside my experience range as well, may I suggest you use the requestion attention tab  at the bottom right of your question, the moderators will repost your question to 2 or more suitable zones and bring more coverage so experts experienced with this will see it.
Sorry I cant assist you but help is on the way then
Kind regards Merete
0
 

Accepted Solution

by:
Develprog earned 0 total points
Comment Utility
SO I find that with XVID codec in Linux that runs well, video is created.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A short article about a problem I had getting the GPS LocationListener working.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now