views:

151

answers:

3

I'm going to be playing a small video of a videogame. It's going to be maximum about 2-4 seconds each file.

I need them to playback inside of my WPF Form desktop application and they need to be relatively small because I'm going to be including them in the donwload size (they are going to be part of the .exe file)

Should I use GIF? Or .AVI? or MP4?

I'm looking for ease of inclusion into my existing WPF project and small size. :D I don't need playback options just need it to play looping.

Thanks for the help. :D

What I need the format to give:

  1. Small size of each video/animation file. (I'll be adding about 70 of them)
  2. No need to install additional codecs on end user machine. I shouldn't bother them for absolutely anything regarding the playback of the video/animation.
  3. Medium to High quality.
  4. Fairly easy to implement with an existing WPF control.
A: 

DIVX is a great format, though you'll want to piggy-back the CODEC in your app.

Nissan Fan
+6  A: 

I think the best option here is a .wmv file, since you're only targeting Windows. This format offers good quality and will play on most machines without any additional codecs.

Badaro
Not to mention that playing one in WPF is as easy as dropping a windows media control on the form.
joshperry
I rather go with this easy solution and you will be able to focus on more important project's tasks :)
Gabriel Mongeon
+6  A: 

Forget about .MP4 unless you want to install a codec. There is no native support on most Windows machines. (besides theres at least 3 mutually incompatible flavors). On the other hand, MP4 will almost certainly give you the best quality for a given download size. To get .MP4 working on windows you need not just a codec install, but also a file stream reader.

WMV will have good support for all flavors of windows, so that's your best choice if the videos have lots of colors and motion.

You could also use .mpg files, so long as you stick to MPEG1. MPEG2 isn't guranteed to be supported on Windows, but MPEG1 support has been built in since Windows98. It's pretty limited in terms of frame size, but it is supported everwhere.

If your videos are animation without audio, especially cartoon style animation without a lot of different colors and shading, you may want to use AVI with RLE compression. RLE compresses really well when the video has very few colors, and Windows has had native support for AVI with RLE encoding since Windows95. One of the nice advantages of RLE is that it's lossless, so it preserves sharpness of edges. But it compresses gradients and images of real things badly or not at all. This may be a wash when you compare it to GIF animation though.

The Windows shell uses AVI with RLE it for the little animated "moving files" bit. The control that does this is part of ComCtl32 it's called the animation control. and it will handle any AVI that has no audio.

You might also consider Adobe's flash video, nearly all computers have flash installed these days, and those that don't can install it separately from your game.

John Knoeller
+1 very comprehensive
SealedSun
+1 taught me something. Thanks!
Kevin Peno
+1 I always thought they were anigifs
borisCallens