views:

877

answers:

2

I have a simple WPF (XAML) file that has some animated shapes and text. The animation has no interactive behavior. I want to record this animation as a video file that I later intend to use as the "intro" screen to a screencast.

What I think I need: C# code that takes an input XAML file and spits out a high quality WMV at (for example at 24fps).

Possible alternatives I have investigated already

  1. Record with screen recording software like Camtasia Studio. This works but the animations are not as smooth especially when the animation has a lot of transitions or movement

  2. Use hardware like DVI2USB by Epiphan Systems. Costs too much; haven't tried it.

  3. Record TV output (S-Video, etc.) using a DVR Card - Low quality and low-resolution.

Update on Oct 28 2008 - working source code

This blog post has a full working source code example of exporting WPF/XAML as an AVI. It's not as fast as I would like but it works for my needs:

link to MSDN blog bost

+3  A: 

Render frames with RenderTargetBitmap, then encode with codec of your choice. Not very fast, but 24 fps are achievable on regular PC. We use similar technique to feed video stream from new WPF indicators to legacy bitmap system. There might be a better solution, but it works.

I also heard of a solution with pulling rendered frame from DirectX buffers which WPF uses internally which works much faster than RenderTargetBitmap, but it seemed too unreliable to use in a production system

Update: it seems you don't need real-time, so RenderTargetBitmap should works without any problems.

ima
A: 

hi: if you submit one of your xaml/wpf animation i will try it & submit a solution.

M. Yasar Ozden