Warning: file_exists(): open_basedir restriction in effect. File(/mounted-storage/home107c/sub002/sc63337-VMNH/www/devblog/wp-content/uploads/2023/05) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2036

Warning: is_dir(): open_basedir restriction in effect. File(/mounted-storage/home107c/sub002/sc63337-VMNH/www/devblog/wp-content/uploads/2023) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: is_dir(): open_basedir restriction in effect. File(/mounted-storage/home107c/sub002/sc63337-VMNH/www/devblog/wp-content/uploads) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: is_dir(): open_basedir restriction in effect. File(/mounted-storage/home107c/sub002/sc63337-VMNH/www/devblog/wp-content) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: is_dir(): open_basedir restriction in effect. File(/mounted-storage/home107c/sub002/sc63337-VMNH/www/devblog) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: is_dir(): open_basedir restriction in effect. File(/mounted-storage/home107c/sub002/sc63337-VMNH/www) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: is_dir(): open_basedir restriction in effect. File(/mounted-storage/home107c/sub002/sc63337-VMNH) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: is_dir(): open_basedir restriction in effect. File(/mounted-storage/home107c/sub002) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: is_dir(): open_basedir restriction in effect. File(/mounted-storage/home107c) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: is_dir(): open_basedir restriction in effect. File(/mounted-storage) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/www/zoon.dk/:/tmp/domains/6aa/zoon.dk/:/usr/share/php_binaries/include/) in /home/www/zoon.dk/wp-includes/functions.php on line 2047

Warning: Cannot modify header information - headers already sent by (output started at /home/www/zoon.dk/wp-includes/functions.php:2036) in /home/www/zoon.dk/wp-content/plugins/wordpress-mobile-pack/inc/class-wmp-cookie.php on line 50
MPEG Decoding | CODExperiments
Warning: Illegal string offset 'lang' in /home/www/zoon.dk/wp-content/plugins/keyword-statistics/keyword-statistics.php on line 350

Warning: Illegal string offset 'keywords' in /home/www/zoon.dk/wp-content/plugins/keyword-statistics/keyword-statistics.php on line 354

Warning: Illegal string offset 'description' in /home/www/zoon.dk/wp-content/plugins/keyword-statistics/keyword-statistics.php on line 356
Jan 28 2009

MPEG Decoding update

Well… it seems I ran into the classic SetData() problem on the XBox 360. It really is THAT slow! So my new improvements (multithreading) didn’t do anything for the XBox. I then changed the code to create the frames on a seperate thread, and THAT improved performance. Now I’m up to about 42 FPS (max) against the old 24-27’ish frame rate.

Next up is trying to improve picture quality using shaders! More on that later!


Jan 21 2009

Full Motion Video in 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.

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