8

I want record screen (by capturing 15 screenshots per second). This part I know how to do. But I don't know how to write this to some popular video format. Best option which I found is write frames to separated PNG files and use commandline Mencoder which can convert them to many output formats. But maybe someone have another idea?

Requirements:

  • Must be multi-platform solutions (I'm using Free Pascal / Lazarus). Windows, Linux, MacOS
  • Exists some librarys for that?
  • Could be complex commandline application which record screen for me too, but I must have possibility to edit frames before converting whole raw data to popular video format
  • All materials which could give me some idea are appreciated. API, librarys, anything even in other languages than FPC (I would try rewrite it or find some equivalent)
  • I considered also writting frames to video RAW format and then use Mencoder (he can handle it) or other solution, but can't find any API/doc for video RAW data

Regards

Dibo
  • 1,159
  • 17
  • 34
  • [ffmpeg](http://ffmpeg.org/) is cross-platform, licensed under LGPL or GPL, recently updated. – Argalatyr Jun 20 '12 at 17:14
  • It looks like Mencoder project. So I have solutions for output encoding. But how to prepare input for those encoders? I'm looking for something different than series of PNG files – Dibo Jun 20 '12 at 17:25
  • The [docs](http://ffmpeg.org/faq.html#How-do-I-encode-single-pictures-into-movies_003f) describe encoding from image frames to mpeg. Won't that do what you want? – Argalatyr Jun 20 '12 at 17:32
  • Yes, if there is no better way I will use series of graphic files, but I'm worrying about speed of this solution (creating file for each frame should take longer than writting to one file?) – Dibo Jun 20 '12 at 17:38
  • http://stackoverflow.com/a/43464269/6180077 visit this link for working FFMPEG c++ screen recorder sample code. – Abdullah Farweez May 09 '17 at 04:22

2 Answers2

5

Argalatyr mentioned ffmpeg already.

There are two ways that you can get that to work:

  1. By spawning an new process. All you have to do is prepare the right input (could be a series of jpeg images for example), and the right commandline parameters. After that you just call ffmpeg.exe and wait for it to finish.

  2. ffmpeg makes use of some dll's that do the actual work. You can use those dll's directly from within your Delphi application. It's a bit more work, because it's more low-level, but in the end it'll give you a finer control over what happens, and what you show the user while you're processing.

Here are some solutions to check out:

Wouter van Nifterick
  • 23,603
  • 7
  • 78
  • 122
  • Thanks to all! DLL solution looks promising. I check it out – Dibo Jun 21 '12 at 07:44
  • @Wouter: you may want to edit your answer now that someone has deleted my (earlier) answer as nothing more than a comment. Seems unfair to me, but them's the breaks. – Argalatyr Jun 22 '12 at 00:25
-1

There was some earlier discussion with a Delphi component here. It's a very simple component that sometimes generates some weird movies. Maybe a start.

Community
  • 1
  • 1
Arnold
  • 4,578
  • 6
  • 52
  • 91