Start ffmpeg transcoding with php
-
Hey there! I want to restart a live stream by hand via a php script. Everything works fine so far, but the following command causes that the script loads forever and the transcoding isn't working: nohup openRTSP -v -c rtsp://*****.dyndns.org:665 | ffmpeg -r 5 -f mjpeg -i - http://127.0.0.1:8090/feed1.ffm > /dev/null & Any ideas how to start that command e.g. without waiting for the output?
-
Answer:
Not that it will necessarily solve your problem, but it should answer your question, found in the PHP comments under "exec" in which several people came across similar situations. I combined several efforts in this topic into one function: This will execute $cmd in the background (no cmd window) without PHP waiting for it to finish, on both Windows and Unix. function execInBackground($cmd) { if (substr(php_uname(), 0, 7) == "Windows"){ pclose(popen("start /B ". $cmd, "r")); } else { exec($cmd . " > /dev/null &"); } }
acy at Stack Overflow Visit the source
Related Q & A:
- Where To Get Free Php Scripts?Best solution by Yahoo! Answers
- How To Load Rss Into Php?Best solution by Stack Overflow
- How to store data in php and get data from php?Best solution by Stack Overflow
- How do I start a consulting business with very little start-up capital?Best solution by Yahoo! Answers
- How to start creating a php script, that will be installed on many servers?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.