Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

videocapture not working with uncompressed files

I try to read uncompressed video files, created by using videowriter and the Y800 FOURCC code and I always have a program crash. I can read the video file generated with Windows media player. The used code is the following :

void CMFC_OpencvDlg::OnBnClickedBlobSeq() { static CString Filter=_T("Video files (.avi; *.mpg) |.avi;.mpg|All Files (.)|.||"); CFileDialog Load(TRUE, _T(".bitmap"), NULL, OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_HIDEREADONLY,Filter,NULL); Load.m_ofn.lpstrTitle= _T("Lecture video"); int value = 0 ;

if (Load.DoModal() == IDOK) 
{
    img_path = Load.GetPathName() ;
    VideoCapture Sequence(img_path);
    while( true) //Show the image captured in the window and repeat
    {
        Sequence >> src;
        if (src.empty() ) return ;
        imshow("image", src);
        AfxMessageBox(_T("Image"),0,0) ;
    }
}

}

If I use an other Codec all is OK the program works perfectly, But I need work on uncompressed images in order to not degrade image quality.

I am working under Windows 7 with Microsoft Visual Studio 10.

Does some body have an idea on what happens ?

Thanks

click to hide/show revision 2
No.2 Revision

videocapture not working with uncompressed files

I try to read uncompressed video files, created by using videowriter and the Y800 FOURCC code and I always have a program crash. I can read the video file generated with Windows media player. The used code is the following :

void CMFC_OpencvDlg::OnBnClickedBlobSeq()
{
    static CString Filter=_T("Video files (.avi; (*.avi; *.mpg) |.avi;.mpg|All |*.avi;*.mpg|All Files (.)|.||");
(*.*)|*.*||");
    CFileDialog Load(TRUE, _T(".bitmap"), _T("*.bitmap"), NULL, OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_HIDEREADONLY,Filter,NULL); 
    Load.m_ofn.lpstrTitle= _T("Lecture video");
    int value = 0 ;

;

    if (Load.DoModal() == IDOK) 
 {
     img_path = Load.GetPathName() ;
     VideoCapture Sequence(img_path);
     while( true) //Show the image captured in the window and repeat
     {
         Sequence >> src;
         if (src.empty() ) return ;
         imshow("image", src);
         AfxMessageBox(_T("Image"),0,0) ;
        }
    }
}

}

If I use an other Codec all is OK the program works perfectly, But I need work on uncompressed images in order to not degrade image quality.

I am working under Windows 7 with Microsoft Visual Studio 10.

Does some body have an idea on what happens ?

Thanks