Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


DirectShow Editing Service timeline and MPEG-2

Posted on 2003-02-20
Medium Priority
Last Modified: 2007-12-19
Can a DirectShow Editing Services timeline be built using MPEG-2s?  I've been trying for a while now without success.  Any ideas or, better yet, sample code?  None of the DirectX SDK samples use MPEG-2 files.  Only Avi and MPEG-1s.  (Also, by using GraphEdit, I know that the MPEG-2 Splitter filter is the one used by default if I call RenderFile).

I'm developing for a Win2k system and, yes, I have MPEG-2 decoders loaded.  Playing single MPEG-2s are no problem using DirectShow.  But I need to play several consecutive files and be able to seek through them as if they were joined.  DES seems the best bet to do that without joining the MPEGs ahead of time.  Any help is GREATLY appreciated!

Question by:jldean1

Author Comment

ID: 8008909
I finally discovered the answer to my own question...

You can NOT use MPEG-2s with DES timelines as far as I can tell.  The IAMTimelineGroup::SetMediaType will only work properly if the AM_MEDIA_TYPE fed in derives from a VIDEOINFOHEADER structure.  MPEG-2s derive from VIDEOINFOHEADER2 so don't work.  SetMediaType will happily accept your AM_MEDIA_TYPE, but things get hosed later in the IMediaControl::Run method call.  I kept getting a VFW_E_SIZENOTSET (Cannot allocate memory because no size has been set) and couldn't figure out why.  Especially since Run() is only supposed to return an S_FALSE or S_OK.  I found that the problem is the extra header info in the VIDEOINFOHEADER2 stuff throws the memory allocation off and makes things go boom.  If anyone can prove me wrong, PLEASE do so. hehe

So...  If you're trying to use DES timelines with MPEG-2 files, just stop.  Stop now and back away from the machine and no one will get hurt.


Accepted Solution

SpideyMod earned 0 total points
ID: 8010387
PAQ'd and points refunded.

Community Support Moderator @Experts Exchange

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question