Ask Your Question

CvVideoCamera Start / Stop Recording but not video display

asked 2013-02-11 22:25:41 -0600

Trying to figure out how to turn on the video feed of CvVideoCamera - using start, and then at some point later on to turn on recording. At the moment it looks like you need to start recording when you start the camera session.

So how do I start session with recordVideo set to No, the later set it to Yes and have recording start at that point. Thanks for any help

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-02-12 02:56:09 -0600

When you record a stream, images are record only if you use the operator<<. Therefore, use a flag:

     myrecorder << myimage;

Simply change the value of the flag when you want to record images. But initialize ``myrecorder'' before of course.

edit flag offensive delete link more


So from the sounds of it you need to initialize a new session to start recording ?

Allotrope gravatar imageAllotrope ( 2013-02-12 08:43:13 -0600 )edit

You create your recording object wherever you want, and you add only the image you want. You can close it when you want and open another one after... Just keep in mind scope if you are coding in C/C++, that's what I want to say when I write ``before'' in my answer.

Mathieu Barnachon gravatar imageMathieu Barnachon ( 2013-02-12 08:50:22 -0600 )edit

I probably should have been more clear that I am doing this for IOS and using cap_ios

so the initialization code looks like this.

self.videoCamera = [[CvVideoCamera alloc] initWithParentView:imageView];
self.videoCamera.defaultAVCaptureDevicePosition = AVCaptureDevicePositionBack;
self.videoCamera.defaultAVCaptureSessionPreset = AVCaptureSessionPresetMedium;
self.videoCamera.defaultAVCaptureVideoOrientation = AVCaptureVideoOrientationLandscapeRight;
self.videoCamera.defaultFPS = 30;
self.videoCamera.recordVideo = YES;
self.videoCamera.delegate = self;

then I call [self.videoCamera start]; what I like to do is toggle recording on and off while the feed continues to play on screen. However recordVideo is only evaluated when start is called.

Allotrope gravatar imageAllotrope ( 2013-02-12 10:29:45 -0600 )edit

I'd like to be able to set recordVideo with true or false and have it actually do something after the start call.

Allotrope gravatar imageAllotrope ( 2013-02-12 10:30:52 -0600 )edit

Question Tools


Asked: 2013-02-11 22:25:41 -0600

Seen: 1,109 times

Last updated: Feb 12 '13