Pergunta

Hi i'm new to the openCV library. Just really installed in today and i was trying to do some basic stuff like show a picture in a window and show a video in a window. I got both of these to work but when i try and show the video it plays without sound and i get the following
[mp3 @ 0x107808800] Header missing
in the console. How do i add the mp3 header so it plays with sound? here is my code

int main(int argc, const char * argv[])
{

if (argc<2) {
    printf("not enough arguments");
    return -1;
}
//create a window
namedWindow(windowName,WINDOW_AUTOSIZE);


Mat frame;



//capture video from file
VideoCapture capture;
capture.open(argv[1]);


int run=1;

while (1) {

    //make play and pause feature

    if (run !=0) {



    capture>>frame;
    imshow(windowName, frame);

    }

    char c=waitKey(33);
    if (c=='p') {
        run=1;
    }
    if (c=='s') {
        run=0;
    }

    if (c ==27 || c=='q') {
        break;
    }

}


return 0;
}
Foi útil?

Solução

you can't .

audio gets discarded (that's the message you get), and there's no way to retrieve it again.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top