1 #include <libming.h> 2 #include <stdlib.h> 3 main()4int main() { 5 SWFMovie m = newSWFMovieWithVersion(7); 6 SWFVideoStream stream; 7 int i; 8 FILE *file; 9 file = fopen(MEDIADIR "/video01.flv", "rb"); 10 if(!file) 11 { 12 perror(MEDIADIR "/video01.flv"); 13 return EXIT_FAILURE; 14 } 15 16 stream = newSWFVideoStream_fromFile(file); 17 if(!stream) 18 { 19 printf(stderr, "Could not create SWFVideoStream from file\n"); 20 return EXIT_FAILURE; 21 } 22 23 SWFVideoStream_setFrameMode(stream, SWFVIDEOSTREAM_MODE_MANUAL); 24 SWFVideoStream_setDimension(stream, 200,200); 25 int frames = SWFVideoStream_getNumFrames(stream); 26 SWFMovie_add(m, (SWFBlock)stream); 27 for(i = 0; i < frames; i++) 28 { 29 if(i & 1) 30 SWFVideoStream_nextFrame(stream); 31 SWFMovie_nextFrame(m); 32 } 33 34 SWFMovie_save(m, "test04.swf"); 35 return 0; 36 } 37