Synchronize and PushSource filter

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

I have a directshow client/server application using a custom video
codec (not a standard directshow filter). The server part capture
video and audio data from differents capture sources and I extract
frame from the graph using the SampleGrabber filter and compress video
frame using the custom made codec. So the graph look lilke this :

** Video Stream
[Camera (YUV I420)] --> [SampleGrabber] --> [Null Renderer]

** Audio Stream
[AudioInput] --> [AudioCodec(GSM 6.10)] --> [SampleGrabber] --> [Null
Renderer]

For each data stream there's a different graph. The samples aren't
rendered server side, they are either saved to disk or sent over the
network.

Now for the hard part. I have to playback the samples on a seperate
client application, to do that I wrote a DirectShow PushSource filter,
that play sample queued on a list. Each samples are stored with a 64
bits timestamp

For playback I have a graph per view, that means there can be many
video/audio streams per view. The graph looks like this :

** Video Streams
[Custom MemorySourceFilter] --> [AVI Decompressor] --> [ColorSpace
Converter] --> [VMR9]
[Custom MemorySourceFilter] --> [AVI Decompressor] --> [ColorSpace
Converter] -->

** Audio Streams
[Custom MemorySourceFilter] --> [ACM Wrapper(Back to PCM)] --> [Default
Directsound Device]
[Custom MemorySourceFilter] --> [ACM Wrapper(Back to PCM)] --> [Default
Directsound Device]
[Custom MemorySourceFilter] --> [ACM Wrapper(Back to PCM)] --> [Default
Directsound Device]

For the video samples they are decompressed back to YUV I420 format
before going into the MemorySourceFilter.

This can be difficult synchronizing all this, but for now let's just
say I have one video stream and one audio stream. I need to
synchronize both of them, but the problem is whenever there's some
delay in either in the data transmission, I have to wait for some time
until I received the requested sample. For now I wait in the derived
DoProcessingLoop(), but doing so cause the whole playback graph to
pause for some time. As I understand this, when I call the
IMediaSample::SetTime method, directshow expect that next sample will
be availlable at the endtime, and won't let go until I give a
IMediaSample to play with.

Am I doing something wrong here? Does a IAsyncRead will be better for
my need? I get chunky video/audio playback right now because I have to
actually wait for the sample to be transmitted. Do I need to buffer
some data? I waiting to have at least 2 samples in the buffer before
actually stop waiting and start sending the sample in the graph
(CPushSource::Deliver). Is there a way to tell directshow that there's
no sample available at this time? Do I need to play audio and video in
a separate graph?

If you know anything about this, let me know.

Thank you.

.



Relevant Pages

  • RE: Green Screen/ Full Screen Issue
    ... DirectShow Filters ... Indeo® video 5.10 Decompression ... MainConcept MPEG Audio ... Realtek HD Front Green Jack,0x00200000,1,1,,5.03.2600.2180 ...
    (microsoft.public.windowsmedia)
  • Re: Burning a video to DVD from AIFF and MPEG-2 files
    ... I have never attempted to burn a video to DVD. ... video and audio are available for download as separate files. ... depending on whether I wanted an AC3 or MP2 audio stream. ... for the higher video bitrate when using an MP2 audio stream is because ...
    (alt.os.linux.suse)
  • Managing one video source with 2 audio sources....
    ... We have some issues that are keeping us from improving our video quality. ... The main issue is having audio streams for a given region of the country. ... The problem comes in where we've got to manage each audio stream separately, ... keeping our separate audio streams which is important to our customers. ...
    (microsoft.public.windowsmedia.sdk)
  • Re: video playback speed too fast
    ... If I play the video stream only the playback speed appears to be correct! ... Under proposed solutions and tests doing just the audio stream all of the solutions failed. ... I tried unchecking all the converters and with the default set both with same 'fast' playback. ...
    (microsoft.public.windows.vista.music_pictures_video)
  • Re: How to implement a DS source/splitter filter that accept live video
    ... video and audio are in separate stream. ... I still don't understand what this source filter ...
    (microsoft.public.win32.programmer.directx.video)