Search code examples
svgflashavi

SVG to SWF, AVI converter


I have animated SVG using SMIL. However I would need to export to other formats.

Do you know any program that would convert animated SVG to SWF, GIF, AVI (or any other video format)?


Solution

  • This conversion is easy with ffmpeg in two steps.

    Step 1: Generate a movie from your screen.

    1. Open your animated SVG in Mozilla Firefox or Internet Explorer.
    2. Use this command in a terminal:

      ffmpeg -s 1440x640 -r 25 -f x11grab -i :0.0 -b 6000k out.avi
      

      With:

      • -s specify the format of your animation (here 1440x640 px).
      • -r the frames per seconds (Here 25).
      • -f the selection of your screen.
      • -b the quality (6000k is good quality).
      • out.avi name and format of the file.
    3. Now watch your animation in full screen mode (F11). If your animation is looped it's better.

    4. Stop the recording (Ctrl + C)

    Step 2: Save only the interesting part

    Use this command in a terminal:

    ffmpeg -i out.avi -b 6000k -r 25 -t "00:00:10" -ss "00:00:09" "final.avi"
    

    With:

    • -i the file to cut.
    • -b the quality.
    • -r the frame rate.
    • -t the duration of recording (Here 10s).
    • -ss the recording start (Here at 9s).
    • final.avi the output fil.

    Now you have an .avi file