Results 1 to 4 of 4

Thread: IMediaStreamFileMapper -> streamToFileForRead called multiple times per video

  1. #1
    Join Date
    Mar 2016
    Posts
    2

    Default IMediaStreamFileMapper -> streamToFileForRead called multiple times per video

    Hello guys,

    I'm totally new to the wowza community, I've developed a small plugin module to find the videos location in a DB when requested by ID creating a class that extends the IMediaStreamFileMapper and registering the mapper onAppStart with appInstance.setStreamFileMapper(mapperInstance)

    What I quickly noticed is that the streamToFileForRead method of the mapper is called multiple (5-6) times per video despite it returns always the same output which causes multiple database requests as you can imagine ... an unwanted behaviour. So as I was not able to find documentation on the subject - is this behaviour by design? Is this thing somehow a subject of configuration? Or is it a problem with the way I register the mapper? What can I do to prevent it except of caching data retrieved once from the database?

    Thanks in advance for the help!

    I'm using server version 4.4

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    Hello

    The IMediaStreamFileMapper event handler is called upon for each read/write. One implementation example is here.

    Thanks,
    Matt

  3. #3
    Join Date
    Mar 2016
    Posts
    2

    Default

    Hello Matt,

    Thank you for the response ... but it does not really answer my question. What happens in my case is that for one read operation the streamToFileForRead is called multiple times despite each and every time it returns a (new File(path)) for which (file.exists()) is true.

    So my question was - is that normal? I guess reading between the lines of your answer - it isn't ...

  4. #4
    Join Date
    May 2013
    Posts
    680

    Default

    Hello

    Ya that event handler will be invoked several times per read etc. Another approach may be to take a look at the following module from our collection. The RandomAccessReaderSourceSelector class gives an implementation where you could leverage the IRandomAccessReader interface and access your asset initially via the init() event.

    Thanks,
    Matt

Similar Threads

  1. Replies: 1
    Last Post: 01-06-2016, 07:23 AM
  2. In Android the onHTTPSessionCreate method is called 3 times
    By magnesiosl85 in forum General Forum
    Replies: 1
    Last Post: 11-07-2013, 02:44 PM
  3. Some times transcoder does not encode a video.
    By ve1kyne in forum AddOn: Transcoder
    Replies: 2
    Last Post: 09-30-2013, 05:58 AM
  4. Replies: 2
    Last Post: 04-19-2012, 11:25 AM

Posting Permissions

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