Add -timelimit option

This option limits the CPU time used by ffmpeg to the number of seconds
specified.  After this time, the OS sends a SIGXCPU signal, which we
handle and attempt to exit cleanly.  If the process is stuck, the OS
will deliver a SIGKILL one second later, forcibly terminating the
process.

This functionality is useful in automated setups where a runaway ffmpeg
process would otherwise go undetected.

Originally committed as revision 21347 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2010-01-20 06:42:39 +00:00
parent 5e7dfb7de1
commit ffcc6e24f5
3 changed files with 26 additions and 0 deletions

View file

@ -55,6 +55,11 @@ int opt_default(const char *opt, const char *arg);
*/
int opt_loglevel(const char *opt, const char *arg);
/**
* Limit the execution time.
*/
int opt_timelimit(const char *opt, const char *arg);
/**
* Parses a string and returns its corresponding value as a double.
* Exits from the application if the string cannot be correctly