ruby-av / paperclip-av-transcoder Goto Github PK
View Code? Open in Web Editor NEWAudio/Video Transcoder for Paperclip using FFMPEG/Avconv
License: MIT License
Audio/Video Transcoder for Paperclip using FFMPEG/Avconv
License: MIT License
My ImageMagick
is install in /usr/bin
via yum
and my ffmpeg installed via script is in /user/local/bin' but Paperclip uses the same
command_path` for both. is there a way we can fix this without moving the installations around.
Thanks
If I have it set up to transcode whatever is uploaded to mp4 and the file uploaded is mp4, paperclip redundantly transcodes it wasting a lot of server resources.
content type discovered from file command: video/x-flv. See documentation to allow this combination.
There seems to be no docs that I can find.
has_attached_file :video, path: ":rails_root/private/videos/:video_user_name/:video_library_name/:filename", url: "private/videos/:video_user_name/:video_library_name/:filename", styles: {jv_mp4: {format: 'mp4', streaming: true}, jv_webm: {format: 'webm'}, thumb: {geometry: '640x360#', format: 'png', time: 5}}, processors: [:transcoder, :qtfaststart]
validates_attachment :video, presence: true, content_type: {content_type: %w(video/mpeg video/mp4 video/3gpp video/flv video/x-flv video/webm)}, size: {in: 0..90.megabytes}
It has no issues with mp4, webm, and 3gpp, other than this gem is not smart enough to know if the uploaded file is either mp4 or webm and will transcode a mp4 to a mp4 for example. But it chokes on flv.
Firstly, thanks for creating this gem!
I just wanted to record an issue I ran into, and based on searches, a few others may have encountered. If I can find the time I will take a stab at finding a fix other than the workaround mentioned below.
The documentation examples I saw show:
thumb: { geometry: "100x100#", :format => 'jpg' }
Which should create a 100 by 100 thumbnail with padding. However, I found that a thumbnail would only be successfully created by removing the #
. I hope this helps someone else!
Hi, this is exactly what I'm looking for, convert huge video files to smaller ones.
But I found it transcode files on form submit, it's there any delayed job or job queue to do this? that will make the web page more quickly, thanks.
Hello, i'm following every step, my images upload correctly, but video is not even trying to upload, not even a public folder is generated. Am i doing something wrong? I have ffmpeg installed and paperclip alone is clearly working.
I'd love to know if someone is getting it to work as i can't find any tutorial or answered question on the internets. Thanks 😃
appears to generate fine with paperclip-ffmpeg but issue with paperclip-av-transcoder
Is there a way to limit the CPU usage when this gem starts up ffmpeg?
Just using the examples, ffmpeg will use 99% of the CPU making the rest of the app totally unresponsive.
Due to paperclip depreciation, I am suing kt-paperclip now, I am also using [paperclip-av-transcoder] for video processing, Due to this I am not able to fully migrate to kt-paperclip as a dependency paperclip installed, my code is using old paperclip gem. Do you have any plane to support kt-paperclip
Please suggest to me the solution for video processing.
http://runnable.com/VR3jBtJKSwh21EKs/paperclip-av-transcoder
Started POST "/default/topics" for ::ffff at 2015-04-05 14:05:33 +0000
Processing by Forem::TopicsController#create as HTML
Parameters: {"utf8"=>"�~\~S", "authenticity_token"=>"+6Ma4fmBeexCEFsP9z8b5Af5vJQKarMssAxFdIHMHGEkRcP09T/zgmlVAM4Trb2iHWkHVFGFrHBqO3E8GGAzJw==", "topic
"=>{"subject"=>"sfgfgsfg", "posts_attributes"=>{"0"=>{"text"=>"sfhsg", "photos_attributes"=>{"0"=>{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x
00000004502798 @tempfile=#<File:/tmp/RackMultipart20150405-50-183sbay.gif>, @original_filename="test.gif", @content_type="image/gif", @headers="Content-
Disposition: form-data; name=\"topic[posts_attributes][0][photos_attributes][0][attachment]\"; filename=\"test.gif\"\r\nContent-Type: image/gif\r\n">}}}
}}, "commit"=>"Create Topic", "forum_id"=>"default"}
^[[1m^[[35mUser Load (0.3ms)^[[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
^[[1m^[[36mForem::Forum Load (0.2ms)^[[0m ^[[1mSELECT "forem_forums".* FROM "forem_forums" WHERE "forem_forums"."slug" = ? ORDER BY "forem_forums".
"position" ASC LIMIT 1^[[0m [["slug", "default"]]
^[[1m^[[35mForem::Category Load (0.1ms)^[[0m SELECT "forem_categories".* FROM "forem_categories" WHERE "forem_categories"."id" = ? LIMIT 1 [["id",
1]]
Command :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-oihgom.gif'
[AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
[AV] Running command: if command -v ffmpeg 2>/dev/null; then echo "true"; else echo "false"; fi
[AV] Found ["avconv", "ffmpeg"], using: Avconv
[AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
[AV] Running command: if command -v ffmpeg 2>/dev/null; then echo "true"; else echo "false"; fi
[AV] Found ["avconv", "ffmpeg"], using: Avconv
[AV] Running command: avconv -i "/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif" 2>&1
[paperclip] [transcoder] Transocding supported file /tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif
[AV] Adding output parameter ["acodec", "aac"]
[AV] Adding output parameter ["strict", "experimental"]
[AV] Running command: avconv -loglevel quiet -i "/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif" -acodec aac -strict experimental -y "/tmp
/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-nyp8zp.mp4"
[paperclip] [transcoder] Successfully transcoded 098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid to #<File:0x000000046bf298>
[paperclip] [qtfaststart] :source :dest
Command :: qtfaststart '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-nyp8zp.mp4' '/tmp/098f6bcd4621d373cade4e832627b4f620150405-5
0-1lz9oid20150405-50-nyp8zp20150405-50-1cczssi.mp4'
Command :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-nyp8zp20150405-50-1cczssi.mp4'
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif[0]' 2>/dev/null
Command :: identify -format %m '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif[0]'
Command :: convert '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif' -coalesce -auto-orient -resize "x70" -crop "70x70+27+0" +repage -layer
s "optimize" '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-19tfyp0'
Command :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-19tfyp0'
^[[1m^[[36m (0.2ms)^[[0m ^[[1mbegin transaction^[[0m
^[[1m^[[35mForem::Topic Exists (0.4ms)^[[0m SELECT 1 AS one FROM "forem_topics" WHERE ("forem_topics"."id" IS NOT NULL) AND "forem_topics"."slug" =
? LIMIT 1 [["slug", "sfgfgsfg"]]
Command :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1kui4uq.gif'
^[[1m^[[36mSQL (0.7ms)^[[0m ^[[1mINSERT INTO "forem_topics" ("subject", "forum_id", "user_id", "slug", "created_at", "updated_at") VALUES (?, ?, ?, ?
, ?, ?)^[[0m [["subject", "sfgfgsfg"], ["forum_id", 1], ["user_id", 1], ["slug", "sfgfgsfg"], ["created_at", "2015-04-05 14:05:38.824979"], ["updated_a
t", "2015-04-05 14:05:38.824979"]]
^[[1m^[[35mSQL (0.2ms)^[[0m INSERT INTO "forem_posts" ("text", "user_id", "topic_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["text", "
sfhsg"], ["user_id", 1], ["topic_id", 9], ["created_at", "2015-04-05 14:05:38.828987"], ["updated_at", "2015-04-05 14:05:38.828987"]]
^[[1m^[[36mForem::Topic Load (0.2ms)^[[0m ^[[1mSELECT "forem_topics".* FROM "forem_topics" WHERE "forem_topics"."id" = ? LIMIT 1^[[0m [["id", 9]]
^[[1m^[[35mSQL (281.1ms)^[[0m UPDATE "forem_topics" SET "last_post_at" = '2015-04-05 14:05:38.828987' WHERE "forem_topics"."id" = ? [["id", 9]]
^[[1m^[[36mForem::Subscription Load (0.4ms)^[[0m ^[[1mSELECT "forem_subscriptions".* FROM "forem_subscriptions" WHERE "forem_subscriptions"."topic_i
d" = ? ORDER BY "forem_subscriptions"."id" ASC LIMIT 1000^[[0m [["topic_id", 9]]
http://runnable.com/VSFEpaY88OsqHGa0/paperclip-reverted-to-ffmpeg
Started POST "/default/topics" for ::ffff at 2015-04-05 14:16:37 +0000
Processing by Forem::TopicsController#create as HTML
Parameters: {"utf8"=>"�~\~S", "authenticity_token"=>"ZLQT2hWb+VtRpso+IWo/iAv2bf6x2Fcgp/bV9F8bwQdouiumXUXMNbtJrrdpkGkW1AMByf8R1bxiZVLA7BiUOQ==", "topic
"=>{"subject"=>"shfhfhf", "posts_attributes"=>{"0"=>{"text"=>"asdasdasd", "photos_attributes"=>{"0"=>{"attachment"=>#<ActionDispatch::Http::UploadedFile
:0x00000005ba0a40 @tempfile=#<File:/tmp/RackMultipart20150405-60-1au05n3.gif>, @original_filename="test.gif", @content_type="image/gif", @headers="Conte
nt-Disposition: form-data; name=\"topic[posts_attributes][0][photos_attributes][0][attachment]\"; filename=\"test.gif\"\r\nContent-Type: image/gif\r\n">
}}}}}, "commit"=>"Create Topic", "forum_id"=>"default"}
^[[1m^[[35mUser Load (0.3ms)^[[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
^[[1m^[[36mForem::Forum Load (0.2ms)^[[0m ^[[1mSELECT "forem_forums".* FROM "forem_forums" WHERE "forem_forums"."slug" = ? ORDER BY "forem_forums".
"position" ASC LIMIT 1^[[0m [["slug", "default"]]
^[[1m^[[35mForem::Category Load (0.2ms)^[[0m SELECT "forem_categories".* FROM "forem_categories" WHERE "forem_categories"."id" = ? LIMIT 1 [["id",
1]]
Command :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-1d84keo.gif'
[paperclip] [ffmpeg] ffprobe "/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif" 2>&1
[paperclip] [ffmpeg] Command Success
[paperclip] [ffmpeg] Making...
[paperclip] [ffmpeg] Building Destination File: '098f6bcd4621d373cade4e832627b4f620150405-60-akyw04' + 'mp4'
[paperclip] [ffmpeg] Destination File Built
[paperclip] [ffmpeg] Adding Geometry
[paperclip] [ffmpeg] Adding Format
[paperclip] [ffmpeg] Adding Source
[paperclip] [ffmpeg] Building Parameters
[paperclip] [ffmpeg] -i :source -acodec aac -strict experimental -y :dest
Command :: ffmpeg -i '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif' -acodec aac -strict experimental -y '/tmp/098f6bcd4621d373cade4e83262
7b4f620150405-60-akyw0420150405-60-nx0j61.mp4'
[paperclip] [qtfaststart] :source :dest
Command :: qt-faststart '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw0420150405-60-nx0j61.mp4' '/tmp/098f6bcd4621d373cade4e832627b4f620150405-6
0-akyw0420150405-60-nx0j6120150405-60-jbc80d.mp4'
Command :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw0420150405-60-nx0j6120150405-60-jbc80d.mp4'
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif[0]' 2>/dev/null
Command :: identify -format %m '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif[0]'
Command :: convert '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif' -coalesce -auto-orient -resize "x70" -crop "70x70+27+0" +repage -layers
"optimize" '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw0420150405-60-1benqrt'
Command :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw0420150405-60-1benqrt'
^[[1m^[[36m (0.2ms)^[[0m ^[[1mbegin transaction^[[0m
^[[1m^[[35mForem::Topic Exists (0.5ms)^[[0m SELECT 1 AS one FROM "forem_topics" WHERE ("forem_topics"."id" IS NOT NULL) AND "forem_topics"."slug" =
? LIMIT 1 [["slug", "shfhfhf"]]
Command :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-kdq57l.gif'
^[[1m^[[36mSQL (1.0ms)^[[0m ^[[1mINSERT INTO "forem_topics" ("subject", "forum_id", "user_id", "slug", "created_at", "updated_at") VALUES (?, ?, ?, ?
, ?, ?)^[[0m [["subject", "shfhfhf"], ["forum_id", 1], ["user_id", 1], ["slug", "shfhfhf"], ["created_at", "2015-04-05 14:16:42.081114"], ["updated_at"
, "2015-04-05 14:16:42.081114"]]
^[[1m^[[35mSQL (0.4ms)^[[0m INSERT INTO "forem_posts" ("text", "user_id", "topic_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["text", "
asdasdasd"], ["user_id", 1], ["topic_id", 9], ["created_at", "2015-04-05 14:16:42.085832"], ["updated_at", "2015-04-05 14:16:42.085832"]]
^[[1m^[[36mForem::Topic Load (0.1ms)^[[0m ^[[1mSELECT "forem_topics".* FROM "forem_topics" WHERE "forem_topics"."id" = ? LIMIT 1^[[0m [["id", 9]]
^[[1m^[[35mSQL (49.7ms)^[[0m UPDATE "forem_topics" SET "last_post_at" = '2015-04-05 14:16:42.085832' WHERE "forem_topics"."id" = ? [["id", 9]]
^[[1m^[[36mForem::Subscription Load (0.2ms)^[[0m ^[[1mSELECT "forem_subscriptions".* FROM "forem_subscriptions" WHERE "forem_subscriptions"."topic_i
d" = ? ORDER BY "forem_subscriptions"."id" ASC LIMIT 1000^[[0m [["topic_id", 9]]
In: lib/paperclip/paperclip_processors/transcoder.rb
Around line 117:
def set_convert_options options
return options[:convert_options] if options[:convert_options].present?
options[:convert_options] = {output: {}}
return options[:convert_options]
end
This fails to add :output to the convert_options when I only have :input defined, so I get this error:
NoMethodError (undefined method `[]=' for nil:NilClass):
paperclip-av-transcoder (0.6.4) lib/paperclip/paperclip_processors/transcoder.rb:37:in `initialize'
referencing:
@convert_options[:output][:s] = format_geometry(@geometry) if @geometry.present?
A workaround for now is to just have a blank :output=>{} in my paperclip attachment definition, but the logic of assinging a default to the convert_options is erroneous.
[AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
[AV] Running command: if command -v ffmpeg 2>/dev/null; then echo "true"; else echo "false"; fi
(0.2ms) ROLLBACK
Unable to detect any supported library
Redirected to http://localhost:3000/ssdd/edit
Completed 302 Found in 771ms (ActiveRecord: 0.6ms)
i have compile ffmpeg with this source https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
Is there a way to use qtfaststart with this library like paperclip-ffmpeg allowed?
I am trying to capture when the video transcoding has finished so I can notify the user about success or not, and to mark the transcoded video as ready to show on my site.
I have tried the capturing the "after__post_process" event but that is firing before the transcoding has finished.
Not sure if that is a bug or if I have to find another way to capture completion of the transcoding?
Cheers, James
How to convert video with with vframe 1200-1 wtih this gem.
Hi, this is my first issue posting on github, so please if I'm not doing something right, please tell me :)
OK, so we have one project that is working on Linux version of server on AWS, and I use Windows as a OS. When I want to create new attachment using this gem, I get following error:
**Av::CommandError in Api::V1::DigitalProductsController#create
error while running command if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi: Command 'if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi' returned 1. Expected 0 Here is the command output: STDOUT:
STDERR:
-v was unexpected at this time.**
_I'm reporting this as an issue, as gem is working fine on Linux, but on Windows it is not good. _
I have tried to do everything that others users reported similar problems, but without any success. Also, on stack or Google, there is no search result with my issue, like nobody has this problem :(
Please can you see if there is an issue for real, or there are some things that are too obvious that I have missed. I'm sending some screens just in order to have full picture.
Greetings,
I'm trying to find a way to generate multiple thumbnails from uploaded video. After lot of searching i've found a way but it's pure ffmpeg command.
ffmpeg -ss number_of_thumb * (total_video/number_of_thumb) -i video_file -vframes 1 -s 320x240 thumb_%03d.jpg
This is the url where i find this code: Debuggable
please somebody help me to generate this command to paperclip way or tell me how can i generate multiple thumbnails using paperclip-av-transcoder!
Thank you in advance.
Regards,
Arif
I am using auto_rotate option to 180 but paperclip av transcoder ignores this option
I need to be able to upload videos of any size up to a maximum of 1080 pixels in either direction and create an equivalent thumbnail image.
However the options !, #, >, and < are ignored
full_thumb: { geometry: '1080x1080>', format: 'jpg', time: 1 }
produces the following log
[AV] Adding output parameter ["f", "image2"]
[AV] Adding output parameter ["vframes", "1"]
[AV] Adding input parameter [:ss, 1]
[AV] Adding output parameter [:s, "1080x1080"]
and the output image is always 1080x1080 regardless of input dimensions (in test case 640x360)
I'm not sure if this is a feature request or it belongs to SO :) Is it possible to create an animated GIF from videos?
Is qtfaststart or something equivalent being run on mp4 files because they don't play until completely downloaded. webm files don't have this issue.
Could you add the code for adding the video to a view in the README?
I am getting following error while saving the video
error while running command ffmpeg -i "/tmp/ed48c144522ed8beaba94863c34b0f9d20150423-3314-3r52bx.mp4" -s 640x480 -y "/tmp/ed48c144522ed8beaba94863c34b0f9d20150423-3314-3r52bx20150423-3314-1ok2yh8.flv": Command 'ffmpeg -i "/tmp/ed48c144522ed8beaba94863c34b0f9d20150423-3314-3r52bx.mp4" -s 640x480 -y "/tmp/ed48c144522ed8beaba94863c34b0f9d20150423-3314-3r52bx20150423-3314-1ok2yh8.flv"' returned 1. Expected 0
Error is in this line while updating: if @worker.update(worker_params)
Following is my code:
Gemfile
gem 'paperclip-av-transcoder'
worker.rb
has_attached_file :video, :styles => {:medium => { :geometry => "640x480", :format => 'flv' },:thumb => { :geometry => "100x100#", :format => 'jpg', :time => 10 }
}, :processors => [:transcoder]
workers_controller.rb
def update
respond_to do |format|
if @worker.update(worker_params)
format.html { redirect_to @worker, notice: 'Worker was successfully updated.' }
format.json { render :show, status: :ok, location: @worker }
else
format.html { render :edit }
format.json { render json: @worker.errors, status: :unprocessable_entity }
end
end
end
def worker_params
params.require(:worker).permit(:video, :user_id, :profile_photo, :worker_spoken_languages_attributes => [:id, :worker_id, :spoken_language, :_destroy])
end
show.haml
%p
%strong Video:
= video_tag @worker.video.url
%p
Please tell if I am missing anything
Hi there,
I have the following in my paperclip definition:
has_attached_file :video,
:default_url => '/filetype-icons/filetype-unknown.png',
:styles => {
:thumb => { :geometry => "32x32>", :format => 'png', :time => 10 }
},
:path => ":rails_root/public/apartment_files/:attachment/:id_partition/:style/:filename",
:url => "/apartment_files/:attachment/:id_partition/:style/:filename",
:processors => [:transcoder]
However, when transocding, the thumb does not transcode to 32x32. Instead it goes to 1920x1080. What could I be doing wrong?
Hi,
Is it possible to disable output message to console from ffmpeg in test environment?
I hope it can work just like rails logger, write to log file only when running tests.
Thanks and best regards
I am converting videos to the MP4 format but struck an issue today when attempting to play those converted videos on Android.
The documentation says that "MPEG-4 containers, the moov atom must precede any mdat atoms, but must succeed the ftyp atom."
Is there a setting or the like I should be passing to the transcoder that will achieve the above?
Hi, as said in the title, i would like to add thumbs, depending on the video duration.
It it possible to define time using percentage? Or to use a variable duration? I know that the duration can be found in the _meta, but is it possible to retrieve it before the saving ?
Here is my code :
validates :title,
length: { in: 2..60 }
validates :description,
length: { minimum: 2 }
has_attached_file :content, styles: {
:medium => {
:format => 'mp4',
#convert_options: {
#output: {
#name: 'value' # Results in `-name value` in the command line
#}
#}
},
:thumb0 => { :geometry => '320x180#', :format => 'jpeg', :time => 1.0 * duration / 6.0 },
:thumb1 => { :geometry => '320x180#', :format => 'jpeg', :time => 2.0 * duration / 6.0},
:thumb2 => { :geometry => '320x180#', :format => 'jpeg', :time => 3.0 * duration / 6.0},
:thumb3 => { :geometry => '320x180#', :format => 'jpeg', :time => 4.0 * duration / 6.0},
:thumb4 => { :geometry => '320x180#', :format => 'jpeg', :time => 5.0 * duration / 6.0},
}, :processors => [:transcoder]
validates_attachment :content, presence: true,
content_type: { content_type: /\Avideo\/.*\Z/ },
size: { :less_than => 2.gigabytes }
Thx in advance for your reply !
(After thinking about it i should have posted on StackOverflow instead... sorry about that)
I'm receiving this error when attempting to process a video. It appears that the command is missing the "vframes 1" option? When I run the ffmpeg command manually, it does work fine when I add "vframes 1". I'm using the master branch straight from github.
[image2 @ 0x7feda1824a00] Could not get frame filename number 2 from pattern '/var/folders/ys/wn_46zvs6jbgjvgnn45snf9m0000gn/T/dc5c7986daef50c1e02ab09b442ee34f20141018-34360-1kbemf620141018-34360-1615t53.jpg' (either set updatefirst or use a pattern like %03d within the filename pattern)
av_interleaved_write_frame(): Invalid argument
frame= 2 fps=0.0 q=3.6 Lsize=N/A time=00:00:00.06 bitrate=N/A
video:204kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
Av::CommandError: error while running command ffmpeg -i "/var/folders/ys/wn_46zvs6jbgjvgnn45snf9m0000gn/T/dc5c7986daef50c1e02ab09b442ee34f20141018-34360-1kbemf6.MOV" -y "/var/folders/ys/wn_46zvs6jbgjvgnn45snf9m0000gn/T/dc5c7986daef50c1e02ab09b442ee34f20141018-34360-1kbemf620141018-34360-1615t53.jpg": Command 'ffmpeg -i "/var/folders/ys/wn_46zvs6jbgjvgnn45snf9m0000gn/T/dc5c7986daef50c1e02ab09b442ee34f20141018-34360-1kbemf6.MOV" -y "/var/folders/ys/wn_46zvs6jbgjvgnn45snf9m0000gn/T/dc5c7986daef50c1e02ab09b442ee34f20141018-34360-1kbemf620141018-34360-1615t53.jpg"' returned 1. Expected 0
When uploading a large video, the page times out.
You may optionally add `<attachment>_meta` to your model and it will get populated with information about the processed video.
What does this mean? Where and how does this need to be added to the model in order to work? There is a lack of context in the documentation on this subject. The way this is written looks like it has something to do with view markup, which seems contradictory to the instructions. I've looked at the source code and searched for any examples utilizing this feature, but can't make heads or tails of it. Can anyone provide additional detail on how to access file metadata using this gem? I really would like to be able to access an mp4 file's duration metadata.
If anyone can answer this question I would be more than happy to update the README to help others using this gem.
Edit: As a workaround I found an ffmpeg command that will grab the video duration from the metadata after it has been uploaded and saved. I set up an after_save callback on my video model that uses this to save the duration to the db.
duration = ffprobe -i #{file_path} -show_entries format=duration -v quiet -of csv="p=0"
I got this error while converting a video. It's an odd ffmpeg error that was introduced in 3.3+.
To resolve it, you just have to supply an output convert option like so:
mp4: {
format: 'mp4',
convert_options: {
output: {
max_muxing_queue_size: 1000 # Default is 128 but increasing this prevents the error.
}
}
}
For more information, see these posts:
https://trac.ffmpeg.org/ticket/6375
https://trac.ffmpeg.org/ticket/6472
This works well in 0.6.2, but in 0.6.4 it seems that for
:image => { :geometry => "320x!", :format => 'jpg', :time => Video.screenshot_time(attachment.instance) }
the command generated by gem is
avconv -ss 12 -i "/tmp/421b47ffd946ca083b65cd668c6b17e6150903-15269-1806hcy-.mp4" -f image2 -vframes 1 -s 320x -y "/tmp/421b47ffd946ca083b65cd668c6b17e6150903-15269-1806hcy-150903-15269-1jh1vbd-.jpg"
which generates an empty file.
The video uploaded does not maintain aspect ratio. In the readme it says, " '!' - Keep the same aspect of the image/video, but with the passed dimesion."
My goal is to be able to be able to have the video returned in a square (while maintaining the aspect ratio). Cropping from the center would be ideal, as well.
Any help would be greatly appreciated. I included my code below.
Here is a link to a skewed 500x500! video of my puppy:
http://s3.amazonaws.com/pivotdevelopment/posts/videos/102/square.mp4?1440617576
Here is the non-skewed version for comparison:
http://s3.amazonaws.com/pivotdevelopment/posts/videos/103/square.mp4?1440617933
class Video < Post
Paperclip.interpolates :id do |attachment, style|
attachment.instance.id
end
#basename/extension is paperclip interpolation from attachment, can write own interpolations as needed
# have to link /usr/local/bin to the linuxbrew version of ffmpeg
has_attached_file :video, path: "/posts/videos/:id/:style.:extension",
:styles => {
:square => {:geometry => "500x500!", :format => 'mp4', :streaming => true }
},
:processors => [:transcoder]
validates_attachment :video, :presence => true,
:content_type => { content_type: ["video/mp4", "video/mov", "video/mpeg","video/mpeg4", "video/quicktime"] }
def video_url
video = self.video
if video.present?
return video.url(:square)
end
end
end
Im still having this issue although it was fixed with this release.
Av::CommandError (error while running command if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi: Command 'PATH=/usr/bin/:$PATH if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi' returned 1. Expected 0
DEBUG [6a1eae9e] Here is the command output:
DEBUG [6a1eae9e]
DEBUG [6a1eae9e] ):
DEBUG [6a1eae9e] app/controllers/blog_posts_controller.rb:37:in `create'
please delete
It seems that the -ss position for input defaults to 3 seconds. I would like to set it to 0, but when I set it to 0 I receive the following error: Unable to find a suitable output format for '00:00:00'.
class CustomGif < ActiveRecord::Base
has_attached_file :gif, styles: {
original: {
format: "gif",
convert_options: {
input: {
ss: '00:00:00' #I also tried just '0'
},
output: {
t: "00:00:6.000"
}
}
}
}, :processors => [:transcoder]
validates_attachment_content_type :gif, content_type: /\Avideo\/.*\Z/
end
When I enter 'custom_gif = CustomGif.new(gif: params['video'])' I receive the following output:
Command :: file -b --mime '/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-7r8ssc.MOV'
[AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
[AV] Running command: if command -v ffmpeg 2>/dev/null; then echo "true"; else echo "false"; fi
[AV] Found ["ffmpeg"], using: Ffmpeg
[AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
[AV] Running command: if command -v ffmpeg 2>/dev/null; then echo "true"; else echo "false"; fi
[AV] Found ["ffmpeg"], using: Ffmpeg
[AV] Running command: ffmpeg -i "/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-o48pji.MOV" 2>&1
[paperclip] [transcoder] Transocding supported file /var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-o48pji.MOV
[AV] Adding output parameter ["f", "image2"]
[AV] Adding output parameter ["vframes", "1"]
[AV] Adding input parameter [:ss, 3]
[AV] Adding input parameter [:ss, 0]
[AV] Adding output parameter [:t, "00:00:6.000"]
[AV] Running command: ffmpeg -ss 3 0 -i "/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-o48pji.MOV" -f image2 -vframes 1 -t 00:00:6.000 -y "/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-o48pji20160821-33753-n7xnk3.gif"
Av::CommandError: error while running command ffmpeg -ss 3 0 -i "/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-o48pji.MOV" -f image2 -vframes 1 -t 00:00:6.000 -y "/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-o48pji20160821-33753-n7xnk3.gif": Command 'ffmpeg -ss 3 0 -i "/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-o48pji.MOV" -f image2 -vframes 1 -t 00:00:6.000 -y "/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-o48pji20160821-33753-n7xnk3.gif"' returned 1. Expected 0
Here is the command output: STDOUT:
STDERR:
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 47.100 / 6. 47.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/folders/7g/9142rygs6bngwl84c7bh4d6c0000gn/T/ac80cf3de4643bff7fec3a00dc9196d620160821-33753-o48pji.MOV':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2016-08-22 02:11:36
com.apple.quicktime.make: Apple
com.apple.quicktime.software: 9.3.3
com.apple.quicktime.model: iPhone 6s
com.apple.quicktime.creationdate: 2016-08-21T22:11:36-0400
Duration: 00:00:02.42, start: 0.000000, bitrate: 866 kb/s
Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt709/bt709), 480x360, 763 kb/s, 24 fps, 24 tbr, 600 tbn, 1200 tbc (default)
Metadata:
rotate : 90
creation_time : 2016-08-22 02:11:36
handler_name : Core Media Data Handler
encoder : H.264
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 84 kb/s (default)
Metadata:
creation_time : 2016-08-22 02:11:36
handler_name : Core Media Data Handler
[NULL @ 0x7fcaf280c800] Unable to find a suitable output format for '0'
0: Invalid argument
Hey @owahab thanks for creating this gem.
I'm running into issues generating the thumbnail according to your example. I was wondering if you could give a little bit more details in the README on how to get it to work properly, including setups and such?
I thought I had to make sure my ffmpeg install had --with-openjpeg flagged, so I reinstalled it with that.
I also debugged through the commands and ffmpeg asked for me to add %03d to the jpg name. So my code is now
has_attached_file :video_content, :styles => {
:medium => { :geometry => "640x480", :format => 'mp4' },
:thumb => { :geometry => "320x240", :format => '%03d.jpg', :time => 10 }
},
:processors => [:transcoder],
:s3_protocol => :https
Which now it it generates an empty jpg.
Any thoughts on how I'm supposed to be installing, setting up the configs, etc to make it generate a thumbnail correctly?
I'm trying to upload an MP4 (see file below) but get the log error "Audio codec mp3 not compatible with flv".
http://techslides.com/demos/sample-videos/small.mp4
Hi! I use your gem with the following settings:
has_attached_file :video, styles: {
medium: { geometry: "640x480", format: 'mp4' },
thumbnail: { geometry: "220x130#", format: 'jpg', time: 3 }
},
processors: [:transcoder]
Somehow video without any defects looks a bit stretched horizontally on a thumbnail.
Do you have any ideas what could it be?
From Gemfile.lock:
paperclip-av-transcoder (0.6.4)
av (~> 0.9.0)
paperclip (>= 2.5.2)
So in conjunction I am running Delayed Paperclip to process large files in the background (Not sure if that plays a big role). Couple things:
1) I cannot find anywhere in the source where the command ffmpeg
is called. All I really want to do is save the output of ffmpeg to see if there any errors that I do not know about.
2) Large videos always seem to get hung up at a certain point: (the first file is being converted from the second file, and the third file is being converted from the fourth file)
<br />v2@web1 ~/divshare-v2 $ ls -alh /tmp <br />-rw------- 1 v2 v2 70M Sep 10 00:01 2158940a8739e7219125179e0d1528c120160909-14061-8dqfx020160909-14061-egeyeq.mp4 <br />-rw------- 1 v2 v2 515M Sep 9 23:57 2158940a8739e7219125179e0d1528c120160909-14061-8dqfx0.mp4 <br />-rw------- 1 v2 v2 145M Sep 9 23:33 76ba144beb8a14b6cf542225ef885a7c20160909-12733-1ui03vo20160909-12733-y7ywn.mp4 <br />-rw------- 1 v2 v2 604M Sep 9 23:27 76ba144beb8a14b6cf542225ef885a7c20160909-12733-1ui03vo.mp4 <br />
I have tried uploading a couple times and with different files. Always gets caught around the same point. However everything works perfectly when smaller videos (~100-200M).
This is the command being ran:
<br />v2@web1 ~/divshare-v2 $ ps ux | grep ffmpeg <br />USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND <br />v2 14588 26.4 2.9 849840 240524 ? Sl Sep09 12:00 ffmpeg -i /tmp/2158940a8739e7219125179e0d1528c120160909-14061-8dqfx0.mp4 -acodec aac -strict experimental -vcodec libx264 -vb 1000k -profile:v baseline -vf scale=-2:480 -acodec aac -ab 128k -preset slow -threads 0 -movflags faststart -y /tmp/2158940a8739e7219125179e0d1528c120160909-14061-8dqfx020160909-14061-egeyeq.mp4 <br />
Any sort of help debugging this would be awesome.
NOTE: I copied the above command and manually ran the command so that I could see some logs from ffmpeg, and worked seamlessly.
I am getting the following error after starting the server :
/home/sachin/.rvm/gems/ruby-1.9.3-p551/gems/paperclip-av-transcoder-0.6.4/lib/paperclip/paperclip_processors/transcoder.rb:2:in `module:Paperclip': uninitialized constant Paperclip::Processor (NameError)
What am i doing wrong?
I love this plugin, but AVI/MOV conversions to mp4 always errors out. Anyone know why?
Here's an example of one log file:
[AV] Found ["avconv"], using: Avconv
[AV] Running command: avconv -i "/tmp/0cfcdbeb8752f2f04bae352148788e0020151022-3723-1hezry7.AVI" 2>&1
[paperclip] [transcoder] Transocding supported file /tmp/0cfcdbeb8752f2f04bae352148788e0020151022-3723-1hezry7.AVI
[AV] Adding output parameter ["acodec", "aac"]
[AV] Adding output parameter ["strict", "experimental"]
[AV] Running command: avconv -loglevel quiet -i "/tmp/0cfcdbeb8752f2f04bae352148788e0020151022-3723-1hezry7.AVI" -acodec aac -strict experimental -y "/tmp/0cfcdbeb8752f2f04bae352148788e0020151022-3723-1hezry720151022-3723-xxgxix.mp4"
Av::CommandError: error while running command avconv -loglevel quiet -i "/tmp/0cfcdbeb8752f2f04bae352148788e0020151022-3723-1hezry7.AVI" -acodec aac -strict experimental -y "/tmp/0cfcdbeb8752f2f04bae352148788e0020151022-3723-1hezry720151022-3723-xxgxix.mp4": Command 'PATH=/usr/bin:$PATH; avconv -loglevel quiet -i "/tmp/0cfcdbeb8752f2f04bae352148788e0020151022-3723-1hezry7.AVI" -acodec aac -strict experimental -y "/tmp/0cfcdbeb8752f2f04bae352148788e0020151022-3723-1hezry720151022-3723-xxgxix.mp4"' returned 1. Expected 0
Here is the command output:
from /var/lib/gems/1.9.1/gems/av-0.8.0/lib/av.rb:32:in `rescue in run'
from /var/lib/gems/1.9.1/gems/av-0.8.0/lib/av.rb:29:in `run'
from /var/lib/gems/1.9.1/gems/av-0.8.0/lib/av/commands/base.rb:91:in `run'
from /var/lib/gems/1.9.1/gems/av-0.8.0/lib/av/cli.rb:19:in `method_missing'
from /var/lib/gems/1.9.1/gems/paperclip-av-transcoder-0.6.2/lib/paperclip/paperclip_processors/transcoder.rb:66:in `make'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/processor.rb:33:in `make'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:522:in `block in post_process_style'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:521:in `each'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:521:in `inject'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:521:in `post_process_style'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:512:in `block in post_process_styles'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:511:in `each'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:511:in `post_process_styles'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:503:in `block (2 levels) in post_process'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:113:in `call'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:113:in `call'
... 3 levels...
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/callbacks.rb:36:in run_paperclip_callbacks' from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:501:in
block in post_process'
from /var/lib/gems/1.9.1/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:82:in run_callbacks' from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/callbacks.rb:36:in
run_paperclip_callbacks'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:500:in post_process' from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:456:in
post_process_file'
from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/attachment.rb:108:in assign' from /var/lib/gems/1.9.1/gems/paperclip-4.2.1/lib/paperclip/has_attached_file.rb:66:in
block in define_setter'
from (irb):7
from /var/lib/gems/1.9.1/gems/railties-4.1.6/lib/rails/commands/console.rb:90:in start' from /var/lib/gems/1.9.1/gems/railties-4.1.6/lib/rails/commands/console.rb:9:in
start'
from /var/lib/gems/1.9.1/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:69:in console' from /var/lib/gems/1.9.1/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in
run_command!'
from /var/lib/gems/1.9.1/gems/railties-4.1.6/lib/rails/commands.rb:17:in <top (required)>' from bin/rails:4:in
require'
from bin/rails:4:in `
Can we please have a list of dependencies this gem depends on. like ffmpeg
I get this error on uploading video.
LoadError (cannot load such file --/Users/SM/Developer/QBXNet/RoR/etracs/project/lib/paperclip_processors/transcoder.rb)
any other files needed. where do we get this file?
Hello, I am facing issue with url generated by paperclip as video is saved properly but I guess there is issue with url.I have mentioned my issue details here:
https://stackoverflow.com/questions/44627743/url-issue-paperclip-av-transcoder?noredirect=1#comment76241134_44627743
Can you let me what I am doing wrong?
Hello i have a process
has_attached_file :video_presentacion, :styles => {
:original => { :geometry => "1280x720", :format => 'mp4',:convert_options => { :output => { :vcodec => 'libx264'}} },
:thumb => { :geometry => "250x250#", :format => 'png', :time => 12}
}, :processors => [:transcoder]
But ONLY FILES WEBM have a error to convert mp4
App 7899 stderr: Conversion failed!
App 7925 stdout: Validation failed: Video presentacion error while processing video for 4158602f121d1e6f0dc8ba45a4c25fa620150716-7925-p6w4w8: Command 'PATH=/usr/local/bin/:$PATH; ffmpeg -i '/tmp/4158602f121d1e6f0dc8ba45a4c25fa620150716-7925-p6w4w8.webm' -vcodec libx264 -s 1280x720 -acodec aac -strict experimental -y '/tmp/4158602f121d1e6f0dc8ba45a4c25fa620150716-7925-p6w4w820150716-7925-1ipibkg.mp4''
here log:
App 7899 stderr: [libx264 @ 0x2534440] AVFrame.format is not set
App 7899 stderr: [libx264 @ 0x2534440] AVFrame.width or height is not set
App 7899 stderr: [libx264 @ 0x2534440] Input picture width (1280) is greater than stride (0)
App 7899 stderr: Video encoding failed
App 7899 stderr: [libx264 @ 0x2534440] frame I:125 Avg QP:16.63 size: 53542
App 7899 stderr: [libx264 @ 0x2534440] frame P:8143 Avg QP:18.97 size: 1151
App 7899 stderr: [libx264 @ 0x2534440] frame B:22849 Avg QP:27.42 size: 52
App 7899 stderr: [libx264 @ 0x2534440] consecutive B-frames: 2.0% 0.1% 0.2% 97.6%
App 7899 stderr: [libx264 @ 0x2534440] mb I I16..4: 19.2% 71.8% 9.1%
App 7899 stderr: [libx264 @ 0x2534440] mb P I16..4: 0.3% 0.4% 0.0% P16..4: 5.1% 0.8% 0.7% 0.0% 0.0% skip:92.7%
App 7899 stderr: [libx264 @ 0x2534440] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.6% 0.0% 0.0% direct: 0.0% skip:99.4% L0:17.2% L1:82.8% BI: 0.0%
App 7899 stderr: [libx264 @ 0x2534440] 8x8 transform intra:65.9% inter:70.7%
App 7899 stderr: [libx264 @ 0x2534440] coded y,uvDC,uvAC intra: 67.2% 90.7% 69.3% inter: 0.5% 1.2% 0.1%
App 7899 stderr: [libx264 @ 0x2534440] i16 v,h,dc,p: 18% 20% 27% 35%
App 7899 stderr: [libx264 @ 0x2534440] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 23% 31% 3% 4% 4% 6% 5% 6%
App 7899 stderr: [libx264 @ 0x2534440] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 22% 17% 4% 7% 6% 7% 5% 4%
App 7899 stderr: [libx264 @ 0x2534440] i8c dc,h,v,p: 54% 22% 19% 5%
App 7899 stderr: [libx264 @ 0x2534440] Weighted P-Frames: Y:0.1% UV:0.0%
App 7899 stderr: [libx264 @ 0x2534440] ref P L0: 83.9% 8.3% 7.1% 0.7% 0.0%
App 7899 stderr: [libx264 @ 0x2534440] ref B L0: 75.6% 24.1% 0.3%
App 7899 stderr: [libx264 @ 0x2534440] ref B L1: 91.3% 8.7%
App 7899 stderr: [libx264 @ 0x2534440] kb/s:4438.32
App 7899 stderr: [aac @ 0x26249c0] 2 frames left in the queue on closing
App 7899 stderr: Conversion failed!
App 7899 stderr: ffmpeg version git-2015-04-15-c5d4f87 Copyright (c) 2000-2015 the FFmpeg developers
App 7899 stderr: built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
App 7899 stderr: configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3
App 7899 stderr: libavutil 54. 22.101 / 54. 22.101
App 7899 stderr: libavcodec 56. 34.100 / 56. 34.100
App 7899 stderr: libavformat 56. 30.100 / 56. 30.100
App 7899 stderr: libavdevice 56. 4.100 / 56. 4.100
App 7899 stderr: libavfilter 5. 14.100 / 5. 14.100
App 7899 stderr: libswscale 3. 1.101 / 3. 1.101
App 7899 stderr: libswresample 1. 1.100 / 1. 1.100
App 7899 stderr: libpostproc 53. 3.100 / 53. 3.100
App 7899 stderr: Input #0, matroska,webm, from '/tmp/4158602f121d1e6f0dc8ba45a4c25fa620150716-7925-p6w4w8.webm':
App 7899 stderr: Metadata:
App 7899 stderr: encoder : GStreamer plugin version 1.2.4
App 7899 stderr:
App 7899 stderr: creation_time : 2015-04-15 17:18:00
App 7899 stderr: Duration: 00:00:31.17, start: 0.000000, bitrate: 1553 kb/s
App 7899 stderr: Stream #0:0(eng): Video: vp8, yuv420p, 1280x720, SAR 1:1 DAR 16:9,
App 7899 stderr: 1k tbr, 1k tbn, 1k tbc
App 7899 stderr: (default)
App 7899 stderr: Metadata:
App 7899 stderr: title : Video
App 7899 stderr: Stream #0:1(eng): Audio: vorbis, 44100 Hz, mono, fltp (default)
App 7899 stderr: Metadata:
App 7899 stderr: title : Audio
App 7899 stderr: Output #0, image2, to '/tmp/4158602f121d1e6f0dc8ba45a4c25fa620150716-7925-p6w4w820150716-7925-1hx3qv8.png':
App 7899 stderr: Metadata:
App 7899 stderr: encoder : Lavf56.30.100
App 7899 stderr: Stream #0:0(eng): Video: png, rgb24, 250x250 [SAR 376:375 DAR 376:375], q=2-31, 200 kb/s, 1k fps, 1k tbn, 1k tbc (default)
App 7899 stderr: Metadata:
App 7899 stderr: title : Video
App 7899 stderr: encoder : Lavc56.34.100 png
App 7899 stderr: Stream mapping:
App 7899 stderr: Stream #0:0 -> #0:0 (vp8 (native) -> png (native))
App 7899 stderr: Press [q] to stop, [?] for help
App 7899 stderr: frame= 1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.00 bitrate=N/A dup=1 drop=1
App 7899 stderr: video:59kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
App 7925 stdout: Validation failed: Video presentacion error while processing video for 4158602f121d1e6f0dc8ba45a4c25fa620150716-7925-p6w4w8: Command 'PATH=/usr/local/bin/:$PATH; ffmpeg -i '/tmp/4158602f121d1e6f0dc8ba45a4c25fa620150716-7925-p6w4w8.webm' -vcodec libx264 -s 1280x720 -acodec aac -strict experimental -y '/tmp/4158602f121d1e6f0dc8ba45a4c25fa620150716-7925-p6w4w820150716-7925-1ipibkg.mp4'' returned 1. Expected 0
I wasn't really sure where else to try and get help with my issues so I ended up posting here. Whenever I add styles to the file upload I get this error:
Command :: PATH=/usr/local/bin/:$PATH file -b --mime '/var/folders/9y/6w60_d8n3p5084sxpnl6kj900000gn/T/fe208ed3e8facea9700ed13929aef73720150121-32345-8vcuoz.mov'
[AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
sh: -c: line 0: syntax error near unexpected token `then'
sh: -c: line 0: `PATH=/usr/local/bin/:$PATH if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi'
Completed 500 Internal Server Error in 861ms
Av::CommandError (error while running command if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi: Command 'PATH=/usr/local/bin/:$PATH if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi' returned 2. Expected 0
Here is the command output:
):
I don't really have any experience when interacting with gems and I haven't been able to find anything on this issue. Any help is greatly appreciated.
Thanks
Everything was working fine with the paperclip-ffmpeg version 1.0.1 but when I switch to version paperclip-ffmpeg 1.2.0 OR 'paperclip-av-transcoder', "0.6.2" I get this stack:
Command :: PATH=/usr/local/bin/ffmpeg:$PATH file -b --mime '/var/folders/43/t8s11k6d145c4wtwfpnbxh640000gn/T/6c84cbd30cf9350a990bad2bcc1bec5f20150205-9953-enmm0q.MOV'
[AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
sh: -c: line 0: syntax error near unexpected token `then'
sh: -c: line 0: `PATH=/usr/local/bin/ffmpeg:$PATH if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi'
Could not log "process_action.action_controller" event. Encoding::UndefinedConversionError: "\xEA" from ASCII-8BIT to UTF-8 ["...'"]
Av::CommandError - error while running command if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi: Command 'PATH=/usr/local/bin/ffmpeg:$PATH if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi' returned 2. Expected 0
Here is the command output:
:
av (0.8.0) lib/av.rb:32:in `rescue in run'
av (0.8.0) lib/av.rb:29:in `run'
av (0.8.0) lib/av/cli.rb:24:in `detect_command'
av (0.8.0) lib/av/cli.rb:7:in `initialize'
av (0.8.0) lib/av.rb:24:in `cli'
paperclip-av-transcoder (0.6.2) lib/paperclip/paperclip_processors/transcoder.rb:14:in `initialize'
paperclip (4.2.1) lib/paperclip/processor.rb:33:in `make'
If i try to execute the command in my terminal:
$ PATH=/usr/local/bin/ffmpeg:$PATH if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
-bash: syntax error near unexpected token `then'
So when I upload my video, it shows just a black image. No play button or anything. I am very new to this and trying my best. Any help would be very helpful
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.