CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Thread: mpeg

  1. #1
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    628

    mpeg

    hello all,

    i need something that is capable of playing an mpeg2 and mpeg4. i would like somethign that is easy to build on top of. i would also like to be able to embed the "playing window" into an application that i will create. (does not necesssarily have to be "embedded".. just as long as it plays in my window). does anyone have/know of anything like this that might be available?

    also, how difficult would it be to do something like this myself? ie to make a very very simple player for mpeg2/4? and what are teh tools that i could use? i have never done this sort of thing.. and would appreciate any suggestions!

    thanks.. i know this question is a little otu there.. but appreciate any suggestions!

  2. #2
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: mpeg

    Look at DirectShow.

    Also the mechanisms for playing MPEG2 and MPEG4 are different. MPEG4 files are usually AVI's which exist on the hard drive. MPEG2's are usually DVD-files which exist on a DVD. The MPEG2 codecs (decoders) are supplied by your DVD-ROM manufacturer, or by an external manufacturer. Microsoft doesn't supply an MPEG2 codec but does supply and MPEG4 codec.

    Bear in mind this stuff is not easy. You need to know COM to be able to make proper use of DirectShow.

    However there are plenty of example applications in the DirectX9 SDK to help you.

    Darwen.
    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

  3. #3
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    628

    Re: mpeg

    thanks for the reply.

    i looked into directshow (very unsuccessfully) a little bit a long time ago. the problem is that i know nothing (when i say nothing, i mean nothing!) about COM and i know that COM is not something you can learn easily/quickly either.

    are there any simpler solutions?

    thanks!

  4. #4

    Re: mpeg

    I've done exactly what you're trying to do before and COM is NOT needed.


    Look into mciSendCommand

    I created a class which would open, play, and close any (WMV,AVI,MPEG but not sure about MPEG2/4)type of media file.

    It is my next project to encapsulate that library into a custom control dll. But that will be weeks from now.


    David

  5. #5
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    628

    Re: mpeg

    thanks, i will look into it and get back to you on my progress.. might have to put this on hold for a couple of days tho but i promise i will be back with more questions

  6. #6
    Join Date
    Oct 2002
    Posts
    1,134

    Re: mpeg

    Quote Originally Posted by darwen
    Also the mechanisms for playing MPEG2 and MPEG4 are different. MPEG4 files are usually AVI's which exist on the hard drive. MPEG2's are usually DVD-files which exist on a DVD. The MPEG2 codecs (decoders) are supplied by your DVD-ROM manufacturer, or by an external manufacturer. Microsoft doesn't supply an MPEG2 codec but does supply and MPEG4 codec.
    MPEG-2 and MPEG-4 are different ways of compressing video data. AFAIK, neither MPEG standard is associated with the AVI format.

    The MPEG standards (and yes, MP3 is an MPEG standard) define compression techniques which can be used for many purposes. MPEG-2, for example, is the format currently used to get digital television to your house.

    Anyway, if you browse the net, you'll find several codecs for both MPEG-2 and MPEG-4. On my computer, I have DirectShow filters for both compression techniques, but I don't know if they came from Microsoft or from some other source during my bumbling around.

    I suggest you have another look at DirectX, Drew. I think you'll find it's a whole bunch easier to work with now than it was in the bad old days.
    Regards
    Robert Thompson

  7. #7
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: mpeg

    TSYS,

    Do you know what the AVI format is ?

    It's just a wrapper around other formats : it's a way to define which codecs are necessary to decode the information which is contained inside of the file.

    All the MPEG-4 data which I've ever seen intended for a Windows environment has come from an AVI file.

    I work on subtitling software you see, and I see a HUGE number of encoded videos that I need to deal with.

    drewdaman, you are asking us for an answer to your questions and we have given one. In my opinion you have to use DirectShow.

    DHillard may have a solution which doesn't use COM, but believe me it's not that difficult to learn and it's a pretty standard technology so sooner or later you're going to have to get to grips with it.

    In fact it's better that you do, because in this world of software development you won't get very far if you get "scared" of learning something new, nomatter how long it takes or how complicated it appears.

    Buy a good book on COM and you'll be ok.

    This I'll bet is only the start of the requirements of your application : you'll hack together something which works, and then the requirements will increase and suddenly you'll realise you have to use DirectShow all along.

    In fact simple DirectShow is very easy : just a few function calls. The samples are very good at showing you how to do what you want to do. Jump in and get dirty !

    Darwen.
    Last edited by darwen; July 8th, 2005 at 04:25 PM.
    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

  8. #8
    Join Date
    Oct 2002
    Posts
    1,134

    Re: mpeg

    Regards
    Robert Thompson

  9. #9
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    628

    Re: mpeg

    thank you for your reponses adn i'm sorry to take so long to reply. i'm going to have to hold off on this for a little while. have to work on something a little more important first...

    darwen, you are absolutely right.. COM is somethign i will need to learn eventually if i want to have a job! maybe i can read up on it in the evenings or something. do you know of any good resources where a beginner can start learning it? i would prefer free resources as i am a little bit broke! would you suggest i read up on COM before looking into directshow?

    thanks.
    Last edited by drewdaman; July 11th, 2005 at 01:41 PM.

  10. #10
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    628

    Re: mpeg

    no good resources to learn COM? ok.. how abotu a good book broke, but it might be worth it! free stuff prefered.. but if not, then i'll take a book!

  11. #11
    Join Date
    Feb 2004
    Location
    where Eurasian, Pacific and Philippine tectonic plates meet
    Posts
    229

    Re: mpeg

    Just FYI as I'm working on a mpeg-1 layer III encoder (mp3) application, there is a patent issue if you indend to sell a software with a encoding or decoding mpeg*.

    Regarding the sound, there is a patent free encoding/decoding open source appli/encoder/decoder Ogg Vorbis. It becomes a standard as many companies don't want to pay the huge and - some say - unfair royalties for mp3...

    As for video, I don't know (yet) as I'm not much interested (yet) maybe someone gets some useful information.


    regards
    Last edited by Mercantilum; July 11th, 2005 at 10:24 PM.
    "Such ingratitude after all the times I saved your life." (imdb quotes)
    A bit of history.

  12. #12
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    628

    Re: mpeg

    thanks for the info Mercantilum. i will not be selling this software. just using it for demo purposes.

    no one here knows of any good sources to learn COM? hard to believe!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured