Comments (3)
It's possible using FFMPEG but no current support in Ruby AV gem.
from paperclip-av-transcoder.
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.
from paperclip-av-transcoder.
Related Issues (20)
- Getting just a black image HOT 1
- please delete
- Generated thumbnail files empty when using the "#" padding option
- Error on player when I upload
- Accessing file metadata using '<attachment>_meta' HOT 3
- using this gem on Windows is not working Av::CommandError HOT 2
- video conversion
- thumbnail geometry ignores "!#<>" HOT 3
- CPU limit ffmpeg HOT 1
- Can't transcode flv-x files HOT 1
- -ss and 'Unable to find a suitable output format for '00:00:00'
- FFMPEG hangs/stalls when converting large files HOT 4
- convert_options causes NoMethodError when only :input is defined
- Thumbnail bad quality HOT 2
- Thumbs depending on the video duration HOT 3
- URL issue: paperclip-av-transcoder HOT 1
- Too many packets buffered for output stream 0:1.
- Delayed job or job queue HOT 2
- auto rotate not working
- Riails 6 and https://github.com/kreeti/kt-paperclip HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paperclip-av-transcoder.