PDA

View Full Version : File recording



brow0833
May 18, 2006, 17:16:30
Hello,

I'm attempting to record using the MV Recording and MV Multi File Writer filters since I'd like to control the frame rate of the recorded video. The graph looks like:


IP Source -> MJpeg Decompressor -> MV Recording -> MV Multi File Writer


As a beginner I'm unclear on the order of what needs to be done. Do I have to wait for the IMVFilterEvents filter events to start both the MV Recording and Multi File filters? What events? Or can I call both filters StartRecording function when my start record button is pressed. Do they have to be handled independently? Can these filters even be used together?

Thank you,

Andy

brow0833
May 18, 2006, 18:35:20
Hello again,

I've found a method that seems to work but the video capture just stops once in a while and does not restart. I've called the StartRecording() functions of both the MV Recording and the MV Multi File Writer filters after I've loaded the .mvp file in a "start record" button event handler:

------------start code clip--------------------
m_pFilterGraph->Start();

CString szFilter = "MV Recording";
IUnknownPtr pUnk;
pUnk = m_pFilterGraph->GetFilter(szFilter.AllocSysString());
CComQIPtr<IMVRecording> pRecording(pUnk);
HRESULT hr = pRecording->StartRecording();

szFilter = "MV Multi File Writer";
pUnk = m_pFilterGraph->GetFilter(szFilter.AllocSysString());
CComQIPtr<IMVMultiFileWriter> pRecordingFile(pUnk);

hr = pRecordingFile->RenderCaptureGraphs(); // seems to be needed, why?

hr = pRecordingFile->StartRecording();
------------end code clip--------------------

I've also enabled the events of these two filters to see what they are saying. Every once in a while an event #23 comes in (make new file event) for the MV Multi File Writer. When the app stops saving I get a few:
"The thread 'Win32 Thread' (0xc54) has exited with code 0 (0x0)." messages in my Trace window right after this event #23.

This makes me think this isn't the correct method.

Please advise,

Andy

Marc Cymontkowski
May 18, 2006, 22:47:37
Andy,

What would you like to record, the whole video or just parts? In which format?


Best Regards,

Marc Cymontkowski

brow0833
May 18, 2006, 23:35:37
Thanks for the quick response. I'd like to record the whole video, yes. The format is open as long as Windows media player on a Windows XP machine can play it, recommendations?

I've been recording to a set of .avi files using the MJpeg codec. I've attached the .mvp file. I'm attempting to provide the user these basic options:

1) frame rate control (important)
2) bit rate or something similar
3) Image size or something similar

I've been seeing some instability in the recording and wonder if I'm just using the wrong method. I can elaborate on this if you'd like.

brow0833
May 18, 2006, 23:39:49
I don't see the attachment, I'll try again here.

Marc Cymontkowski
May 18, 2006, 23:55:15
To record the whole video, you can use the 'AVI Mux' from the 'Stream\\Transform\\Multiplexer' section and the 'File Writer' from the 'General\\Renderer\\File Writer' section.

The attached example shows a preview and records the whole video at the same time.

Marc

brow0833
May 19, 2006, 00:06:22
That does display and record, but it doesn't make use of your MV Recording and the MV Multi File Writer filters. I'd like to use the multi file filter so the video files don't get so large and the MV Recording filter allows me to set the frame rate. Also, I'll need to know the time of the recorded video for playback too (timestamps).

Should I not use these filters for this reason?

Marc Cymontkowski
May 19, 2006, 13:46:19
Andy,

The following sample application shows how to use the MV Multi File Writer to save multiple seamless video files and how to use MV Recording to set a custom capture frame rate.

IP Camera Multi File Writer Sample (http://www.montivision.com/download/MVDevKitPatches/IPCamera_MultiFile_Example.zip)

Please make sure to copy the two updated *.ax files to the bin\filter folder in the MontiVision development kit installation directory before running the sample MVP file!


Best Regards,

Marc

brow0833
May 19, 2006, 20:34:03
Thank you for the updated components, they now write files as expected.