second VideoWriter: not write frames. [closed]

asked 2015-09-18 12:03:24 -0600

Gosha_DE gravatar image

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?

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2015-09-19 01:27:37.288804

Comments

sorry, but since this is not an opencv problem, but one with your 3rd party c# wrapper api, this is the wrong forum to ask.

berak gravatar imageberak ( 2015-09-19 01:27:30 -0600 )edit