logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

video_transcoder.rb (442B)


  1. # frozen_string_literal: true
  2. module Paperclip
  3. # This transcoder is only to be used for the MediaAttachment model
  4. # to check when uploaded videos are actually gifv's
  5. class VideoTranscoder < Paperclip::Processor
  6. def make
  7. meta = ::Av.cli.identify(@file.path)
  8. attachment.instance.type = MediaAttachment.types[:gifv] unless meta[:audio_encode]
  9. Paperclip::Transcoder.make(file, options, attachment)
  10. end
  11. end
  12. end