c ++ y openCV con windows8: la clase VideoWriter no se abre
Frecuentes
Visto 376 veces
1
I am trying to record a video using openCV's class VideoWriter.
Usando la siguiente función,
void addFrameToVideo(Mat& frame)
{
if(_vid.open("test.avi", CV_FOURCC('M','J','P','G'), 30, frame.size(), 1))
cout << "here" << endl;
_vid.write(frame);
}
_vid is a variable of type VideoWriter and I can imshow frame with no problems.
The if condition never verifies, since the program never outputs "here". However, this code actually creates a "test.avi" file in the directory, but it remains empty. I've tried several different compression methods with no success.
¿Alguna idea?
1 Respuestas
0
It is possible that the codec could not be found in your system. You should try using different codecs. Alternatively, you can pass the value -1 instead of CV_FOURCC()
and a window will pop up at runtime that contains all the codec installed on your system and ask you to select the one to use (this only works on Windows).
Respondido el 30 de Septiembre de 13 a las 17:09
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas c++ opencv video windows-8 or haz tu propia pregunta.