Skip to content

CODExperiments

Doing it MY way!

  • Home
  • 2009
  • January
  • 21
  • Full Motion Video in XNA

Full Motion Video in XNA

Posted on January 21, 2009January 2, 2015 By Zoon No Comments on Full Motion Video in XNA
MPEG Decoding, XNA

About two weeks ago, the graphic artist I have working with me on my game said, that he had planned a whole lot of full motion video clips. Initially I had to disapoint him. As you probably know, there is no easy way of showing FMV on the XBox 360 from within the XNA framework.

So… since XNA does not have a video loader/decoder of it’s own, and we can not use Windows to load the video, we have to roll our own decoder.

Instead of saving all the frames from an AVI stream as single images, and then import them one at a time into XNA during runtime, why not use a “simple” compression format? Well.. some say that C# is simply not fast enough. I say it depends on optimization and available CPU resources (and the XBox 360 should have more than enough power)

So to prove my point, I have implemented a very simple MPEG I video decompressor in 100% managed code. (Video only)

What you see below, is a web-friendly version of a video captured with fraps. The video being decoded is a small clip from the Blender movie “Elephants Dream”, running on XNA 3.0.

Movie information:
Original dimensions: 720 x 576
Rescaled dimensions: 512 * 256 (power of two texture.. scaled using Sony Vega studio 9)
Original framerate: 25 FPS
Frames: 3384 in clip
Approx bitrate: 1660 kbps
Movie disk size: 29208028 bytes (~29 MB)
Decoding speed in C#: 65+ FPS, single threaded on an Intel 2.65 GHz Core 2 Duo

You will probably notice a frame rate drop when watching the movie. This has nothing to do with the decoder or XNA, but just the fact that my hard-drive is struggling to save the movie. Btw, the original fraps movies dimensions are 1024*768, so the movie has been scaled a few times when you watch this. If anyone wants it, I can save a few decoded frames from the movie, so you can evaluate the quality.

[ad name=”Google Adsense-1″]

Now running on the XBox 360 is a different story. Here we get around 25/33 frames per second, if we set the decoding thread priority to high. So I will have to find a way to multithread the decoding procedure. However, this is not going to be easy!

If you want to know more about video compression, I would suggest you have a look at this page:  Video Compression

Tags: FMV MPEG Decoding XNA

Post navigation

Next Post: Multithreading ❯

You may also like

MPEG Decoding
MPEG Decoding update
January 28, 2009
MPEG Decoding
Multithreading
January 24, 2009

Leave a Reply

You must be logged in to post a comment.

Downloads

Get it while it's HOT:
NZBcc 1.2.2.0

Downloads
might be ad supported. If so, click in top right corner to continue when the counter reaches 0.

Support NZBcc



Sign up to Dropbox using this link

Archives

  • March 2016
  • September 2014
  • July 2014
  • January 2014
  • August 2013
  • January 2013
  • December 2012
  • November 2012
  • September 2012
  • August 2012
  • June 2012
  • May 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • August 2011
  • July 2011
  • April 2011
  • January 2011
  • December 2010
  • November 2010
  • August 2010
  • July 2010
  • April 2010
  • March 2010
  • January 2009

Tag Cloud

AJAX Android Articles C# Download FMV Giganews HLSL HTML HTML5 Javascript jQuery MPEG Decoding MySQL Netflix NZB NZBcc PHP SQL Usenet Windows 7 XNA

Copyright © 2025 CODExperiments.

Theme: Oceanly News Dark by ScriptsTown