title: Issue with overwriting file while using ffmpeg for converting
body: <p>I'm using ffpmeg to convert all my videos to mp4:</p>
  
  <pre><code> ffmpeg -i InpuFile -vcodec h264 -acodec aac -strict -2 OutputFile.mp4
  </code></pre>
  
  <p>The problem is, if I'm overwriting the input file, i.e the output and input files are the same:</p>
  
  <pre><code> ffmpeg -i InpuFile -vcodec h264 -acodec aac -strict -2 InpuFile.mp4 -y
  </code></pre>
  
  <p>or </p>
  
  <pre><code> ffmpeg -i InpuFile -y -vcodec h264 -acodec aac -strict -2 InpuFile.mp4
  </code></pre>
  
  <p>the new file is not good. He lasts one second and his size is extremely small.</p>
  
  <p>Any ideas?</p>
  
  <p>I want to use this as a script in my server so the overwriting is the most convinient way for me, I prefer that way instead of creating temporary files then replacting the temporary with original.</p>