title: Compress video like whatsapp
body: <p>I'm not an expert in Video Editing but what I want to understand the logic of Whatsapp video processing.</p>
  
  <p><strong>First</strong> of all I have noticed that whatever the file is, Whatsapp sets the limit of Uploaded videos to 16MB, after which whatsapp crops the video to not exceed the limit. is this a convention or it's a personal choice ?</p>
  
  <p><strong>Secondly</strong>, When a video is recorded using the Camera it's not compressed by default, so whatsapp compresses it using <code>FFMPEG</code> I guess, and it takes no time. (tried for a video of 1min 1920x1080 with 125MB of size, becomes 640x360 with 5MB of size in no time, and the upload starts automatically).. how may they do this ? and why the choice of <strong>640x360</strong>, It seems to me very fast for 2 asynchronous tasks : Compression + Upload.</p>
  
  <p>When I run the compression command <code>ffmpeg -y -i in.mp4 -codec:v libx264 -crf 23 -preset medium -codec:a libfdk_aac -vbr 4 -vf scale=-1:640,format=yuv420p out.mp4</code> it takes approximatively 1 min and the video is being rotated !! :D</p>
  
  <p><strong>Finally</strong>, when we download a video from Youtube it's already compressed (I guess) and whatsapp doesn't even try to compress it. So I think that it automatically detects thats the video is compressed. How can we detect this ?</p>
  
  <p>Thank you.</p>