Solved

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

Posted on 2010-08-19
5
861 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
ID: 33475761
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
ID: 33476234
Hi,

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

Thank you
0
 

Author Comment

by:Develprog
ID: 33482496
Hi,

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

Thank you
0
 
LVL 70

Expert Comment

by:Merete
ID: 33557980
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
ID: 33659939
SO I find that with XVID codec in Linux that runs well, video is created.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

911 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

25 Experts available now in Live!

Get 1:1 Help Now