making quicktime animations from linux

This isn't strictly a matplotlib question, but I'm hoping
dual mac/linux users can provide some advice on converting png
files to quicktime movies using mencoder on Ubuntu or Centos.
So far I've found that

1) starting with
http://matplotlib.sourceforge.net/examples/animation/movie_demo.html
using

mencoder mf://*.png -mf type=png:w=800:h=600:fps=25\
    -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi

produces an avi file that works with Ubuntu/mplayer, but
fails with Windows Media Player.

2) changing the codec based on Making Movies - PyMOLWiki

mencoder -mc 0 -noskip -skiplimit 0 -ovc lavc -lavcopts vcodec=msmpeg4v2:vhq "mf://*.png" -mf type=png:fps=18 -o output.avi

works with mplayer and windows media player, but won't play
on macs (unless they install vlc).
When I try to convert the avi file to quicktime using

h264enc -2p -p qt

and accepting all defaults
it makes it through both passes, gets to
"converting avi file to mp4 container"
and exits the "-> Failed!"

Any pointers appreciated. I'm open to any linux based
solution that produces animations
that can be be viewed on all three platforms -- thanks, Phil

I use::

ffmpeg -r 60 -i frame%05d.png -vcodec wmv2 -b 2000k out.avi

And this works well to generate movies that play on Windows, Mac and
Linux. As a bonus, these movies can be included in Latex/Beamer output
using the movies15 package and played within the PDF via Adobe Reader on
Mac and Windows. (I'm sure it's just a matter of time before the linux
PDF readers can do this, too.) Finally I feel I am near a an end to my
cross-platform, doesn't-suck presentation-with-movies quest. I only wish
the movie format required to make this possible was less license and
patent encumbered...

I have been encoding on Ubuntu Jaunty with libraries from mediabuntu. I
haven't tested the above using the plain Ubuntu ffmpeg yet.

-Andrew

Philip Austin wrote:

···

This isn't strictly a matplotlib question, but I'm hoping
dual mac/linux users can provide some advice on converting png
files to quicktime movies using mencoder on Ubuntu or Centos.
So far I've found that

1) starting with
http://matplotlib.sourceforge.net/examples/animation/movie_demo.html
using

mencoder mf://*.png -mf type=png:w=800:h=600:fps=25\
    -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi

produces an avi file that works with Ubuntu/mplayer, but
fails with Windows Media Player.

2) changing the codec based on http://pymolwiki.org/index.php/Making_Movies

mencoder -mc 0 -noskip -skiplimit 0 -ovc lavc -lavcopts
vcodec=msmpeg4v2:vhq "mf://*.png" -mf type=png:fps=18 -o output.avi

works with mplayer and windows media player, but won't play
on macs (unless they install vlc).
When I try to convert the avi file to quicktime using
  

h264enc -2p -p qt
    

and accepting all defaults
it makes it through both passes, gets to
"converting avi file to mp4 container"
and exits the "-> Failed!"

Any pointers appreciated. I'm open to any linux based
solution that produces animations
that can be be viewed on all three platforms -- thanks, Phil

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

I produce all my movies in Ogg container + Theora compression. I use ffmpeg2theora for that, available on all platforms:

ffmpeg2theora --nosound --optimize --width 1024 --height 768 --inputfps=15 --aspect 4:3 png/mov%04d.png -o movie.ogv

2009/9/3 Andrew Straw <strawman@…106…>

···

I use::

ffmpeg -r 60 -i frame%05d.png -vcodec wmv2 -b 2000k out.avi

And this works well to generate movies that play on Windows, Mac and

Linux. As a bonus, these movies can be included in Latex/Beamer output

using the movies15 package and played within the PDF via Adobe Reader on

Mac and Windows. (I’m sure it’s just a matter of time before the linux

PDF readers can do this, too.) Finally I feel I am near a an end to my

cross-platform, doesn’t-suck presentation-with-movies quest. I only wish

the movie format required to make this possible was less license and

patent encumbered…

I have been encoding on Ubuntu Jaunty with libraries from mediabuntu. I

haven’t tested the above using the plain Ubuntu ffmpeg yet.

-Andrew

Philip Austin wrote:

This isn’t strictly a matplotlib question, but I’m hoping

dual mac/linux users can provide some advice on converting png

files to quicktime movies using mencoder on Ubuntu or Centos.

So far I’ve found that

  1. starting with

http://matplotlib.sourceforge.net/examples/animation/movie_demo.html

using

mencoder mf://*.png -mf type=png:w=800:h=600:fps=25\

-ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi

produces an avi file that works with Ubuntu/mplayer, but

fails with Windows Media Player.

  1. changing the codec based on http://pymolwiki.org/index.php/Making_Movies

mencoder -mc 0 -noskip -skiplimit 0 -ovc lavc -lavcopts

vcodec=msmpeg4v2:vhq “mf://*.png” -mf type=png:fps=18 -o output.avi

works with mplayer and windows media player, but won’t play

on macs (unless they install vlc).

When I try to convert the avi file to quicktime using

h264enc -2p -p qt

and accepting all defaults

it makes it through both passes, gets to

“converting avi file to mp4 container”

and exits the “-> Failed!”

Any pointers appreciated. I’m open to any linux based

solution that produces animations

that can be be viewed on all three platforms – thanks, Phil


Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day

trial. Simplify your report design, integration and deployment - and focus on

what you do best, core application coding. Discover what’s new with

Crystal Reports now. http://p.sf.net/sfu/bobj-july


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day

trial. Simplify your report design, integration and deployment - and focus on

what you do best, core application coding. Discover what’s new with

Crystal Reports now. http://p.sf.net/sfu/bobj-july


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Andrew Straw wrote:

I use::

ffmpeg -r 60 -i frame%05d.png -vcodec wmv2 -b 2000k out.avi

That's encouraging, thanks. I tried this and produced

http://clouds.eos.ubc.ca/~phil/video/out.avi

Just to confirm: the two OSX users down the hall get a "missing
components" message from quicktime when they click on this file in
firefox or safari, and
are sent to a page that gives an undifferentiated list of extra codecs
(divx, etc.). Do I need to tell them to install something like
http://www.microsoft.com/windows/windowsmedia/player/wmcomponents.mspx
or am I still missing some proprietary codec on my end? I'm happy to
post the detailed ffmpeg output if it would provide any clues.

best, Phil

I have successfully used
mencoder -nosound -ovc lavc \
        -lavcopts vbitrate=5000:vcodec=mjpeg \
        -mf type=png:fps=30 -o moviename.avi mf://\*.png -v

I don't think the resulting files are very compressed, but they play
well with quicktime.

Another option for the mac is of course quicktime pro.

George Nurser.

2009/9/3 Phil Austin <paustin@...128...>:

···

Andrew Straw wrote:

I use::

ffmpeg -r 60 -i frame%05d.png -vcodec wmv2 -b 2000k out.avi

That's encouraging, thanks. I tried this and produced

http://clouds.eos.ubc.ca/~phil/video/out.avi

Just to confirm: the two OSX users down the hall get a "missing
components" message from quicktime when they click on this file in
firefox or safari, and
are sent to a page that gives an undifferentiated list of extra codecs
(divx, etc.). Do I need to tell them to install something like
http://www.microsoft.com/windows/windowsmedia/player/wmcomponents.mspx
or am I still missing some proprietary codec on my end? I'm happy to
post the detailed ffmpeg output if it would provide any clues.

best, Phil

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Phil Austin wrote:

Andrew Straw wrote:
  

I use::

ffmpeg -r 60 -i frame%05d.png -vcodec wmv2 -b 2000k out.avi

That's encouraging, thanks. I tried this and produced

http://clouds.eos.ubc.ca/~phil/video/out.avi

Just to confirm: the two OSX users down the hall get a "missing
components" message from quicktime when they click on this file in
firefox or safari, and
are sent to a page that gives an undifferentiated list of extra codecs
(divx, etc.).

Hmm. It plays fine on QuickTime 7.6.2 on Mac OS X 10.5.7 using Firefox 3.5.2 for me. I don't remember installing any extra codecs for wmv, but I do remember installing the Theora codec.

  Do I need to tell them to install something like
http://www.microsoft.com/windows/windowsmedia/player/wmcomponents.mspx
or am I still missing some proprietary codec on my end? I'm happy to
post the detailed ffmpeg output if it would provide any clues.
  

Hmm, come to this of it, that does look familiar. I think I installed it at one point.

A colleague of mine managed to get .avi files with an mpeg4 codec variant encoded using ffmpeg or mencoder on linux that played in Mac and Windows versions of Adobe Reader and in the linux video players. I don't know whether this also required an additional codec.

Apple seems to push the h264 codec, so maybe that would be the best bet on Mac?

-Andrew

Thanks for all the suggestions,
for future reference here's a summary of my results producing
various kinds of quicktime compatible videos from matplotlib.
I used Ubuntu Jaunty and had the medibuntu codecs installed.
The target audience is undergraduates, so straightforward is
good.

Executive summary:
either MOV or mjpeg work with quicktime 7.6.2 as-is. Ogg-vorbis
is the compression winner, so requiring that students
install vlc is another option for large animations.

1) MOV

ffmpeg -r 60 -i shum%05d.png -vcodec libx264 -b 2000k out.mov

http://clouds.eos.ubc.ca/~phil/video/samples/out.mov
size: 0.9 Mbytes
note: works with my (patient) colleague's stock QT 7.6.2

2) FLV

ffmpeg -r 60 -i shum%05d.png -vcodec libx264 -b 2000k out.flv

http://clouds.eos.ubc.ca/~phil/video/samples/out.flv
size: 0.9 Mbytes
note: Safari tried to open this as a text file

3) WMV2:

ffmpeg -r 60 -i shum%05d.png -vcodec wmv2 -b 2000k out.avi
http://clouds.eos.ubc.ca/~phil/video/samples/out.avi
size: 1.1 Mbytes
note: no luck getting quicktime to recognize this, even
        after we installed the codecs from
http://www.microsoft.com/windows/windowsmedia/player/wmcomponents.mspx

4) jpeg:

mencoder -nosound -ovc lavc \
         -lavcopts vbitrate=5000:vcodec=mjpeg \
         -mf type=png:fps=15 -o moviejpeg.avi mf://\*.png -v
http://clouds.eos.ubc.ca/~phil/video/samples/moviejpeg.avi
size: 5.7 Mbytes
note: works, although not svelt

5) ogv

ffmpeg2theora --nosound --optimize --width 800 --height 600 --inputfps=15 --aspect 4:3 shum%05d.png -o movie.ogv

http://clouds.eos.ubc.ca/~phil/video/samples/movie.ogv
size: 0.33 Mbytes (!)
note: we followed the install instructions at http://www.theora.org/downloads/
       but Safari didn't recognize the ogv suffix, and didn't
       offer to associate it with a player