quicktime movie recorder

this example is very rough at the moment, but it allows you to record a movie into RAM, and then, when you are done recording to save the movie to disk. it might be faster to record directly to disk, but I needed to do the two step process

it’s completely rough, but there is code in this example for picking the codec type, specifying the frame duration when you add a frame, etc. There is still alot to be done with this code, but I thought it people might find it helpful.

Also, I include in this example a kind of modified moviePlayer, which can play the movie that was made in RAM (instead of just loading from a file).

there is a zipped project here
(it’s a whole CW 0.02 project, but you can just rip out the source).

take care!
zach

(ps, also I didn’t have the oppourtunity to check it on a mac yet so it might not work straight away… I hope it does!)

Thanks Zach.

I’ve put memoryMovieMaker.cpp and .h into \v0.02\libs\openFrameworks\video\ added the files to the project and included them in code.

When I go to compile it brings up this error:

1>Compiling…
1>memoryMovieMaker.cpp
1>…\libs\openFrameworks\video\memoryMovieMaker.cpp(214) : warning C4129: ‘p’ : unrecognized character escape sequence
1>…\libs\openFrameworks\video\memoryMovieMaker.cpp(214) : warning C4129: ‘p’ : unrecognized character escape sequence
1>…\libs\openFrameworks\video\memoryMovieMaker.cpp(214) : error C2664: ‘StandardPutFile’ : cannot convert parameter 1 from ‘const char [24]’ to ‘ConstStr255Param’
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

Line 214 is this:
StandardPutFile("\pEnter movie file name:", “\puntitled.mov”, &sfr);

Any ideas?

hi !

I fixed a major bug (that was not visible because I was adding frames of noise, but immediately visiable once I wanted to record something meaningful) in the code and rewrote some functions to make them visual studio friendly –

http://www.openFrameworks.cc/files/movi-…-ple-v2.zip

the problem you were having is VS not knowing about pascal strings (the “/p” has to do with pascal) – quicktime is full of very old, strange things like that.
the solution is to do the following:

c2pstr(“Enter movie file name:”)

instead of “/pEnter movie file name”

but, as I said above - I fixed other issues, so you should download this new code.

I’ve also added a new save function, so now there are two:

  
  
void 			saveViaFileDialog();  
void 			save(char * fileName);  
  

the save (fileName) function saves to the current working directory, since quicktime needs to know the full path of where to save and it doesn’t need to bring up a pop up window that freezes the execution of the main app.

I’m not sure that either of these functions will work right away on a mac (I can’t test from here), but they shouldn’t be too complicated to port over.

take care!
zach

Thanks Zach, compiles fine and the example works great.

Have you tried using ofCvGrayImage or ColorImage?

movieMaker.addFrame(giMovie.getPixels());

it comes up out with a funny image

Strange because also that green/grey image at the bottom isn’t even part of giMovie :slight_smile:

Hey, I’m trying to make an application that will record from a webcam, but I seem to be running into a similar error regarding the same line of code as chris, except it’s the updated code :slight_smile:

StandardPutFile(c2pstr(“Enter movie file name:”), c2pstr(“untitled.mov”), &sfr);
I’m getting an error pointing at this line when I try to use the save dialog.

This is the exact error information:

Unhandled exception at 0x6692fc0a in openFrameworksApp.exe: 0xC0000005: Access violation writing location 0x004ab2b0.

and I’m using VSEE on windows xp. Any suggestions?

I feel so special, I was able to create my application! It seemed grainy at first until I changed the codec type to 20 (“Video”) and then it looked pretty good. I was able to use the ofVideoGrabber.getPixels(); method and send it straight to movieMaker.addFrame(); which was much easier than I thought it would be.

It’s officially the first useful thing I’ve made with openFrameworks. It’s simple, but it’s a start (especially considering my c++ experience is very lacking)

I’d like to add audio recording capabilities as well, but if it’s not built in I probably wont be able to manage it.

Hey All,

Has anyone got this working on OS X 10.5 / OF 0.05? I have downloaded the source and added the changes described above in terms of includes.

  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:222: error: 'StandardFileReply' was not declared in this scope  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:222: error: expected `;' before 'sfr'  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:225: error: 'sfr' was not declared in this scope  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:225: error: 'StandardPutFile' was not declared in this scope  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:267: error: 'MAX_PATH' was not declared in this scope  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:268: error: 'cwdir' was not declared in this scope  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:268: error: '_MAX_PATH' was not declared in this scope  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:268: error: '_getcwd' was not declared in this scope  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:269: error: size of array 'buffer' has non-integral type '<type error>'  
/Users/joel/Documents/Projects/velvin/OSCAndFlash/OF/apps/makingMusicVideos/NONWORKING_movie_recorder_fromZach/src/memoryMovieMaker.cpp:272: error: 'NativePathNameToFSSpec' was not declared in this scope  

Any suggestions?

JGL