Programming screen recorder - output issues
Asked Answered
R

2

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

Regain answered 20/6, 2012 at 15:20 Comment(5)
ffmpeg is cross-platform, licensed under LGPL or GPL, recently updated.Alaniz
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 filesRegain
The docs describe encoding from image frames to mpeg. Won't that do what you want?Alaniz
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?)Regain
https://mcmap.net/q/211951/-screen-recorder-closed visit this link for working FFMPEG c++ screen recorder sample code.Pellitory
R
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:

Repeat answered 20/6, 2012 at 22:27 Comment(2)
Thanks to all! DLL solution looks promising. I check it outRegain
@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.Alaniz
H
-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.

Heavyarmed answered 21/6, 2012 at 19:51 Comment(1)
did you see the OP's first requirement? "cross-platform"Alaniz

© 2022 - 2024 — McMap. All rights reserved.