Re: Video renderer stops rendering at reaching the former stop pos





"Geraint Davies" wrote:

On Thu, 24 May 2007 02:15:01 -0700, Andreas Korn wrote:

"Geraint Davies" wrote:

On Wed, 23 May 2007 04:00:00 -0700, Andreas Korn wrote:

I want to use a playback filtergraph in a read-while-write scenario (usually
with mpeg1) and use for this purpose a custom source and splitter filter
which support opening of files still being written (source filter) and
setting of the stop position beyond the initial value (~ duration at time of
filtergraph creation). The application sets the stopposition every few
seconds to the current duration to follow the growing video.
So far this works fine, but when the graph reaches the stopposition at the
time of the last seek operation (IMediaSeeking::SetPositions with current
position set) the video renderer stops displaying anything (probably
discarding all the samples it receives for some reason). Audio playback works
fine. To get the video renderer to display again I can either do a seek from
the application or send (after the stopposition is set) a sample from the
splitter with flagged as discontinuity. Both ways interrupt playback and in
the later case there are even some samples dropped. Sending IPin::NewSegment
from the splitter output pins downstream does not have any effect.
The decoders used are the stock DirectShow MPEG1 video and audio decoders.
It does not make any difference which video renderer is used (tested with
Video Renderer and Video Mixing Renderer9).
I need a way to force the video renderer to acknoledge the new stop position
without doing a seek or some other way to deliver smooth playback.

Thanks, Andreas

I'm surprised that the NewSegment does not help -- although maybe a
NewSegment is not looked at except after a discont/flush etc. The reason
this applies to video and not audio is that video has situations where you
need to deliver frames that are not rendered (to give the decoder the
keyframes) and NewSegment is used to indicate which portions of the data
should be rendered.

If it is related to this, then the solution should be to not set a stop
time at all, and ensure that the NewSegment stop time is max-long-long.

G


A discont sample definitly does help, but leads to some drop frames (either
dropped by the decoder or renderer, I' m not sure).
Currently I am experimenting along the lines of a maxed stop position.
Unfortunatly the filter graph manager sets the current position to the stop
position when it receives an end of stream (as is the case when the splitter
detects samples with a timespamp not smaller than the duration). No I'm
trying to send the eos (in the splitter) only if the duration hasn't changed
in a while.

Andreas

It's the stop value in the NewSegment that counts here (I think) and that's
in your control in the splitter. it does not need to be the seek time stop
position - in fact many valid parsers set the newsegment stop as maxtime
even while correctly handling the stop time internally.

G


It did not work. Regardless of the stop position value in NewSegment (which
does not get called at the beginnning), the filtergraph always sets the
position to stop position when it is maxed at the last start/seek/flush and
stops the video display when not.

I'm now trying to let the filtergraph basically wait forever for data and
process it when it arrives (stop position to max) and send EOS when the
source did not grow for some seconds. The problem is to wait for more data
(pause the graph) and let it continue when there is more data.
I send the EC_STARVATION when the parser doesn't get anymore data from its
pull pin and tried to wait in the resulting call to pause (mentioned in the
doc for EC_STARVATION) until the source gets bigger. So far this always
resulted in deadlocks (because pause is blocked) or the starvation condition
wasn't detected.
Any hints would be greatly appreciated.

Andreas
.



Relevant Pages

  • Filter with dynamic format change.
    ... I have a filter graph getting video data from a DVB-C TV-Card. ... For testing I added a "Video Renderer" and everything is working fine. ... So is a dynamic format change the same as reconnecting when active? ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: DirectShow @ WM 5.0: Capture camera to memory?
    ... The still image pin will most likely expose higher resolutions than ... the capture pin which could negativly impact your performance, ... You'll need to create a sink filter that does your processing, RGB video ...
    (microsoft.public.pocketpc.developer)
  • Strange Directshow problem
    ... filter which feed a video stream into a video renderer. ...
    (microsoft.public.win32.programmer.directx.video)
  • Strange DirectShow problem
    ... filter which feed a video stream into a video renderer. ...
    (microsoft.public.multimedia.directx.dshow.programming)
  • Re: Hardware Overlay with Push Source
    ... There is no difference between filters: an upstream filter ... The Video Renderer accepts YUV formats if the video graphics ...
    (microsoft.public.win32.programmer.directx.video)