Note that there are some explanatory texts on larger screens.

plurals
  1. PORun ffmpeg using shell_exec from a file called by AJAX
    primarykey
    data
    text
    <p>Good morning,</p> <p>I will do my best to phrase a "thoughtful" and "helpful" question for all regarding running FFMPEG using shell_exec from a file called by AJAX. First I will start by listing my current code.</p> <p>AJAX script</p> <pre><code> &lt;script&gt; var xmlhttp; if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){ //Do something } } xmlhttp.open("GET","video_convert.php",true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(id=&lt;?php echo $video_upload_result; ?&gt;); &lt;/script&gt; </code></pre> <p>PHP Code</p> <pre><code>$destination = "files/videos/"; $ffmpeg = '/ffmpeg/ffmpeg'; $videoid = mysql_clean($_GET['id']); $sql = "SELECT file_name FROM cb_video WHERE videoid = '$videoid' "; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $file_old = glob('files/videos/'.$file_name.'.*'); shell_exec($ffmpeg." -i '/var/www/html/".$file_old[0]."' -ar 44100 /var/www/html/".$destination.$file_name.".flv"); </code></pre> <p>FFMPEG is installed and working properly as I have used it elsewhere on the site and have attempted a file conversion using PuTTY. I am able to run a PHP file called by AJAX as I have done it in a separate instance on this site. The only thing I can think of is that the shell_exec isn't running properly, which I have used elsewhere, since it is in a separate file called by ajax or else it is being closed pre-maturely. I have also tested this code in a main file and it works properly until I try to call the separate file with it in it.</p> <p>So, my question is can this code actually work and if so what steps should I take to get it working? </p> <p>Also I would greatly appreciate it if before closing my questions I had a chance to defend or rephrase them to properly suit this boards high standards for questions if I have somehow failed it in any way.</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload