Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

second VideoWriter: not write frames.

I want to write two files simultaneously (VideoWriter). C# win7.

      class VideoCaptureClass
     { 
        ...    
        public void StartVideo(int vcam, string UrlCam, int videonum)
        { 
              ...
              cap = new VideoCapture(UrlCam);  
              writer1 = new VideoWriter(outputFilename, "PIM1",capture1.Fps, dsize); 
              ...
        } 
        ... 
        public void Run()
        { 
                     ...
                     cap.Read(_image1); 
                     writer1.Write(_image1);
                     ...
        }

in mainform:

        capture.StartVideo(Globals.vcam1, Globals.UrlCam1, 1);
        capture2.StartVideo(Globals.vcam2, Globals.UrlCam2, 2);            
        TSK = Task.Factory.StartNew(capture.Run);
        TSK2 = Task.Factory.StartNew(capture2.Run);

As a result, only one file is written , and the second is left empty ( header only ) ...

i see capture._image1 and capture2._image1. Both Both are readed correctly. :( i probe ip-cam and web-cam. The result is the same.

whether OpenCV write 2 media file ? How to do it?