How do I start creating screen recorder?

Hello there Xojo forum.

As the topic said. Can someone guide me where should I start learning? (class, plugins, etc…)

I can create simple screenshot app but want to explore further more on capture a simple video+audio.
Export as mp4 for web, desktop.

Thinking about to record a portion or full screen video for not more than 5 min long.

Looking for both Mac and Windows solutions.
Linux isn’t neccessary but nice to have though.

FYI. I’ve review MBS plugins and seems like it is not a good solution any more after Quicktime support is gone.

You can use ffmpeg:

Make sure your ffmpeg build supports it though. For example, when you do: “ffmpeg -devices” on OS X, it should list: “D avfoundation AVFoundation input device” at the bottom.

Thank you Marco, I’m downloading and will try it.

Hi forums and Marco

I’ve done. Get an impressive result for what is free.
So I think it’d be useful to share with people here.
Please note that I’m no expert in ffmpeg. I just looking at the link Marco gave me then do a bit more explore.

Install ffmpeg, in my case, Mac OS X, I install via brew

# brew install ffmpeg

Looking for my device id, audio, video
In my case, there were [1] and [1] and it is depend on your setting.

# ffmpeg -f avfoundation -list_devices true -i ""

Start recording audio + video

# ffmpeg -video_size 1440x900 -framerate 30 -f avfoundation -i 1:1 -ac 2 -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le ~/Desktop/uncompressed.mkv

For my Macbook Pro , I was recording video only since audio quality is not good. So leave -i 1:_ for no audio device.

# ffmpeg -video_size 1440x900 -framerate 30 -f avfoundation -i 1: -ac 2 -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le ~/Desktop/uncompressed.mkv

Then compress it again from .mkv to .mp4 or any codecs you may need
This step I’m feeling it is slower than other compressor. so it may be helpful to find yourself some video converter app.

# ffmpeg -i ~/Desktop/uncompressed.mkv -acodec mp3 -vcodec h264 ~/Desktop/final.mp4

If you may need to see your ffmpeg app come with which codecs

# ffmpeg -codecs

So, hope this may be helpful for other surfers. :slight_smile:

Cool that it works. :slight_smile:
I cannot test because I don’t have an ffmpeg build that can capture here but about the last step (mkv -> mp4)… it seems to me that you can skip that.
.mkv, .mp4, .m4v and .mkv are just containers.
.mkv is most flexible but they all can contain h.264 video.

I think that the example page uses .mkv because an .mp4 container cannot contain .wav audio streams. And .wav/pcm audio is easiest to capture.
So if you don’t need audio, I think you can replace ~/Desktop/uncompressed.mkv with ~/Desktop/uncompressed.mp4. (or force it with -f mp4)

If you need audio, then aac is best for .mp4 but the encoding is quite heavy. I’m not sure about .mp3.

If you don’t want to use Brew then.
Here is a link with binary ready for 32/64 bit ffmpeg

Thank you. The thing is that manually build them because I use some specific libraries.

Sorry i misread the answer.

On Mac you could use AVFoundation stuff to record very efficiently.

@Christian Schmitz I’m not take a look at it. Had seen in your MBS but can’t figure it out how to do the same as the old example screen recorder. May be you can rewrite the example for the recent Xojo with AVfoundation/DirectShow if possible.

For Windows I have no screen recorder. And for AVFoundation there is an example to record screen if I remember correctly.