In the php system command we use the following
system("ffmpeg -i test.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv output_file.flv 2>&1 &").
Please explain the use of the above system command. What is' 2> & 1 & stand? I want to dump process details to a file, how to do this?
Many thanks.
2>&1redirects " stderr" to " stdout" , &at the end makes the command run in background .
2>&1
stderr
stdout
&
To do this, he must be
«command» 2>&1 > /tmp/somefile.log &
"stdout" ( /dev/null), system() , PHP (, ).
/dev/null
system()
system() :
. , , . PHP .
2 > & 1 (2) (1).
, .
stderr stdout , .
stderr , 2 > 1 2 >
(: 2 > /home/user/output.mpg)
UNIX : stdout stderr. ul > stdout ( 1) . "2 > " stderr ( 2) , "& 1", 1 ( ). php , script, , , .
. , .
If you want to write to a file via PHP, you can also use [exec()][1]or [passthru()][2], which have options to return all the contents from the command. system()will only return the last line.
[exec()][1]
[passthru()][2]
Source: https://habr.com/ru/post/1706745/More articles:What other IoC containers have an IInitializable similar feature? - dependency-injectionhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1706741/can-i-sync-mobile-desktop-and-web-server-databases-with-sync-framework&usg=ALkJrhjta8_7Nk656qhbtJ0Jo7ZTRNOmmARunning two threads at the same time - javaHow to use structures within a class correctly? - c ++Visual Studio 2008 works with only one web application, not a solution - visual-studio-2008SqlDataAdapter.Fill () Timeout - Sproc base returns quickly - sqlHttp Library in C # - httpgdb will not accept stdin redirection in Emacs - c ++How to change label orientation on TPageControl? - delphiHow to animate text over another view in Android? - androidAll Articles