[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2010-08-19
5
Medium Priority
?
870 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Suggested Courses

649 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