nmw01223
February 19, 2012, 09: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?
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?