2
$\begingroup$

In MMA (8.0.0/Linux), I tried to to create an animation using the command

Export["s4s5mov.mov", listOfFigures]

and got the output

enter image description here

Doing a little research, one can read in the Documentation Center that

enter image description here

And I was wondering if there is some way to overcome this limitation within MMA.

EDIT

Here is a sample code of the inverted animation problem:

movingP = Table[Show[
    ParametricPlot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]}, AxesLabel -> {x, y}],
    Graphics[{Red, PointSize[Large], 
         Point[{Sin[(n \[Pi])/8], Cos[(n \[Pi])/8]}]}]
    ], {n, 0, 15}]

Export["~/Desktop/point.avi", movingP]

will produce an avi like this:

enter image description here

(The gif has been tampered to look like the avi)

$\endgroup$
12
  • 1
    $\begingroup$ You could Export to avi and then use ffmpeg (outside Mathematica) to convert to quicktime. $\endgroup$ Sep 25, 2012 at 17:27
  • $\begingroup$ @b.gatessucks For some reason, when I export to avi, the image gets flipped upside down and left to right. $\endgroup$
    – Pragabhava
    Sep 25, 2012 at 17:30
  • 1
    $\begingroup$ If you post some code I'll have a look from home. $\endgroup$ Sep 25, 2012 at 17:32
  • $\begingroup$ As far as I know, Mathematica relies on the presence of a Quicktime installation to handle video output. Systems on which Quicktime isn't available won't work. I believe, but don't know for sure, there's no official Quicktime for Linux. $\endgroup$ Sep 25, 2012 at 17:43
  • 3
    $\begingroup$ ¡ǝƃuɐɹʇs ʎllɐǝɹ s,ʇı $\endgroup$ Sep 25, 2012 at 17:59

3 Answers 3

3
$\begingroup$

One can export to AVI (for instance) and then use 3-rd party software (for instance, ffmpeg) to do the conversion to MOV. The following runs fine (without inversions) and the result can be viewed with mplayer, vlc:

Export["/tmp/point.avi", movingP]

Run["! ffmpeg -i /tmp/point.avi /tmp/point.mov"]
$\endgroup$
1
  • $\begingroup$ I'm accepting this post as answer since it solves the problem of producing the qt within MMA, but thanks to ragfield and halirutan, the first one for clarifying why it's not possible to do it without third party software, and the second for providing a nice hack for my mplayer. $\endgroup$
    – Pragabhava
    Sep 25, 2012 at 19:15
3
$\begingroup$

Mathematica uses Apple's QuickTime library to create QuickTime movie files on Mac and Windows. This library is not available (and never has been) for Linux. You should be able to export to AVI or SWF and then perhaps use some 3rd party utility to perform a conversion if necessary.

$\endgroup$
3
$\begingroup$

The obvious hack around the flipped movie is the use ImageReflect to correct each frame before the export

movingP = Table[
  ImageReflect[Rasterize[
    Show[ParametricPlot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]}, 
      AxesLabel -> {x, y}], 
     Graphics[{Red, PointSize[Large], 
       Point[{Sin[(n \[Pi])/8], Cos[(n \[Pi])/8]}]}]], "Image"], 
   Top], {n, 0, 15}];

Export["~/Desktop/point.avi", movingP]

As a side-note: Since Rasterize creates the final raster image for the frame, all settings like image size or resolution have to be made their. In the Export call they won't work as expected anymore.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.