DirectShow : IMediaSeeking::SetRate not working with H.264 streams
How can I set video playback rate when working with H.264 video streams with DirectShow?
It looks like IMediaSeeking::SetRate dosen't work on H.264 video decoder. I tried the following decoders so开发者_如何学编程 far : Microsoft DTV-DVD Decoder (shipped with windows 7), FFDShow Video Decoder and Axis H.264 Decoder.
Also, I noticed a DMO called Frame Rate Converter. Do you think it could help in this situation?
Thank you.
One way I have done this is from an MPEG-2 Transport Stream container with H.264 video and AAC audio. I was doing live capture from an HD-PVR and fed the output from the capture into the MPEG-2 Demultiplexer. I then split off the audio and video with separate pins, having the audio go directly into the Streaming Buffer Engine sink. I fed the video into the MPEG-2 Video Analyzer Filter and then into the SBE sink.
In a separate graph, I then started with the SBE Source and then fed the video to the Microsoft DTV-DVD Decoder and then on to the VMR9. The audio I sent to the Microsoft audio decoder (I don't remember the exact one at the moment) and then on to the DirectSound device.
Once I did all of this, I could use the IStreamBufferMediaSeeking and IStreamBufferMediaSeeking2 interfaces on the SBE Source to set the rate faster or slower, as needed.
If you are using a live stream (such as a live capture), I would expect you would have to do the same thing to provide an appropriate buffer for the stream.
精彩评论