Creating video from WPF/Silverlight animation

后端 未结 3 1163
时光取名叫无心
时光取名叫无心 2021-01-18 19:10

I have a animation written in XAML. I need to create a video (AVI) from that animation. Is there a way to do that ?

相关标签:
3条回答
  • 2021-01-18 19:34

    With Silverlight my approach was:

    1. Take canvas snapshots into WriteableBitmap;
    2. Convert them to .jpg with free ImageTools Silverlight library;
    3. Save it to a folder;
    4. Launch FFmpeg.exe (from Silverlight) and convert that to video.

    If you are not able to launch .exe files then the only option is to send each .jpg file (as byte array) to the server and use "Process.Start" there; and then send resulting video back to Silverlight.

    Because ImageTools is not very quick, I had to resort to saving each image as .bmp and have libjpeg-turbo to convert them to .jpg.

    0 讨论(0)
  • 2021-01-18 19:38

    Here is how to do it for WPF (i.e. not Silverlight)

    http://blogs.msdn.com/b/saveenr/archive/2008/09/22/wpf-xaml-saving-an-animation-as-an-avi-video-file.aspx

    0 讨论(0)
  • 2021-01-18 19:48

    If you have Expression Encoder, you can do the following:

    1. Create a blank movie that has as many frames as your animation (you can change the length later if you get it wrong)
    2. Use the XAML Animation overlay option to add your XAML-based animation
    3. Render out the animation to WMV
    4. Convert the video from WMV to AVI (many free tools will do this)

    I believe the free version of Expression Encoder will handle this.

    If Expression Encoder won't work for you, you can also use screen capture software like Jing or Camtasia.

    0 讨论(0)
提交回复
热议问题