1

i have about 10-15 FFmpeg Process for streaming server like this:

ffmpeg -i "http://ip/play/a03i" -vcodec copy -acodec copy -f flv "rtmp://ip:80/APP/Name"

am use the Nginx-rtmp module to run it using the exec_static Directive but i can't monitoring every channels or process, can't stop start restart edit any stream without stop all channels

any idea Please?

Best,

  • What are you trying to do? – 030 Feb 21 '17 at 22:19
0

Try with something like (this is in PHP but you can use similar procedure from other scripts):

                    $cmd = "ps aux | grep '-vcodec copy -acodec copy -f flv'";
                    exec($cmd, $output, $returnvalue);

                    $transcoders = 0;
                    foreach ($output as $line) if (strstr($line, "ffmpeg"))
                        {
                            $columns = preg_split('/\s+/',$line);

                            if ($kill) //customise this to kill a process
                            {
                                $kcmd = 'kill -KILL ' . $columns[1];
                                exec($kcmd, $koutput, $kreturnvalue);
                            }
                         }

Functionality is inspired from a WP Videochat Plugin that has a backend section for monitoring and killing FFMPEG processes (used for transcoding live streams for HLS playback and generating snapshots from streams).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.