locked
Multiple topology for playing multiple video files RRS feed

  • Question

  • I would like to build multiple topology to play multiple video files at the same time.

    The following directshow graph is what I want to do: play two avi files in the same graph

    But when I use Media Foundation to build topology, things are different

    (1) I use AVFSource media source (from the book Developing Microsoft Media Foundation Applications Chapter 6) to load AVI_Wildlife.avf
    (2) First, I add media source and sink
    (3) Then, I press play button

    The result is that TopoEdit will show an error message and no video is shown

    I don't know why. Could you do me a favor?

    Thank you very much



    Friday, February 7, 2014 1:50 PM

Answers

  • Hello.

    The problem is that i change the video subtype in the Mpeg2 Decoder. Now i use MFVideoFormat_MPG1 and MFVideoFormat_MPEG2. They are define in "mfapi.h" and they are the video subtype under MediaFoundation.

    Doing this, i broke the compatibility with Mpeg1Source. It uses MEDIASUBTYPE_MPEG1Payload wich is more a DirectShow video subtype.

    So you can do one of this two things. In MPEG1Source.cpp line 1932, change MEDIASUBTYPE_MPEG1Payload by MFVideoFormat_MPG1.
    Or in MFTVideoMpeg2.cpp line 221, add this condition :

    && subtype != MEDIASUBTYPE_MPEG1Payload

    I will update my project to keep compatibility with Mpeg1Source. But when the Mpeg2 source will be finish, i will use MediaFoundation video subtype only, i think.

    Thank you for the report.


    • Edited by Miaou77 Sunday, February 9, 2014 5:10 PM
    • Marked as answer by peteryen0923 Tuesday, February 11, 2014 9:07 AM
    Sunday, February 9, 2014 5:08 PM

All replies

  • Hello.

    I tried to play two wav files at the same time time with TopoEdit, and it works. i tried to play two wmv files, it works too.

    Can you play each file alone without problem ?

    Friday, February 7, 2014 10:39 PM
  • Yes, if I play only one avi file, it works!

    I tried to play two wmv files at the same time with TopoEdit, it works as well.

    I think that there is something wrong with AVFSource media source

    But I don't know how to modify it. 

    Saturday, February 8, 2014 2:11 AM
  • I also did some experiments with Windows SDK sample - mpeg1source and used your MFNode project.

    The following topology will show an error message - 0xc00d5212

    test-mpeg.mpg is mpeg 1 video file. It's from https://archive.org/details/test-mpeg


    Sunday, February 9, 2014 5:26 AM
  • Hello.

    The problem is that i change the video subtype in the Mpeg2 Decoder. Now i use MFVideoFormat_MPG1 and MFVideoFormat_MPEG2. They are define in "mfapi.h" and they are the video subtype under MediaFoundation.

    Doing this, i broke the compatibility with Mpeg1Source. It uses MEDIASUBTYPE_MPEG1Payload wich is more a DirectShow video subtype.

    So you can do one of this two things. In MPEG1Source.cpp line 1932, change MEDIASUBTYPE_MPEG1Payload by MFVideoFormat_MPG1.
    Or in MFTVideoMpeg2.cpp line 221, add this condition :

    && subtype != MEDIASUBTYPE_MPEG1Payload

    I will update my project to keep compatibility with Mpeg1Source. But when the Mpeg2 source will be finish, i will use MediaFoundation video subtype only, i think.

    Thank you for the report.


    • Edited by Miaou77 Sunday, February 9, 2014 5:10 PM
    • Marked as answer by peteryen0923 Tuesday, February 11, 2014 9:07 AM
    Sunday, February 9, 2014 5:08 PM
  • Your  Mpeg 1 decoder works well now !

    I did another experiment with mpeg1source.
    I used it as skeleton and change it to AVI media source. When I use TopoEdit to play multiple avi files, it works well.

    I am sure that AVFSource has some problem. But I have not found the bug right now.
    I will try to find the bug.

    Thank you, anyway.

    Tuesday, February 11, 2014 9:06 AM
  • Hello.

    I don't know why, but i belived the AVFSource was a Microsoft source node...

    Can you provide two AVI files. I will try to debug the AVFSource with you.

    PS: Developing Microsoft Media Foundation Applications is an excellent book. I only use chapter 8 for a custom MediaSession. The source code for the custom MediaSession is not fully implemented in chapter 8. So it's possible that source code from chapter 6 is not implemented correctly too.

    Also my custom MediaSession implementation in MFNode project has problem if you stop then play the topology. I'm working on a fix.


    • Edited by Miaou77 Tuesday, February 11, 2014 8:44 PM
    Tuesday, February 11, 2014 8:32 PM