How to play H.264 video in a win32 window? - winapi

I came across a H.264 video which i would like to play in my c++ application. Could anyone suggest what could be the easiest way of doing it? Or What library can be used for the purpose.
Thanks in advance..

Windows API are DirectShow and Media Foundation (mind availability across Windows verions). You need a codec installed in Windows to be able to play the file, stock codec is only provided with Windows 7 editions. A choice of third party codecs is available.
Another option is to use a different framework such as ffmpeg which includes support for container formats and decoders.

Related

Encode & play video formats without 3rd party codec packs

We have built a windows based software system that allows users to import their own video for viewing in the software. It works fine for AVI and WMV as we use a windows based player. For encoding or playing to work with most common video formats we have to ask our customers to download a 3rd party codec pack, such as K-Lite or Combined Community Codec Pack. Many of our customers are not allowed to do this due to IT Management rules.
Are they are any suggestions regarding a player and encoder that can be built into our windows based software without needing 3rd party codec packs.
I am not sure if ffmpeg, handbrake, VLC can be used for this purpose.
Thanks. J
I would suggest MP4 with H264 + AAC/MP3
This works in any browser without any third party codecs AFAIK.
Give this a try HTML5 Video

Vorbis decoder for Windows Phone 7

Anyone know of a vorbis decoder library that can be used on Windows Phone 7?
The lack of native code interop make re-using any of the native code implementations difficult (impossible?) but if there are tricks to do that, I'm open to that as well.
There is a managed implementation for mono called csvorbis, it includes a sample which outputs a wav file this didn't need many changes to work with XNA's SoundEffect class. I did a whole track at once, this took a few seconds in the emulator so you may need to stream it using DynamicSoundEffect for better results. The mooncodecs folder has a codec for the desktop version based on csvorbis which may be worth a look aswell.
Ogg Vorbis is not a supported codec on Windows Phone 7 and the platform supports no way of adding support for custom codecs.
The options available are to write your own decoder/converter in managed code or to convert the original source files.
I suspect the second option will be easier.

Embed Windows media player in flex

I have a mp4 file which is to be used in an application. Currently i am in the stage of figuring out the technology to be used for this job. I am familiar with flex and am hoping that i be able to use it for the application. But i can not figure out a way to play the file in flex. I have been able to play the file only in windows media player and that required the installation of three codecs : Mp4Audio.ax, Mp4Video.ax, Mp4Src.ax.
As i see it, it will be very convenient if i could embed a windows media player plugin in flex or i could specify the audio and video codecs in the flash player.
Else i will have to learn .Net, i guess.
Kindly help me out. Thanks in advance.
If you are creating an air app then you are able to start the windows-media-player using the NativeProcess. Anyway if you have a flex web app then you do not have any options on this. :(
My recommendation: Convert the video file to a valid mp4 file that can be played by flex. I suggest you to check ffmpeg library (and you could use it to convert the file to H264 format)

Is There a Windows Video Codec Common Dialog?

Does Windows have a common dialog to select video codecs? If there is one, how can I create one in c#? I'm asking because I'm currently developing with a plugin that seems to have included extremely dated codecs, and am not sure if the plugin is simply retrieving a list of codecs from the system. I don't have the source of the plugin, so I can't look at the source code directly.
Attached is a screenshot of the dialog:
Screenshot http://www.freeimagehosting.net/uploads/fb936bd413.png
Thanks!
That looks like the save options dialog from Video for Windows. Specifically, I believe that's the dialog that pops up when you use the AviSaveOptions function from avifil32.dll.
You could probably call that from C# using P/Invoke if you wanted to.
The dialog does get a list of video codecs from the system. However, VfW only supports VfW codecs, not the newer DirectShow codecs. Any of the more modern codecs you might have installed on your system are going to be DirectShow codecs, more likely than not.
If you want a more modern codec, you're going to have to install a VfW version of that codec.
No, there is no directly accessible codecs list available in the form of a CommonDialog in C#.
CFP.

Which video and audio format/codec should I use?

Environment: Windows XP/Vista, VS2008, C#/.NET 2.0, VideoGrabber.
Hi All,
I'm writing an app which captures cameras input and encodes them into a movie file (including sound).
My client suggests I encode the movie using the DivX codec. But it's not installed by default and it's not redistributable: Users would have to download, install and configure it themselves.
Is there a Codec available in default Windows (XP+) installations that I could use to encode video and sound? It must support compression. Ideally, I should be able to programmatically set basic configuration.
Note: I read this question but it doesn't actually address my needs.
TIA,
Is there a Codec available in default Windows (XP+) installations that I could use to encode video and sound?
About the best you can hope for is WMV2 (WMV v8). You may be able to encode it using qasf.dll.
The codecs you get for AVI in XP are all woeful efforts from the early days of ‘Multimedia PCs’: things like Cinepak and RLE, which are of zero use for modern full colour/resolution video, and Intel 4:2:0, which is only chroma subsampling, not really actual video compression.
If you need better than that you'll have to start embedding your own codecs, eg. from ffmpeg.
But it's not installed by default and it's not redistributable: Users would have to download, install and configure it themselves.
That's best anyway. Silently installing codecs onto a system is rather antisocial as there are often clashes between them and you could end up messing up other DirectShow applications. For example there are (at least) three different common DirectShow codecs that can handle “DivX” (which is really nothing more than MPEG-4 Advanced Simple Profile video plus MP3 audio in an AVI container): DivX, Xvid and ffdshow. Having more than one installed can be a recipe for bugs.
Not sure how useful this is to you, but I was trying to answer that very question just recently. This article suggests DIB, I420, or IYUV are supported on all platforms... at least in OpenCV. I had the least trouble with I420.

Resources