title: imageJpeg and FFMPEG in windows vs linux
body: <p>I have a working code for converting image to a 5 seconds video using FFMPEG.</p>
  
  <p>The problem is, The code only works for downloaded images, FFMPEG doesn't convert image to video when image is generated programmatically ONLY IN LINUX.</p>
  
  <p><strong>PHP code</strong></p>
  
  <pre><code>&lt;?php
      $downloadedF="folder/d.jpg";
      $downloadedV="folder/d.mp4";
      $renderedF="folder/r.jpg";
      $renderedV="folder/r.mp4";
  
      $op_d=shell_exec("ffmpeg -r 1/5 -i ".$downloadedF." -c:v libx264 -vf fps=25 -pix_fmt yuv420p ".$downloadedV);
      $op_r=shell_exec("ffmpeg -r 1/5 -i ".$renderedF." -c:v libx264 -vf fps=25 -pix_fmt yuv420p ".$renderedV);
  
      echo "Errors:&lt;br&gt;".$op_d."&lt;br&gt;&lt;br&gt;".$op_r;
  ?&gt;
  </code></pre>
  
  <p>The d.mp4(or output for downloaded image) is getting generated for both Windows and Linux<br>
  The r.mp4(or output for rendered image) gets generated only in Windows and 48 bytes empty file is getting created in Linux</p>
  
  <p><strong>System:</strong></p>
  
  <p>XAMPP on Windows 10(Development)<br>Godaddy Starter plan hosting - Linux(Probably redhat)(Production)</p>
  
  <p><strong>File Structure</strong></p>
  
  <pre><code>root folder
      |-index.php
      |-ffmpeg (will be ffmpeg.exe in Windows)
      |-folder
          |-d.jpg (random downloaded image from google)
          |-d.mp4 (Will be created - video converted from downloaded image)
          |-r.jpg (rendered image using php imagejpg)
          |-r.mp4 (Will be created - video converted from rendered image)
  </code></pre>
  
  <p><strong>Rendered Image Code:</strong></p>
  
  <pre><code>$imgFF = imagecreatetruecolor($videoWidth, $videoHeight);
  //---adding many text using imagettftext();
  imagejpeg($imgFF, $path."-000.jpg");  //for this example, I copied output to folder as r.jpg
  </code></pre>
  
  <p><strong>Edit 1:</strong></p>
  
  <p>The return value of <code>shell_exec</code> has no error/output even after adding </p>
  
  <pre><code>error_reporting(E_ALL);
  ini_set('display_errors', 1);
  </code></pre>
  
  <p><strong>Edit 2:</strong></p>
  
  <p>The log for successful conversion can be found at <a href="https://pastebin.com/dSFe4wNm" rel="nofollow noreferrer">Here</a><br>
  The log for unsuccessful conversion of rendered image can be found at <a href="https://pastebin.com/PfgfkF8E" rel="nofollow noreferrer">Here</a></p>
  
  <p><strong>Note:</strong></p>
  
  <p>&bull; The scenario here is minimized and code is separated from long code.<br>
  &bull; In Linux command i add <code>./</code> for FFMPEG</p>