Menu

Maximum number of RenderFile() calls

2009-10-07
2012-10-29
  • marios karagiannopoulos

    My application needs to open multiple AVI files at the same time, and I create
    a GraphBuiler then call RenderFile. But I cannot open more than 75 avi's.

    The error I get after 75 RenderFile() calls is:

    src:
    hr = this.graphBuilder.RenderFile(filename, null);
    DsError.ThrowExceptionForHR(hr);

    values:

    hr = -2147220907
    "Cannot play back the video stream: no suitable decompressor could be
    found."

    Is this a limit fixed by DirectShow, is a parameter or other?

     
  • marios karagiannopoulos

    Actually, I am trying to preoload with RenderFile() calls more than 75 videos
    and the play up to 16 of them at the same time in different playlists. How can
    I do that since RenderFile does not let me render more than 75? I do not want
    to play more than 75 at the same time!

    If I load 16 play, release the objects and then load again 16, play them and
    so on, it works. Unfortunately though it makes a 2-seconds delay for the
    release/load procedures. That's why I would like to pre-render all of them and
    let them play afterwards without delays between playlists!

    Any ideas are welcome! Thanks!

     
  • BEZ

    BEZ - 2009-10-07

    I would make 32 graphs . Place each one in it's own thread. Load the first 32
    videos. Play the first 16 when each one ends start the next 16 and then load
    the new videos in the first batch of players. This method can be done with a
    cue list, event monitoring on each Graph and positon tracking relative to the
    end of the clips.. We do this all the time in our DJ applicaiton and I know it
    can be made to work.

    Watch your threading model very close. I would also recomend not using the
    render file. We have seen memory bleed with it. I would create each Graph
    manually and then programattically re-use it. We have found that making many
    graph objectes playing a file then destroying and making a new one often
    bleeds out memory.

    Hope this helps
    zktech

     
  • marios karagiannopoulos

    Could you point me to a sample src of creating each Graph manually and then
    programattically re-use it?

     
  • BEZ

    BEZ - 2009-10-07

    I have not found any examples out for dot net. I used a book written for C++
    developers to figure out how to write my code.

    The book is Programming Microsoft Directshow for digital video and television
    by Mark D. Pesce

    The book did not come out and show me how to write the code. It showed me the
    concepts of adding and dropping filters from a graph as well as connecting
    filter pins. once I had that down I built my rebuilder code. I also found a
    few examples of manual filter building in the origional directshow sdk that I
    used for reference as well.

    I would start out by first getting a manual builder to work and then come back
    and figure out your threading model.

    Are you coding in C# or VB.Net? I may be able to give you some snippets but we
    use VB.Net exclussive. It would also be a couple of days as well before I
    could do this as we are in the middle of gettting final builds done for our
    Windows 7 version releases.

    zktech

     
  • marios karagiannopoulos

    Thanks! As soon as you can please add some code snippet even in Vb.net. I'm
    coding in C# but it would be I think to do the transition.

     
  • Pencheff

    Pencheff - 2009-10-15

    Why don't you just make those a thread that preloads every group of videos
    while currently playing videos, with some coding tricks you can make a
    preloader that does the job well enough. Good thing most of DirectShow is
    thread-safe

     

Log in to post a comment.