MEError after playing multiple videos RRS feed

  • Question

  • Hello,

    I am currently trying to play MP4 video files back to back. I have it working well, however after approximately 30 videos, I get an MEError event called. I am not using a Sequencer because I don't have a set order of videos that must be played, every time I play them they could be different, which makes it difficult to create a playlist.

    I've traced the order of events that I get and it turns out that when it receives an MEError Event it's expecting a MESessionStreamSinkFormatChanged Event. Also, HandleEvent (I'm using the how to playback media files example code as a base) recieves an E_FAIL followed by an E_OUTOFMEMORY messages when these events occur when calling GetStatus.

    I have been stumped for a few hours on this now, and I would appreciate any help anyone has to give.


    Friday, June 3, 2011 7:04 PM

All replies

  • Hello,

    To give more information after using MFTrace on my program to see what's going on. I'm getting this error when the problem happens:

    3794446 7612,1C6C 20:18:11.66658 CMFTransformDetours::SetInputType @003F9C68 Failed MT:
    MF_MT_FRAME_SIZE=5497558139600 (1280,720);
    MF_MT_FRAME_RATE=42949672960417083 (10000000,417083);
    MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);
    MF_MT_MPEG_SEQUENCE_HEADER=00 00 01 67 4d 40 1f 96 56 02 80 2d d8 0a 84 00 00 0f a4 00 02 ee 02 76 85 8b b8 00 00 01 68 ca 8d 48 ;
    MF_MT_MPEG4_SAMPLE_DESCRIPTION=00 00 00 b1 73 74 73 64 00 00 00 00 00 00 00 01 00 00 00 a1 61 76 63 31 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 02 d0 00 48 00 00 00 48 00 00 00 00 00 00 00 01 ;
    The problem is though that I've played this video it's trying to load when it fails here, so that stumps me.
    I'm also getting these errors a little later on:
    3807031 7612,1E34 20:18:11.81534 CMFTransformDetours::ProcessOutput @02145EF0 failed hr=0x8007000E ERROR_OUTOFMEMORY 3807051 7612,1C6C 20:18:11.81541 CMFMediaSessionDetours::EndGetEvent @00416E20 Met=001 MEError, value (empty), failed HrStatus=8007000E ERROR_OUTOFMEMORY,
    Don't know if this helps but hopefully it'll give some more insight to what's going on.
    Thanks I appreciate any help you can give me.
    Friday, June 3, 2011 8:33 PM
  • Have you monitored your process through task manager for memory leaks?
    Saturday, June 11, 2011 1:33 PM
  • Yes I have, and while playing video the memory creeps up. As does allocating the session and source (which makes sense) and deallocating them does bring down the memory, but the problem is with the memory climbing as the video is playing.

    I'm using the basic playback sample described on the MSDN website: http://msdn.microsoft.com/en-us/library/bb970475%28v=VS.85%29.aspx

    This sample when played does the same thing so I don't know if it's something I'm doing wrong with the allocation and deallocation but the function of playing video is entirely run by this sample.

    Hope this helps,


    Saturday, June 11, 2011 6:07 PM
  • Did you modify the sample source code in any way? If you are getting memory leaks, it's most likely that it's from poor lifetime management of a media sample COM pointer. The sample should be getting destroyed in the media sink(aka the rendering engine) when the sink calls IMFSample->Release(). You might have accidentally called one-too-many IMFSample->AddRef()'s

    If the memory leak is slowly climing, it's most likely that it's media samples with compressed video data in them that aren't being properly managed. If it's climing very quickly, it's decoded/uncompressed video samples somewhere along the pipeline that aren't being managed properly.

    Wednesday, June 15, 2011 12:29 AM
  • Thanks for your response.

    I've looked through my program and I don't see any AddRef's that aren't paired with Release's. So I don't believe this is the problem but I could be missing something.

    As for the memory, it climbs quickly. I don't understand what you mean when you say that I'm not managing the video samples along the pipeline. Could you elaborate a bit more on that please?

    I really appreciate your help.



    Thursday, June 16, 2011 8:38 PM
  • Sorry, to respond to the question about modifying the code I haven't changed anything to do with COM variables. I've added a couple extra parameters to function calls in order to get information from the video files being loaded like the frame rate. Which I don't believe make a difference in the memory but if I'm wrong I could go about that a different way.

    Thanks again.

    Thursday, June 16, 2011 8:41 PM