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!)
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 –
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:
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.
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
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.
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