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

Luca Abeni lucabe72
Wed Jun 11 10:57:05 CEST 2008

Ralf Terdic wrote:
> 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
Did you measure this overhead? I did...

> Besides, there's a process number limit you don't want to reach.
If the number of forked processes is too high, wait before serving a new

> Of course exec() is an option, but it's a question of being able to serve 
> tens, hundreds, or thousands of users.
So, you want to decode thousands of videos simultaneously... I repeat: the
problem here is not the fork() overhead.


More information about the ffmpeg-devel mailing list