Why does FFMpeg stop after five seconds when run f

2019-07-15 17:15发布

问题:

I wrote a little daemon in Perl that calls up FFMpeg to encode a video but the encoding stops after 5 or so seconds.

I use this piece of code to start it:

my $t = `echo '$ffmpeg_command' >>$self->{FFMPEG_OUTPUT}`;
my $log_data = `$ffmpeg_command 2>>$self->{FFMPEG_OUTPUT}`;

Any ideas?

If I start the FFMpeg command myself it works fine by the way.

回答1:

Ok, I found it myself

It was an IO lock, apparently you will have to add </dev/null at the end of the command

My above statement will look like this:

my $log_data = `$ffmpeg_command 2>>$self->{FFMPEG_OUTPUT} </dev/null`;


标签: perl ffmpeg