DirectShow Editing Service timeline and MPEG-2

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!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jldean1Author Commented:
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.

PAQ'd and points refunded.

Community Support Moderator @Experts Exchange

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.