I am developing project in which I want to capture video from two webcam at same time from two different side.
But when I started recording from both webcam it shows "END RECORDING" status ;
But when I started recording single webcam it record a video.
I am mentioning the code used for recording.
Also I am using
vfw32
library of Microsoft Sdks for this webcam functionality.
hMyWindow1 = capCreateCaptureWindow("", WS_CHILD |WS_VISIBLE,rect.left, rect.top,rect.right,rect.bottom, hw, 0);
capSetCallbackOnStatus( hMyWindow1, capStatusCallback1);
SendMessage(hMyWindow1,WM_CAP_DRIVER_CONNECT,0,0);
SendMessage(hMyWindow1, WM_CAP_SET_SCALE, true , 0);
SendMessage(hMyWindow1, WM_CAP_SET_PREVIEWRATE, 66, 0);
SendMessage(hMyWindow1, WM_CAP_SET_PREVIEW, true , 0);
SendMessage(hMyWindow1,WM_CAP_DLG_VIDEOSOURCE,0,0);
hMyWindow = capCreateCaptureWindow("", WS_CHILD |WS_VISIBLE,rect.left, rect.top,rect.right,rect.bottom, hw, 0);
capSetCallbackOnStatus( hMyWindow, capStatusCallback1);
SendMessage(hMyWindow,WM_CAP_DRIVER_CONNECT,0,0);
SendMessage(hMyWindow, WM_CAP_SET_SCALE, true , 0);
SendMessage(hMyWindow, WM_CAP_SET_PREVIEWRATE, 66, 0);
SendMessage(hMyWindow, WM_CAP_SET_PREVIEW, true , 0);
SendMessage(hMyWindow,WM_CAP_DLG_VIDEOSOURCE,0,0);
p=SendMessage(hMyWindow,WM_CAP_FILE_SET_CAPTURE_FILE , 0,(LPARAM) (LPVOID) cname1);
p= SendMessage(hMyWindow, WM_CAP_GET_SEQUENCE_SETUP, sizeof(CaptureParams),(LPARAM) (LPVOID)(LPCAPTUREPARMS)&CaptureParams);
CaptureParams.dwRequestMicroSecPerFrame=14286; CaptureParams.fYield=1;
p= SendMessage(hMyWindow, WM_CAP_SET_SEQUENCE_SETUP, sizeof(CaptureParams),(LPARAM) (LPVOID)(LPCAPTUREPARMS)&CaptureParams);
p=SendMessage(hMyWindow, WM_CAP_SEQUENCE, 0, 0);
p=SendMessage(hMyWindow1,WM_CAP_FILE_SET_CAPTURE_FILE , 0,(LPARAM) (LPVOID) cname2);
p= SendMessage(hMyWindow1, WM_CAP_GET_SEQUENCE_SETUP, sizeof(CaptureParams),(LPARAM) (LPVOID)(LPCAPTUREPARMS)&CaptureParams);
CaptureParams.dwRequestMicroSecPerFrame=14286; CaptureParams.fYield=1;
p= SendMessage(hMyWindow1, WM_CAP_SET_SEQUENCE_SETUP, sizeof(CaptureParams),(LPARAM) (LPVOID)(LPCAPTUREPARMS)&CaptureParams);
SendMessage(hMyWindow1, WM_CAP_SEQUENCE, 0, 0);
SetWindowText(GetDlgItem(hDlg, IDC_START_CAPTURE), "Stop Capture");