Coder Social home page Coder Social logo

Comments (3)

owahab avatar owahab commented on September 27, 2024

It's possible using FFMPEG but no current support in Ruby AV gem.

from paperclip-av-transcoder.

jacobshiff avatar jacobshiff commented on September 27, 2024

I have been trying unsuccessfully to create an animated GIF from a video using FFMPEG settings. I have used the following settings so far. Any assistance would be much appreciated!

class CustomGif < ActiveRecord::Base

  has_attached_file :gif, styles: {
    original: {
      format: "gif",
      convert_options: {
        output: {
          t: "00:00:6.000"
        }
      }
    }
  }, :processors => [:transcoder]
  validates_attachment_content_type :gif, content_type: /\Avideo\/.*\Z/
end

When I run custom_gif = CustomGif.new(gif: params['video']), I receive the following output:

[AV] Running command: ffmpeg -ss 3 -i "/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-29940-1wvj48r.MOV" -f image2 -vframes 1 -t 00:00:6.000 -y "/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-29940-1wvj48r20160821-29940-1bfutyd.gif"
[paperclip] [transcoder] Successfully transcoded ac80cf3de4643bff7fec3a00dc9196d620160821-29940-1wvj48r to #<File:0x007f91da570468>
=> #<CustomGif:0x007f91da0e95c0
 id: nil,
 created_at: nil,
 updated_at: nil,
 gif_file_name: "capturedvideo.MOV",
 gif_content_type: "video/quicktime",
 gif_file_size: 15202,
 gif_updated_at: Sun, 21 Aug 2016 21:50:55 EDT -04:00>

And, when running custom_gif.save, I receive the following error:

Command :: file -b --mime '/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-29940-dxocga.MOV'
[paperclip] Content Type Spoof: Filename capturedvideo.MOV (video/quicktime from Headers, ["video/quicktime"] from Extension), content type discovered from file command: image/jpeg. See documentation to allow this combination.
   (2.2ms)  ROLLBACK
=> false

from paperclip-av-transcoder.

wnm avatar wnm commented on September 27, 2024

ruby-av/av#17

from paperclip-av-transcoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.