title: Rails / ActiveStorage File Processing – only on-the-fly or also on upload? If so, why?
body: <p>I'm planning a RoR project that involves the upload and compression of videos. Normally I'd go with Shrine for handling file attachments and handle video compression with <em>ffmpeg</em> in a background job after the upload.</p>
  
  <p>Now that <code>ActiveStorage</code> is built-in Rails 5.2, I'd like to opt for that, but I'm not sure if it could handle video (w/ compression) well. So far, I only found documentation on processing images (with MiniMagick) or creating video-/pdf-previews (with ffmpeg or mutools) which all seem to happen on-the-fly.</p>
  
  <p>As the compression of videos is time-intense I'd say that it should happen directly after the upload to be ready for requests. <strong>Is there on option the process files after upload, using ActiveStorage, or only on-the-fly</strong>?</p>
  
  <p>If not, why or rather is it recommended to handle all file processing <strong>on-the-fly</strong>?</p>
  
  <p>Thanks</p>