为什么FFMpeg在从Perl守护程序运行5秒钟后停止? [英] Why does FFMpeg stop after five seconds when run from a Perl daemon?
本文介绍了为什么FFMpeg在从Perl守护程序运行5秒钟后停止?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用这段代码启动它:
my $ t =`echo'$ ffmpeg_command'>> $ self> {FFMPEG_OUTPUT} ;
我的$ log_data =`$ ffmpeg_command 2>> $ self> {FFMPEG_OUTPUT}`;
任何想法?
如果我开始FFMpeg命令自己它的方式很好。
解决方案
好的,我发现了自己
这是一个IO锁,显然你必须在命令结尾添加< / dev / null
我的上述声明将如下所示:
my $ log_data =`$ ffmpeg_command 2> > $ self> {FFMPEG_OUTPUT}< / dev / null`;
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.
解决方案
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`;
这篇关于为什么FFMpeg在从Perl守护程序运行5秒钟后停止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文