PDA

View Full Version : 'Broken AVI' with IC Imaging Control 3.2 - according to VLC



nmw01223
February 19, 2012, 10:40:28
Just started on this 2 days ago, so very little experience of the class library so far. Developing with VS 2003 in c++.

Managed to write an AVI file OK, but - when trying to play it in VLC, VLC says 'broken file, will not seek, repair?". Does play it OK, however. Windows media player also plays it but doesn't say anything. The VLC messages seem to indicate it is something to do with the AVI index.

Doesn't seem to depend on the codec - same issue in each case, but usually experimenting with DV video encoder or Xvid MPEG4.

However, when I write a file using the provided IC capture app - same codec, no problem.

Not sure what I'm doing wrong, using the sample code really:

To start it:

tMediaStreamSinkPtr pMediaSink =
MediaStreamSink::create(MediaStreamContainer::crea te(MSC_AviContainer), pCodecs->at(CurrentCodec));

pMediaSink->setFilename((LPCTSTR)Path);
pMediaSink->setSinkMode(GrabberSinkType::ePAUSE);
m_cGrabber.setSinkType(pMediaSink);
m_cGrabber.startLive(true);
pMediaSink->setSinkMode(GrabberSinkType::eRUN);


and to stop it:

m_cGrabber.stopLive();


I don't seem to have any control over the actual file writing apart from providing the name and path, so cannot see what I'm doing wrong. What does IC Capture do that I don't?

Second question: is there any way of 'forcing' the AVI file to have a specific frame rate set, regardless of what the actual capture rate of the frames was?

Stefan Geissler
February 20, 2012, 14:34:31
Hello,

we saw the same problem in VLC player, but got no hint, what happened. Since Windows Medial Player does not complain, we think, there might be a problem in VLC player. However, we are not sure about this.

IC Imaging Control uses the standard DirectShow filters to write an AVI file. You may use graphedit and connect to the remote graph, while your application is running. Then you can see the used filters.


Second question: is there any way of 'forcing' the AVI file to have a specific frame rate set, regardless of what the actual capture rate of the frames was?

Unfortunately not. But there are programs available, that can change the playback frame rate afterwards.

nmw01223
February 23, 2012, 11:02:00
Hello,

we saw the same problem in VLC player, but got no hint, what happened. Since Windows Medial Player does not complain, we think, there might be a problem in VLC player. However, we are not sure about this.

IC Imaging Control uses the standard DirectShow filters to write an AVI file. You may use graphedit and connect to the remote graph, while your application is running. Then you can see the used filters.



Unfortunately not. But there are programs available, that can change the playback frame rate afterwards.

Thanks. Actually the problem went away so might have been an artifact of running under the visual studio debugger.

On the second point - I am aware of such tools, but for tidiness, would be very useful. I guess that one might often capture at a rate which is not truly real time - I am, anyway. So, if there was a rerelease at some point a function to override this would be nice ... . Obviously some codecs which convert to a new frame rate are going to ignore it anyway.