title: Compress the video using ffmpeg when upload using php form?
body: <p>I am using laravel famework and i am using ffmpeg PHP library. If have not found any good links  for video compression using ffmpeg. There are two cases of compression.</p>
  
  <pre><code>1) Video Already exists in folder - this i have done already 
  2) Video Upload through Form - this i am not able to do :(
  </code></pre>
  
  <p>Lets i am sharing 1st case code:-</p>
  
  <pre><code>Suppose my video is 13Mb and below code compressed to 4.5Mb (running fine)
  $inputVideo = public_path('input/airplane_flight_airport_panorama_1080.mp4');
  $outputVideo = public_path('uploads/output.mp4');
  exec("ffmpeg -i $inputVideo -b 1000000 $outputVideo"); // this compressing or resize the video
  </code></pre>
  
  <p>Now second case is uploading using form:-</p>
  
  <pre><code>&lt;form method="post" action="{{url('/api/upload-test-video')}}" enctype="multipart/form-data"&gt;
   &lt;input name="video" type="file"&gt;&lt;br&gt;
   &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Now when i go to function:-</p>
  
  <pre><code>public function uploadTestVideo(Request $request){
      echo "&lt;pre&gt;"; print_r($_FILES); 
      // now in this function i wnat to compress the video 
  }
  </code></pre>
  
  <p>Note:- I don't want to upload video in some folder and after that get the video and compress the video. Please help how can i resolve this problem. Thanks in advance :)</p>