Discussion Forum

 Welcome Guest        

 All Forums
  ViewCast Osprey Products

  

Stop or Release hangs
Message by apeiron on Friday, March 21, 2003 at 06:25  
Location: United Kingdom   Joined: Thursday, September 05, 2002   Posts: 10   Profile Search www Quote

Still me!

I think we found the cause of the problem. I was following the example code provided by Viewcast. This code was in the help file. It turns out that code is different from the example files. It looks like I just assumed the documentation was correct and forgot to check this against the code that is shipped with the example applications in the sdk.

Now I know I need to have an EOS sent by the osprey card in order to stop the flow of data.

I am still testing though.

I especially still want to know if having a Pause after preparing the graph and before a Start will increase the frame accuracy.


Message by apeiron on Thursday, March 06, 2003 at 15:40  
Location: United Kingdom   Joined: Thursday, September 05, 2002   Posts: 10   Profile Search www Quote
I am developing an application which uses the DirectShow drivers of an Osprey 2000 encoder card.
The application grabs live video feed and saves it to disk. It never displays anything to the user.
I initialize the filter graph as in the simple encode example, using the Dump filter to save data to disk.
I initialise the filter graph and connect the pins as in the example.
I then call IMediaControl->Pause() in order to prepare the filter graph and reduce the delay when calling IMediaControl->Start().
Is this correct? I noticed it helps and gives better response times, so I am assuming I am correct. Please correct me if I am wrong.
After every call to the MediaControl object (Pause, Start, Pause, Stop) I call GetState with an infinite timeout in order to make sure the operation has completed.
My application does not interact with the user, so an inifinite timeout is appropriate.
After the call to Pause and GetState, I call Start, to start the encoding. Finally, at the end of ingestion, I call Pause again, GetStatus, Stop and again GetStatus.
During some tests we found that intermittently, the final call to IMediaControl->Stop() hangs for an indefinite amount of time (more than just a few minutes, more like infinite).
This does not happen all the time, but so far consistently in two cases:
CASE 1): If I call Start soon after the initial Pause (say less than 10 seconds), the final Stop is very likely to hang. The mpeg file is produced correctly. It also seems to happen more frequently with Mpeg2 than Mpeg1 (probably due to the higher bitrate).
Solution: we are able to avoid most of this hanging, by makeing sure that a delay of at least 10 seconds is inserted between the initial Pause and Start calls.
CASE 2): Even if this delay is inserted (see CASE 1), ingesting clips shorter than ~30 seconds seems to trigger
the hanging of the final Stop. This is sometimes (50%) prevented by inserting an even longer delay between the initial Pause and the Start call.
In both cases the mpeg is produced correctly.
Eliminating the final call to Pause does not help. Eliminating the final call to Stop does not help either, since a following Release on the IBaseFilter still hangs.
It looks therefore like between the initial Pause and the final Stop there must be an overall time gap of around a minute (60 seconds), combined with at least 10 seconds between the initial Puase and Start.

Ascii art:

seconds    action
0          Pause
>10        Start
>60        Pause, Stop

If total seconds < 60, increase Pause-Start delay

It does not matter if between the Start and the Pause call there is only 10 seconds video. The longer the Pause-Stop gap, the more reliable the driver is.
Maybe the cause is a synchronization issue somewhere in the graph.
Either way, this delays are really too long and we are investingating further.
We installed the latest supported DirectX SDK (8.1) combined with your latest drivers. Do you support DirectX SDK 9.0? Will it solve our problem? We cannot play around with the machines because they are installed at our client's premises.

If you wish to post a reply to this thread you must first login
If you are not already registered you must first register to use the forum

 Forum Jump   
� 2001 ViewCast Corporation - All Rights Reserved.