Bonjour,
j'essaie de créer des avi avec vfw.h mais je bute sur un problème lié à la fonction "AVISaveOptions".
Premièrement j'ai pu m'apercevoir sur la toile qu'on ne pouvait pas se passer de la boite de dialogue qui apparaît pour le choix du codec de compression lorsqu'on appelle "AVISaveOptions". Dans cette boite de dialogue on peut choisir de travailler en trames complètes (sans compression). Si je fais ce choix, puis-je me passer d'appeler "AVISaveOptions" et "AVIMakeCompressedStream" ?
Par ailleurs, j'ai une erreur à l'exécution lors de l'appel de "AVISaveOptions".
Je voudrais savoir si quelqu'un a déjà été confronté à ce problème lié à "AVISaveOptions" ?
Voici le code :
Avec les variables :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 AVIFileInit(); HRESULT hr = AVIFileOpen(&this->avi, videoFilename.c_str(), OF_WRITE | OF_CREATE, NULL); if(hr != AVIERR_OK) ShowMessage("Error with AVIFileOpen"); // Fill in the header for the video stream.... ZeroMemory(&strhdr, sizeof(strhdr)); strhdr.fccType = streamtypeVIDEO; strhdr.fccHandler = 0; strhdr.dwScale = 1; strhdr.dwRate = 15; strhdr.dwSuggestedBufferSize = 3 * width * height; SetRect(&strhdr.rcFrame, 0, 0, width, height); // And create the stream; hr = AVIFileCreateStream(this->avi, &this->videoStream, &this->strhdr); if(hr != AVIERR_OK) ShowMessage("Error with AVIFileCreateStream"); AVICOMPRESSOPTIONS options; AVICOMPRESSOPTIONS * arrOptions[1] = {&options}; ZeroMemory(&options, sizeof(options)); hr = AVISaveOptions(NULL, ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE, 1, &videoStream, (LPAVICOMPRESSOPTIONS *)&arrOptions);
Merci beaucoup.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 PAVIFILE avi; PAVISTREAM videoStream; PAVISTREAM psCompressed; AVISTREAMINFO strhdr;
Flo.
Edit : l'erreur à l'exécution de la fonction AVISaveOptions survient après l'affichage de la boite de dialogue du choix du codec.
Partager