Answers.Body: <p>You may want to try to write the output of your task to a file and tell your system to start it as a background task by adding the &amp;:</p>
  
  <p><code>exec('aerender.exe -project myproject.aepx -comp "Final" -mp  -output video.mov &gt;/dev/null &amp;')</code></p>
  
  <p>It might also be something in your server setup, the max. memory maybe? </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-18T11:23:07.493Z
Answers.LastActivityDate: 2016-06-18T11:23:07.493Z
Answers.UserDisplayName: codeorelse
Body: <p>I am trying to render video from Adobe After Effects using PHP through command line. When i try to render video from After effects render Queue, i can see in Task Manager that all CPU cores are using. i have following PHP script which takes AE template file and render video.</p>
  
  <pre><code>&lt;?php
    exec('aerender.exe -project myproject.aepx -comp "Final" -mp  -output video.mov')
  
   // -mp - Additional processes may be created to render multiple frames simultaneously
  ?&gt;
  </code></pre>
  
  <p>When i execute this PHP file from command line like</p>
  
  <pre><code>php /path/to/above_script_file.php
  </code></pre>
  
  <p>its working fine too. All CPU cores are using and video is rendering.</p>
  
  <p><a href="https://i.sstatic.net/3J0wt.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3J0wt.jpg" alt="enter image description here"></a></p>
  
  <p><strong>BUT</strong> when i execute same script from browser using WAMP server, rendering starts, all instances get starts but suddenly close and 1 or sometimes 2 After effects instances are running but in hanged position. No memory or CPU is changing. </p>
  
  <p><a href="https://i.sstatic.net/xcCkX.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xcCkX.jpg" alt="enter image description here"></a></p>
  
  <p>These are my After Effects preferences</p>
  
  <p><a href="https://i.sstatic.net/APCiF.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/APCiF.jpg" alt="enter image description here"></a></p>
  
  <p><strong>UPDATE:</strong>
  When i am trying to render using below command
      aerender -project /path/ -comp Final -mp -output out.mov</p>
  
  <p>its working and using multiprocessing. but when trying to render from web app it show below error message in log file</p>
  
  <pre><code>There is an error in background rendering so switching to foreground rendering after 0 frames completed out of total 601 frames.
  </code></pre>
  
  <p>Message interpretation:<a href="https://myleniumerrors.com/tag/cs4/page/54/" rel="nofollow noreferrer">enter link description here</a></p>
  
  <pre><code>The multiprocessing feature was unable to use all instances beyond a     certain point in the rendering process. This is an error that only shows     in the render log file.
  </code></pre>
  
Tags: <after-effects><aerender>
Title: After Effects Multiple instances hangs when rendering using PHP and Command Line
UserDisplayName: Lal
ThreadText: # After Effects Multiple instances hangs when rendering using PHP and Command Line
  
  (Asked by: username_0 on 2016-06-17)
  
  I am trying to render video from Adobe After Effects using PHP through command line. When i try to render video from After effects render Queue, i can see in Task Manager that all CPU cores are using. i have following PHP script which takes AE template file and render video.
  
  ```
  <?php
    exec('aerender.exe -project myproject.aepx -comp "Final" -mp  -output video.mov')
  
   // -mp - Additional processes may be created to render multiple frames simultaneously
  ?>
  
  ```
  
  When i execute this PHP file from command line like
  
  ```
  php /path/to/above_script_file.php
  
  ```
  
  its working fine too. All CPU cores are using and video is rendering.
  
  [![enter image description here](https://i.sstatic.net/3J0wt.jpg)](https://i.sstatic.net/3J0wt.jpg)
  
  **BUT** when i execute same script from browser using WAMP server, rendering starts, all instances get starts but suddenly close and 1 or sometimes 2 After effects instances are running but in hanged position. No memory or CPU is changing.
  
  [![enter image description here](https://i.sstatic.net/xcCkX.jpg)](https://i.sstatic.net/xcCkX.jpg)
  
  These are my After Effects preferences
  
  [![enter image description here](https://i.sstatic.net/APCiF.jpg)](https://i.sstatic.net/APCiF.jpg)
  
  **UPDATE:**
  When i am trying to render using below command
  aerender -project /path/ -comp Final -mp -output out.mov
  
  its working and using multiprocessing. but when trying to render from web app it show below error message in log file
  
  ```
  There is an error in background rendering so switching to foreground rendering after 0 frames completed out of total 601 frames.
  
  ```
  
  Message interpretation:[enter link description here](https://myleniumerrors.com/tag/cs4/page/54/)
  
  ```
  The multiprocessing feature was unable to use all instances beyond a     certain point in the rendering process. This is an error that only shows     in the render log file.
  
  ```
  
  **Tags:** after-effects, aerender
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-06-18. Score: 2
  
  You may want to try to write the output of your task to a file and tell your system to start it as a background task by adding the &:
  
  `exec('aerender.exe -project myproject.aepx -comp "Final" -mp -output video.mov >/dev/null &')`
  
  It might also be something in your server setup, the max. memory maybe?
  
  
  ---
  
  