FFMPEG - decode .avi to data/frames

For the developers that use FFmpeg in their software.
Post Reply
Beast
Posts: 4
Joined: Fri Dec 02, 2011 1:42 pm

FFMPEG - decode .avi to data/frames

Post by Beast » Sun Dec 04, 2011 5:50 pm

Hello,
I have a question. I want to get the data from an .avi-file.
I want to separate the data and save it into a string/character array.
Then I do something with this string and after that I want to save it again into an .avi-file.
How can I do this?
I found some tutorials for the usage of ffmepg/livav but I have problems to compile these.
Has anybody a finished code example?
For me it's a big problem because there are many different versions of ffmpeg/libav with different functions.

Thanks for help!

PS:
I'm sorry but I'm a German guy, so my English isn't perfect.

dentad
Posts: 2
Joined: Fri Nov 25, 2011 12:29 am

Re: FFMPEG - decode .avi to data/frames

Post by dentad » Mon Jan 09, 2012 4:06 am


Beast
Posts: 4
Joined: Fri Dec 02, 2011 1:42 pm

Re: FFMPEG - decode .avi to data/frames

Post by Beast » Tue Jan 10, 2012 2:10 pm

Thanks for answer but that's not what i need.

I found a tutorial at: http://dranger.com/ffmpeg/tutorial01.html
which helps me a lot.

I can compile it and it nearly does what I want.

But now I have a different problem.

When I save the data into .ppm I get an image with three same pictures in it.
I wanted to add this file but it isn't allowed to attach ppm files.
Please look at (unfortunately I had to make a pdf file)

http://s14.directupload.net/file/d/2765 ... ql_pdf.htm

Also it's interesting that the video is RGB and the image I get is grayscale. I think here can be the problem.

What I need is a normal image.

How can I do this?

Thanks for help!

Beast
Posts: 4
Joined: Fri Dec 02, 2011 1:42 pm

Re: FFMPEG - decode .avi to data/frames

Post by Beast » Wed Feb 01, 2012 6:36 am

Can nobody help me?

Beast
Posts: 4
Joined: Fri Dec 02, 2011 1:42 pm

Re: FFMPEG - decode .avi to data/frames

Post by Beast » Tue Feb 14, 2012 9:49 am

Now I found a solution.
I am using the sws_scale function and the result for an example video (MPEG) is good.

But now I want to the same with a video with raw data.

Without sws_scale I get images but they are wrong (wrong format, wrong data content).

With the sws_scale function I want to change from PIX_FMT_BGR24 to PIX_FMT_GRAY8. But there the programm crashes.
I assert that in linesize[0] is a negative value. I thought there must be the same value as in height.
Why doesn't sws_scale run in the right way?

Post Reply
'