Why does FFMpeg stop after five seconds when run from a Perl daemon?
Question
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.
Solution
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`;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow