[FFmpeg-devel] [RFC] ffmpeg.c refactoring

Ralf Terdic contact
Wed Jun 11 10:46:09 CEST 2008


On Wednesday 11 June 2008 10:24:25 Luca Abeni wrote:
> In the past, I worked on a project where ffmpeg was used by forking a new
> process and calling exec() as Michael is suggesting.
> If you consider the CPU time needed for encoding or transcoding a file,
> you see that the fork() overhead is not even measurable in this case
> (believe me, I did a lot of tests and measurements about it).

Depends on what you're trying to do. If you want to extract JPEGs from tiny 
FLV files, or split up a GOP to seek in between keyframes, transcoding is 
really fast. When starting it in a new process, it isn't that fast anymore, 
especially if you need to parse the ffmpeg output afterwards. Besides, 
there's a process number limit you don't want to reach.

Of course exec() is an option, but it's a question of being able to serve 
tens, hundreds, or thousands of users.

Ralf




More information about the ffmpeg-devel mailing list