locked
a/v sync in media foundation( same like dshow)

    Question

  • In dshow, there is a system clock for a/v sync. If one frame come late, the renderer will drop it, which ensure the playback is sync.

    I think media foundation have the similar logic for a/v sync. I used third party media source and decoder MFT (or system default media source and decoder)in my metro app. The video playback very well.

    now I have a H264 SW decoder(Myh264MFT.dll), it's bad performance for 1080P video playback. so the playback isn't a/v sync. The audio is playback normally, the video is playback slowly, like in another rate,but no block .When the audio playback over,so the progress bar is end, but the video continuous playback. so I think the renderer don't drop any video frame. that's why? the A/V sync logic is wrong?

    I use the system default media source for test, (system media source + Myh264MFT.dll), the video playback block time and again, and a/v always keep sync .I think the playback is normal for h264 bad performance. When the playback is block, the pipeline only send KEY frame to h264 decoder. How the system media source do this? Because if I only send the KEY frame, I also can playback block time and again, and a/v always keep sync. But for other video file(resolution is less 720p), or the key frame is very few, many frames between key frame are droped. The playback is always block wrong.

    can someone understand my description about this problem?

    In short, I consider the media foundation has the same a/v sync logic like dshow, the renderer is responsible for dropping the later frame. But for bad performance video decoder, how to keep a/v sync? Mysource.dll (writed by the media extensions sample MPEG1SOURCE)isn't work well like system default source. So I think the default source has special handle for this problem, but the MPEG1SOURCE sample is too simple, no any information about this.

    Thanks in advance, ayuppie.
    Monday, September 17, 2012 1:20 AM

Answers

  • The issue is likely due to the fact that you are not support Quality Of Service (QOS). I would recommend that you take a look at implementing the following interfaces in your codec.

    I hope this helps,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Friday, September 21, 2012 10:44 PM
    Moderator