Running background video

Apr 3, 2013 at 4:54 AM
Hi, I've a touch screen application built using WPF running at HD resolution (1920 x 1080) and i have a looping background video that is also in HD. The background video runs as long as the lifetime of the app. The UI is placed "above" (in z order). However the UI's rendering seems jerky and laggy and I want to improve this performance. I tried using the VisualWrapper in my app to run the video in the wish to run the video in another thread however, the result is still the same, i still face jerkiness and lagging. When i run the app without the video running, my UI runs smoother as expected. Can you suggest a way to improve my UI responsiveness?

Apr 3, 2013 at 7:19 PM
WPF already decodes video on separate threads, so that is why you did not see any advantage.

Is the video running at full resolution? That might be pretty heavy regardless. Try using a lower-resolution video if it is just for background effects.

Try different codecs. The degree of GPU acceleration differs depending on the codec.

Is your app using layered windows (semi-transparent)? If so, we have to read the video memory into system memory which is pretty expensive.

Are you using software rendering? That can be very expensive. WPF can render in hardware (GPU assist) and it also supports in rendering on the CPU. The CPU us much more expensive. Perhaps your app is rendering in software? You can force software rendering, but you cannot force hardware rendering. WPF uses hardware rendering if it thinks the GPU is supported (and it has not been forced to use software).

Good luck!
Apr 4, 2013 at 6:39 AM
Hi thanks for the reply.

The video I am running is at HD 1920 by 1080 resolution, in Avi format and it's 12.2MB. I will try different codecs. But how do i know what codec is it running in wpf?

Apr 4, 2013 at 7:43 PM
AVI is just a container format. The video stream inside of it can be in virtually any format, including Full Frame (Uncompressed), Intel Real Time (Indeo), Cinepak, Motion JPEG, Editable MPEG, VDOWave, ClearVideo / RealVideo, QPEG, and MPEG-4 Video.

I'm not certain the codec is the problem. It might simply be that the video is too large, or that the WPF app is using software rendering for some reason.