And just to make sure, you want to do this programmatically? Just asking, because I’ve had more than one project in the past where using an external screen recording / broadcasting tool (like OBS) turned out to be much more appropriate :).
I’m currently working on that same topic with MSYS2 (Windows 7 & Windows 10).
My approach is to open a pipe to ffmpeg and then to write each frame to that pipe.
That seems to work but need further testing.
@Paul-Jan: I don’t need to do this programatically for this project actually but I can see benefits of doing programatically via an integrated encoder such as ffmpeg and would really I would like to get it set up so I have it ready for future projects. Ideally I would be able to record performances programatically without using a 3rd party app.
@oxillo: that seems to be the method used by ofxVideoRecorder too. I don’t think I know enough about it yet to attempt my own solution and would prefer not to re-invent the wheel but saying that I’m not sure if there is a Windows ready solution available? If not I will attempt to hack the available source and get it working with ffmpeg.
I have tried 2 different versions of ofxVideoRecorder: the main branch by timscaffidi and a fork by DomAmato but neither of them seem to work on my system.
I may be doing something wrong (although I’m pretty sure the main branch isn’t compatible due to it using ‘unistd.h’ )
The DomAmato branch was, I think, meant to address the unistd.h and Windows compatibility issues.
I tried to compile the included example project but there are various methods which have been removed from the main branch, after commenting these out it compiles and runs but comes up with errors (such as \.\pipe\videoPipe915: Invalid argument and Output file #0 does not contain any stream
As I say I may have it set up wrong but am using the included example src.
I was wondering if anyone had this running succesfully on OF 093/win10 or if there are any other addons which would do the trick?
If not I will use a 3rd party solution for now and try to implement my own using pipes and ffmpeg when I have the time.
I should probably update the examples in my fork but I have not tried it on MSYS2 since I wrote it to work with people developing on visual studio. I am able to compile and run my fork but it has never been tested (to my knowledge) with MSYS2 so it might just be incompatible.
The fork utilizes named pipes on windows so its not using the same pipe that oxillio pointed out in his snippit of code. I should also mention that pipes on windows supposedly runs slower and that is the point of the named pipes paradigm.
I was using the snippet above on Windows 7 and Windows 10 with MSYS2 until recently. One of the limitations was that the recorded video was playing at twice the recorded rate; but I didn’t had the time to look into it.
I’ve started a alternate version of this addon but using libav (the underlying libs of ffmpeg) instead of the pipe to ffmpeg. I’ll try clean the code and to make it available.
UPDATE : the code is available here ofxScreenRecorder
You wanna record screen on Windows? It is very easy. You need a Windows screen recording tool. The tool I often use is Joyoshare Screen Recorder and OBS. Such the software can record any area on your screen with high quality. If you still need a screen recorder now, you may choose to have a try.