You are not logged in.

#1 2006-05-08 10:03:05

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Lineart Movie

I need to generate a movie from a number of plots generated with Gnuplot. Unfortunately, MPEG codecs turned out to be totally inappropriate for generating movies out of pictures containing single pixels or pixel-wide lines as main actors (I usually use something like "ffmpeg -i %d.png -y out.mp4" for more colorful and "filled out" visualizations and it works fine). The bitrate has to be set to such a high value that the resulting movie is several times larger than the input PNGs (which are lossless, of course). By the way, I don't need any color at all, 1-bit B/W is fine.

Ideally, the resulting movie should be playable by other people without much effort. I have tried to generate MNG animations but couldn't even get them to play myself (mplayer won't play them and ImageMagick fatally tries to load all images at once into memory). Someone suggested QuickTime movies to me, but I couldn't get mencoder to make one for me (although "mencoder -ovc help" shows "qtvideo"). SWF is the only working option I came up with, but it is not so ideal for me, because I need to open a browser to watch them (not so good for presentations, for example).

I would be immensely grateful for any working suggestions...

Offline

#2 2006-05-08 10:20:56

Arkamririon
Member
From: Germany
Registered: 2005-12-27
Posts: 34

Re: Lineart Movie

Maybe animated GIF is another option.

Offline

#3 2006-05-08 11:53:29

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Re: Lineart Movie

Yes, certainly, but they don't work for me, probably out of the same reason as MNGs fail. The resulting GIF has appr. 3.5 MB and won't play neither with ImageMagick nor in Opera. The computer seems to run out of memory -- it starts  swapping on the harddisk. My guess is that this is because it gets decompressed as a whole before being played. I have a total of 812 frames with a resolution of 600x600 pixels. A quick calculation shows me that this amounts to 36.5 MB if each pixel allocates 1 bit (which would not be a big problem for most computers today) and 292 MB if each pixel allocates 1 byte (which is really a lot). So, for lengthy animations with lots of frames, animated GIFs seem to be inappropriate also. :-(

Offline

#4 2006-05-08 13:20:54

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: Lineart Movie

Maybe you can use LaTeX(!), with the beamer package. Export all your figures as pdf files. 0.pdf, 1.pdf, and so one. Vector graphics, even better than png files. Then use code like this. This should at least produce a format usable for presentations. One drawback is that not many pdf-readers support this.

OPS: markup stripped -> look here

Offline

#5 2006-05-08 13:52:47

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Re: Lineart Movie

Thanks for this interesting suggestion, I will try this sometime. However, I doubt if this is really efficient for 800+ frames. And there's no way to control the framerate, is there?

I use latex-beamer for presentations anyway. Since xpdf does not show embedded movies (yet?), I usually use mplayer as an external viewer for multimedia content. For this purpose, I could also live with 25 MB MPEG files. I just thought there must be something better, something as convenient as an MPEG (just a single file, playable on many computers without effort, easily controllable during playback (stopping, advancing frame-by-frame)) but with efficient compression of "non-photographic" content...

Offline

#6 2006-05-08 14:55:56

sh__
Member
Registered: 2005-07-19
Posts: 271

Re: Lineart Movie

Did you generate the gif animations with gifsicle? Options such as --optimize and --colors 2 could greatly reduce the file size.

I have played relatively large gif animations with gifview -a (comes with the gifsicle package).

Offline

#7 2006-05-08 15:40:48

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: Lineart Movie

Had to try it myselves big_smile  Worked fine using 813 different pdf's(the same one, but renamed 813 times), file size stoped at 14mb.
http://nedrebo.org/arch/movie.tex
http://nedrebo.org/arch/movie.pdf

Kalidor wrote:

Thanks for this interesting suggestion, I will try this sometime. However, I doubt if this is really efficient for 800+ frames. And there's no way to control the framerate, is there?

I use latex-beamer for presentations anyway. Since xpdf does not show embedded movies (yet?), I usually use mplayer as an external viewer for multimedia content. For this purpose, I could also live with 25 MB MPEG files. I just thought there must be something better, something as convenient as an MPEG (just a single file, playable on many computers without effort, easily controllable during playback (stopping, advancing frame-by-frame)) but with efficient compression of "non-photographic" content...

Offline

#8 2006-05-08 16:25:50

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Re: Lineart Movie

sh__ wrote:

Did you generate the gif animations with gifsicle? Options such as --optimize and --colors 2 could greatly reduce the file size.

I have played relatively large gif animations with gifview -a (comes with the gifsicle package).

Yes, I created them with gifsicle. Didn't know about gifview, though. It seems to be the only application that can play these large GIF animations, everything else runs out of memory (and I only have 512 MB...).

Offline

#9 2006-05-08 16:28:48

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Re: Lineart Movie

lessthanjake wrote:

Had to try it myselves big_smile  Worked fine using 813 different pdf's(the same one, but renamed 813 times), file size stoped at 14mb.
http://nedrebo.org/arch/movie.tex
http://nedrebo.org/arch/movie.pdf

Well, it doesn't work in xpdf the way it's probably supposed to, but I can see the animation if I stay on the spacebar...  smile

Offline

#10 2006-05-08 16:30:32

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: Lineart Movie

Works in acroread.

Offline

#11 2006-05-08 16:59:16

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: Lineart Movie

Offline

#12 2006-05-08 17:33:23

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Re: Lineart Movie

lessthanjake wrote:

Just to see your masterpieces, I did "pacman -S acroread" to download the 36.3 MB heavy Acrobat Reader.  ;-)

Well, it does work, sort of, but what if you wanted it to rotate a bit faster and more fluently?

Offline

#13 2006-05-08 17:46:42

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: Lineart Movie

I beleive that animate only shows each frame "as short as possible" ie. the speed depends on the computer, so this may not be a good solution. Only a thing that came to my mind. BTW this was fun tongue : new animation dynamic sinus-plot

Offline

#14 2006-05-09 04:21:19

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: Lineart Movie

Is this something that would help?

link

Offline

#15 2006-05-09 07:31:13

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Re: Lineart Movie

iBertus wrote:

Is this something that would help?

link

No, because creating the stills that make up the movie is not the issue. The point is rather the movie format (as MPEG, though yielding excellent results elsewhere, is fairly inefficient for this kind of input data) and how to generate it using Linux software.

Offline

#16 2006-05-09 12:25:00

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: Lineart Movie

What about putting all the plots in a directory and using some image viewer app to slideshow them with a given speed?

Offline

#17 2006-05-09 13:24:17

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Re: Lineart Movie

jaboua wrote:

What about putting all the plots in a directory and using some image viewer app to slideshow them with a given speed?

That is possible, I have already tried it. However, I would rather have one file that I could e.g. send to someone else, put on the web, use for presentations, etc.

To put things straight, I don't have a real problem in the sense that I cannot make something work. And the particular plots which I wanted to animate are not that important either. I only wanted to know if something exists which is better suited for simple black&white plots than MPEG codecs, as I was pretty shocked about their poor performance at first (although on second thought it was clear why).

Offline

#18 2006-05-09 13:43:40

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: Lineart Movie

How about a mgn-file: http://nedrebo.org/arch/movie.mng

Offline

#19 2006-05-09 15:41:46

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: Lineart Movie

lessthanjake wrote:

How about a mgn-file: http://nedrebo.org/arch/movie.mng

I think that's been mentioned

Offline

#20 2006-05-09 15:56:20

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: Lineart Movie

jaboua wrote:
lessthanjake wrote:

How about a mgn-file: http://nedrebo.org/arch/movie.mng

I think that's been mentioned

Missed it, but it plays fine om my pc using showimg from aur, and its supposed to play on Windows using the brilliant all eating irfanview.

Offline

#21 2006-05-09 18:29:16

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: Lineart Movie

Kalidor wrote:
iBertus wrote:

Is this something that would help?

link

No, because creating the stills that make up the movie is not the issue. The point is rather the movie format (as MPEG, though yielding excellent results elsewhere, is fairly inefficient for this kind of input data) and how to generate it using Linux software.

I wasn't referring to the creation of stills, but rather the use of .ps output from gnuplot and the imagemagick conver tool to make them into an animated gif.

Offline

#22 2006-05-11 06:24:50

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Re: Lineart Movie

iBertus wrote:

I wasn't referring to the creation of stills, but rather the use of .ps output from gnuplot and the imagemagick conver tool to make them into an animated gif.

Isn't any static image, even if it's encoded in the Postscript language, a still? In other words, what advantage is the use of a vector graphic format like PS as input to ImageMagick supposed to have over what I have mentioned to have tried already?

As a matter of fact, unlike gifsicle, imagemagick fails for me to make (and play) a huge animated GIF because it requires too much memory.

Offline

#23 2006-05-11 06:37:19

Kalidor
Member
Registered: 2004-06-18
Posts: 80

Re: Lineart Movie

lessthanjake wrote:
jaboua wrote:
lessthanjake wrote:

How about a mgn-file: http://nedrebo.org/arch/movie.mng

I think that's been mentioned

Missed it, but it plays fine om my pc using showimg from aur, and its supposed to play on Windows using the brilliant all eating irfanview.

A KDE application, ugh!  :?
I couldn't yet find any method to play a large MNG. Qiv and gqview don't recognize it and ImageMagick's "animate" runs out of memory. The support for the animated GIF's successor seems to be really poor.

Just curious: what do you use to generate MNGs?

Offline

#24 2006-05-11 08:28:47

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: Lineart Movie

I used imagemagick.

Offline

Board footer

Powered by FluxBB