?
Solved

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

Posted on 2010-08-19
5
Medium Priority
?
868 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
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.
Six Sigma Control Plans
Suggested Courses

741 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