[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: avifile (and all that jazz)

From: Fredrik Lingvall
Subject: Re: avifile (and all that jazz)
Date: Tue, 15 Sep 2009 21:20:22 +0200

You can do this by generating a series of, for example, png-images and then let mencoder put them together to an avi-file. Something like:

png_path = 'png/';

for k=1:K

     % Plot the k:th image here.

     if k<10
        eval(['print("' png_path 'snapshot_000' num2str(k) '.png", "-dpng");']);
      elseif k<100
        eval(['print("' png_path 'snapshot_00' num2str(k) '.png", "-dpng");']);
      elseif k<1000
        eval(['print("' png_path 'snapshot_0' num2str(k) '.png", "-dpng");']);
        eval(['print("' png_path 'snapshot_' num2str(k) '.png", "-dpng");']);

system(['mencoder -quiet mf://png/*.png -mf w=640:h=480:fps=' ...
            '25:type=png -ovc lavc -lavcopts vcodec=wmv1 -oac copy -' ...
            'o snapshots.avi']);


On Fri, Sep 11, 2009 at 8:19 PM, Kristen Richter <address@hidden> wrote:
Dear helpful mailing list,

I am attempting to turn a series of plots into an avifile.  While I've installed the video add-on package from Octave-forge, I can't add frames to my .avi because the AVHandler can't seem to find the appropriate codecs.  Using the example below, found here:

# Open the AVI file
m = avifile("test.avi", "codec", "msmpeg4v2")

# Generate and add frames
for i = 1:100
 I = zeros(100,100);
 I(i,:) = i;
 I(:,i) = 200-i;
 addframe(m, I/255)

# Close the file
clear mI get the following error:

AVHandler: cannot find codec msmpeg4v2
error: avifile: AVHandler setup failed
addframe: error adding frame to avifile
I've tried the example, specifying many different codecs, including cinepak, indeo5, and indeo3.  I've checked my synaptic package manager for appropriate codecs... currently I've installed libavifile (vs. 0.7), which mentions the indeo library by name.

Are the codecs supposed to be installed in a specific directory? Has anyone come across similar issues in the past?
The example is pretty old... dated 2005, and I know the video package was updated last this past May.

Any insight on the situation would be greatly appreciated. As always, your help in the past has been invaluable.

-Kristen Richter

By the way, does anyone know of a good work around for the getframe function?... I have yet to think of a good way to capture the figure on the screen into an appropriately formatted image matrix.

Help-octave mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]