[FFmpeg-user] Conrtolling the rate at which ffmpeg converts a file from one format to another

Corne Beerse cbeerse at gmail.com
Mon Mar 28 10:18:27 CEST 2011

On 24-3-2011 3:39, Bryce Utting wrote:
> RT mxa wrote:
>> I am attempting to use ffmpeg as a standalone process which feeds output
>> through memory to my application (I want to avoid creation of an
>> intermediate file).
>> Is there any way to invoke ffmpeg with a set of command line 
>> arguments which
>> tell ffmpeg to convert till say it uses up 200MB and then wait till 
>> space
>> gets freed up by my process which will read the output of ffmpeg.
> Assuming Unix, it'd probably make more sense for your application to 
> send a SIGSTOP signal when it has sufficient data queued and then a 
> SIGCONT to resume.  I'm not sure about triggering on size (especially 
> where pipes are involved), but watching stderr should tell you what 
> frame ffmpeg is up to, which could be more useful.

Assuming unix, you should not be troubled about the intermediate file as 
it is not a file as such, it is a fifo, a pipe or whatever: The feeding 
process will just process until the fifo/pipe gets over a size limit. 
Then the os will limit the feeding process until the reading process has 
read enough to drop below the size limit. That is all os driven, the 
feeding process (ffmpeg) does not see anything of this, it is just not 

If you want to contol the size of the pipe/fifo/buffer (whatever you 
call it) you should peek into this at the unix/os level. Then you can 
create your own fifo-file (aka 'named-pipe') and use that in the 
pipeline. It is a hell of a job to get this going, specially if you do 
it the first time. Hence, better use normal pipelining until you run 
into real trouble.

btw: if you are using msWindows, then the above is none of your 
business, as far as I know, msWindows does not provide 'named pipes' and 
such as unix does.


More information about the ffmpeg-user mailing list