Solved

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

Posted on 2010-08-19
5
864 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

856 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