Why does FFMpeg stop after five seconds when run f

2019-07-15 17:19发布

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.

标签: perl ffmpeg
1条回答
【Aperson】
2楼-- · 2019-07-15 17:41

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`;
查看更多
登录 后发表回答