title: Use Shrine to upload video files and generate thumbnails
body: <p>I want to use the Shrine gem to upload video files, transcode, &amp; generate thumbnails from the video.</p>
  
  <p>I am trying to convert Erik Dahlstrand's <a href="https://github.com/erikdahlstrand/shrine-rails-example" rel="nofollow noreferrer">Shrine-Rails-example</a> from photos to videos.  I am having trouble creating the video uploader.  I based this code on <a href="https://stackoverflow.com/questions/51074008/video-isnt-of-allowed-type-allowed-types-video-mp4-shrine-rails">Video isn&#39;t of allowed type (allowed types: video/mp4), Shrine, Rails</a></p>
  
  <pre><code>require "streamio-ffmpeg"
  
  class VideoUploader &lt; Shrine
    ALLOWED_TYPES = %w[video/mp4 video/quicktime video/x-msvideo video/mpeg]
    plugin :processing
    plugin :versions
  
    plugin :determine_mime_type
    plugin :cached_attachment_data
    plugin :remove_attachment
    plugin :add_metadata
    plugin :validation_helpers
    plugin :derivation_endpoint, prefix: "derivations/video"
  
    add_metadata do |io, context|
      movie = Shrine.with_file(io) { |file| FFMPEG::Movie.new(file.path) }
  
      { "duration"   =&gt; movie.duration,
        "bitrate"    =&gt; movie.bitrate,
        "resolution" =&gt; movie.resolution,
        "frame_rate" =&gt; movie.frame_rate }
    end
  
    movie.screenshot("video_thumb_007.jpg", seek_time: 5, resolution: '320x240')
  
    metadata_method :duration
  
    Attacher.validate do
      validate_max_size 100.megabyte, message: "is too large (max is 100 MB)"
      validate_mime_type_inclusion ALLOWED_TYPES
    end
  end
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>/var/folders/mm/_j8x4k2176jcv31zvbc497_c0000gp
      /T/shrine20190607-24438-4f3jz2.m4v: No such file or directory
  </code></pre>
  
  <p>and in fact, there is no file in that location.  So where is the file stored while waiting for upload??</p>
  
  <p>Also, using the demo to upload photos to AWS (production env), the objects are stored in the bucket in a folder called 'photos'.  Shrine uses the table name to name the folder apparently. Is possible to create alternative &amp; nested folder names?</p>
  
  <p>Thank you - seems like an amazing gem!  Trying to understand it better!</p>
  
  <p>Thx</p>