screenrecording


#1

how do you guys make screenrecordings of your oF apps? i tried several osx screenrecording apps but i haven’t found one which meets my requirements … i simply couldn’t get framerates of 30fps or above.

any app recommendations? i’m on osx by the way


#2

Hi,

Have the same question (but on Microsoft 7) :
what do you use to capture what do youhave on screen with good quality, good capture fps and most cheap as possible ?

  • external video card as matrox ?
  • screen capture software (risk to have slow result and slow program) ?
  • digital camera shooting the screen :-\ ?
  • DVD recorder ???

Cheers.


#3

Some answers to that eternal question :

http://forum.openframeworks.cc/t/screen-recording-from-within-of/2194/0
redirecting to these:
http://forum.openframeworks.cc/t/ofxtilesaver—high-resolution-opengl-screen-grabs/1783/0
http://forum.openframeworks.cc/t/saveimage-plus-alpha/1145/5

To my mind, this one could be the most exciting, and end of topic is interesting to get sequence
http://forum.openframeworks.cc/t/multithreaded-image-saver/1687/0

Apologize to reask answered, but beginner is a long and dummy way


#4

On osx I really like ScreenFlow, though it is $99. http://www.telestream.net/screen-flow/
It also allows you to edit the captured video, among other basic editing features.


#5

I used to use TipCam but it’s no longer available :frowning:


#6

I grabbed Screeny when it was free in the Mac App Store, and it works well, but doesn’t hide the mouse pointer. So for my last project I used ScreenFlick.

More alternatives: http://mac.appstorm.net/roundups/utilities-roundups/10-screen-recording-tools-for-mac/


#7

Not the most cheap possible, but you can use Camtasia Studio in Win 7 http://www.techsmith.com/camtasia/


#8

I prefer saving images every frame, or whenever it is necessary. This way you don’t lose any frames like you most likely will with an external screen grabbing program.

I’ve come up with a fairly efficient method of doing this because I needed to write a program that could record live video from up to three cameras at once.

Here’s what I’ve learned form doing so:
I started with memo’s threaded image saver, and initially extended it to use a linked list of queued up frames to save just in case the disk gets slowed down for a bit, so it’s essentially saving images to memory first, in the form of unsigned char arrays, then writing them to disk as jpgs. If you have a slow disk, then you’ll eventually run out of memory doing this, so in some cases you will have to drop a frame here or there. Or, get an SSD and you’ll be golden.

The second enhancement was to stop saving each frame as an individual file. This can drastically reduce the amount of IO calls because you no longer need to create a new file every time you want to save a frame, instead it gets tacked on to an existing file that is kept open while the program is recording. I did this by using the freeImage library to get compressed jpg binary data into memory and then send that into a file stream. The great thing about this is that mashing a bunch of JPGs together one after another is very similar to an MJPEG video file. All you need to do to make it into a real MJPEG .avi or .mov is run it through ffmpeg. you can even use the ‘-vcodec copy’ option and the re-encoding takes no time at all.

The code I’ve got right now is terribly messy and specialized but this should be a working version, I may package this up into a nice addon soon. You’ll need ffmpeg installed to use the encodeVideo() function:

threadedVidSaver.h

It would be nice to wrap ffmpeg somehow and just throw frames at it, I wonder if that would work any better than this method?


#9

i’ve been using something similar to this lately but instead of storing the whole bitmap in memory i compress it as jpg before, store the jpeg in the queue and then have a thread saving from that queue or if you are recording a short clip just save everything at the end:

  
  
.h  
  
ofPixels pixels;  
ofFbo fbo;  
queue<ofBuffer> frames;  
  
  
.cpp  
  
fbo.begin();  
//draw...  
fbo.end();  
  
fbo.readToPixels(pixels);  
frames.push(ofBuffer());  
ofSaveImage(pixels,queue.back(),OF_IMAGE_FORMAT_JPEG);  
  

then at the end f the recording or in a thread:

  
  
int i=0;  
while(!frames.empty()){  
    ofFile frame(ofToString(i)+".jpg",ofFile::WriteOnly,true);  
    frame << frames.front();  
    frame.close();  
    frames.pop();  
    i++;  
}  
  


#10

Cool, arturo. I wasn’t aware that you could use an ofBuffer with ofSaveImage. This is a very elegant way of getting the compressed data. I will use this approach in the future.

The one potential problem I see is with using the stl library for the queue, I thought these were not thread safe? no problem if you’re buffering and saving at the end, but if you want to save on the fly in a separate thread it could introduce some problems. That is the only reason I bothered to make my own thread safe linked list class.


#11

yes, if you are using a thread then you’ll need to lock at some point, in that case i’ll use a queue of pointers to ofBuffers so the locking doesn’t take too much time.

  
  
queue<ofBuffer*> frames;  
  
// saving to memory:  
ofBufer * buffer = new ofBuffer;  
ofSaveImage(pixels,*buffer,OF_IMAGE_FORMAT_JPEG);  
saverThread.lock();  
frames.push(buffer);  
saverThread.unlock();  
  
// saving to disk:  
while(isThreadRunning()){  
ofBuffer * frame = NULL;  
lock();  
if(!frames.empty()){  
    frame = frames.front();  
    frames.pop();  
}  
unlock();  
if(frame){  
    // save frame to disk  
}else{  
    ofSleepMillis(x);  
}  
}  
  


Pixels to save image works but cannot load data to texture
#12

Arturo, I’ve been incorporating some of your methods into my code, which is helping clean things up quite a bit. using the stl queue seems to have no performance impact over my own linked list, and is much cleaner. I also tried putting the compression before adding to the queue as you sugest, but this actually makes things much slower in the main thread because you are then waiting the extra time it takes to compress before the addFrame() function (or whatever it might be) returns. Similarly, using the compression method I posted seems to be much faster than using ofBuffer and ofSaveImage, I’m guessing due to decreased overhead.

Anyway, I’m now able to record 640x480@60fps from a webcam in very close to real time, with a queue growth rate of only 0.5 - 2 frames/second. Using ofBuffer and ofSaveImage I was getting a growth rate of 10-15 frames/second.

https://github.com/timscaffidi/ofxVideoRecorder

Let me know if you have any suggestions or optimizations


#13

Hi, I’m also looking for a way to record the screen of my app. I use OF_FULLSCREEN to make my app fullscreen. I tried Camstudio and Camtasia and both of them can’t record the screen when I’m in fullscreen mode and return black screens. I’ll appreciate if you can help me with this.
Thanks very much


#16

Popular OBS, FoneLab, TinyTake can all word on OSX. Now typically I use FoneLab to record screen and it works fine so far


#17

I used ofxMacScreenRecorder and it worked fine. I’m not used others btw


#18

I like rendering the output to an FBO and then reading to pixels with ofxFastFboReader and saving to a video file with ofxFFmpegRecorder.
With this method, you can have a gui visible in your OF window to tweak parameters while recording, but you don’t have to render that to the fbo so it won’t show up in the saved video. This also allows you to create an fbo that is larger than the resolution of your screen.


#19

Is this approach mutliplatform? I usually use ofxVideoRecorder but I am not really satisfied because the resolution is limited. I have see that in your repository there is an example, but it is not including ofxFastFboReader


#20

Hi @edapx, yeah it uses ffmpeg which is multiplatform and ofxFastFboReader uses pixel buffer objects, which should be as well? I have tested on OSX and Windows and included static libs for both so that it is portable. It should work on Linux if you install ffmpeg and set ffmpeg in your systems path, though I don’t have much experience with Linux.
There is an option to change the bitrate if you want higher quality.

All you need to do is change the pixel reading to use ofxFastFboReader like below.

mReader.readToPixels(mCapFbo, mPixels, OF_IMAGE_COLOR);
		if (mPixels.getWidth() > 0 && mPixels.getHeight() > 0) {
			m_Recorder.addFrame(mPixels);
		}