Creating video from WPF/Silverlight animation

后端 未结 3 1168
时光取名叫无心
时光取名叫无心 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.

提交回复
热议问题