What file type do you recommend I use for playing a really small video?
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 开发者_JAVA技巧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:
- Small size of each video/animation file. (I'll be adding about 70 of them)
- 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.
- Medium to High quality.
- Fairly easy to implement with an existing WPF control.
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.
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.
DIVX is a great format, though you'll want to piggy-back the CODEC in your app.
精彩评论