Play h264 encoded video in MP4 or Matroska containers at speeds greater than 2 times normal. RRS feed

  • Question

  • I have been struggling with playing video on windows 7 and up at speeds greater than 2 times normal, I have tried various things with limited success, here is summary of what I have tried and the results I received, please bear with me as the question and summary of the problem is lengthy, my ultimate aim is to play this h264 footage in an MP4 container(correctly configured for streaming i.e. moov atom e.t.c.) using html5 "<video>" tag (no browser plugins) via streaming using internet explorer 8 , 9 or 10(we can ignore 8 if its not officially supported) (I use mod_h264. for streaming)

    The video is security footage stored in h264 format in Matroska containers, there are no audio streams. Here are the facts/behaviours/things I tried from my various attempts. I have basic to intermediate knowledge

    Video is 2.5 frames per second, keyframe every 36.4 seconds(91 frames), I see nothing wrong with this but please let me know if this is a concern, I asked for a frame rate lower than the normal ones from the camera manufacturers and got this. Now for the symptoms.

    Tried various codecs and container format readers, microsoft build in ones, coreavc 2.6 for h264, ffdshow for mp4 and h264, haali splitter for matroska. I convert between container formats using ffmpeg. I only use MP4 for streaming. I tried multiple machines with Nvidia and ATI video card drivers with various codec settings for cpu or gpu acceleration on or off.

    1. Windows XP or Windows 7 plays video fine at all speeds in AVI format from local disk. I cannot stream this format. Didn't try win8

    2. Win7 or Win8, when playing video from disk using Matroska or MP4 via streaming using Media Player or IE9/10 I cannot fast forward greater than 2 times, video speeds up for a few seconds then freezes but the player continues as if its playing correctly.

    3. (WORKAROUND FOR POINT 2 ON MEDIA PLAYER ONLY). I can play perfectly from local disk or streaming in Win8/Win7 via Media Player if I turn off using Media Foundation for MP4(using Win7DSfiltertweaker 5.6). This fix does not work for playing streaming in the IE browsers as I experience the same problem as point 2. I did try checkiing the "use non standard codecs" in the advanced IE settings.

    4. IE10 on Win 8 does not buffer the video stream, IE9 on Win 7 does. (maybe a known issue)

    5. Chrome browser plays mp4 streaming perfectly on Win7 or XP, I assume this is due to its use of direct show and not Media Foundation. On Win8 it plays fine for 20 seconds and then loops, could be a win8 thing or a video driver issue I don't know.

    In summary I believe the problem to be the MP4( and maybe Matroska) splitter/demuxer for Media Foundation and this can be turned off for Media Player but not for IE. Or I could be completely missing the point. I understand that media consists of various components outside of Microsoft support but any assistance would be appreciated. My ultimate aim is to stream this video using internet explorer 8 , 9 or 10 and be able to play at maximum play rates.

    Saturday, December 15, 2012 5:10 PM

All replies

  • Hi,

    From my experience you could have wrong FPS in case frame duration is not right. And nothing can help you cause it is most respectful info for media players. Take a look at duration and see if it is close that you expect.

    IMFSample has method to get/set duration



    Monday, December 17, 2012 3:48 AM
  • From my investigations the issue seems to be related to the Matroska or MP4 splitters used by Windows 7 and up. From my understanding, and I could be wrong, Media Foundation can use Directshow codecs but not Directshow source splitters. This means that you are forced to use Media Foundation MP4 splitters if you are using a Media Foundation linked apps like Internet Explorer. I noticed that for directshow replacing Haali Media splitter with Lav splitter allows me to fix the high play rate issue on Matroska files with Directshow linked applications on Win7 and up. But I am only able to stream MP4 files and the MP4 splitters that come with media foundation do not support a rate greater than 2 times.

    If my assumption is correct then my only solution would be to wait for someone to write a Media Foundation MP4 splitter that supports playing at high frame rates.

    If not against forum rules I could upload a link to a sample file, it is only around 5 megs in length. Alternatively any MP4 files can be used to simulate my problem from my experiences, if anyone can get an MP4 file playing at faster than 2 times speed on Media Foundation I would be interested to know how they do it.

    Monday, December 17, 2012 3:25 PM
  • Regarding documentation If you want to play video faster just speed up you session clock
    Saturday, December 22, 2012 5:51 AM