{"action":"reopened","issue":{"url":"https://api.github.com/repos/ruby-av/paperclip-av-transcoder/issues/17","labels_url":"https://api.github.com/repos/ruby-av/paperclip-av-transcoder/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/ruby-av/paperclip-av-transcoder/issues/17/comments","events_url":"https://api.github.com/repos/ruby-av/paperclip-av-transcoder/issues/17/events","html_url":"https://github.com/ruby-av/paperclip-av-transcoder/issues/17","id":81234870,"number":17,"title":"How to make it choose ffmpeg over avconv?","user":{"login":"dt1973","id":10206439,"avatar_url":"https://avatars.githubusercontent.com/u/10206439?v=3","gravatar_id":"","url":"https://api.github.com/users/dt1973","html_url":"https://github.com/dt1973","followers_url":"https://api.github.com/users/dt1973/followers","following_url":"https://api.github.com/users/dt1973/following{/other_user}","gists_url":"https://api.github.com/users/dt1973/gists{/gist_id}","starred_url":"https://api.github.com/users/dt1973/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dt1973/subscriptions","organizations_url":"https://api.github.com/users/dt1973/orgs","repos_url":"https://api.github.com/users/dt1973/repos","events_url":"https://api.github.com/users/dt1973/events{/privacy}","received_events_url":"https://api.github.com/users/dt1973/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-27T02:27:20Z","updated_at":"2015-05-27T14:51:38Z","closed_at":null,"body":"### How to make paperclip-av-transcoder choose ffmpeg over avconv if both are found?\r\n\r\nhttp://runnable.com/VR3jBtJKSwh21EKs/paperclip-av-transcoder\r\n\r\n```\r\nStarted POST \"/default/topics\" for ::ffff at 2015-04-05 14:05:33 +0000                                                                      \r\nProcessing by Forem::TopicsController#create as HTML                                                                                                    \r\n  Parameters: {\"utf8\"=>\"�~\\~S\", \"authenticity_token\"=>\"+6Ma4fmBeexCEFsP9z8b5Af5vJQKarMssAxFdIHMHGEkRcP09T/zgmlVAM4Trb2iHWkHVFGFrHBqO3E8GGAzJw==\", \"topic\r\n\"=>{\"subject\"=>\"sfgfgsfg\", \"posts_attributes\"=>{\"0\"=>{\"text\"=>\"sfhsg\", \"photos_attributes\"=>{\"0\"=>{\"attachment\"=>#<ActionDispatch::Http::UploadedFile:0x\r\n00000004502798 @tempfile=#<File:/tmp/RackMultipart20150405-50-183sbay.gif>, @original_filename=\"test.gif\", @content_type=\"image/gif\", @headers=\"Content-\r\nDisposition: form-data; name=\\\"topic[posts_attributes][0][photos_attributes][0][attachment]\\\"; filename=\\\"test.gif\\\"\\r\\nContent-Type: image/gif\\r\\n\">}}}\r\n}}, \"commit\"=>\"Create Topic\", \"forum_id\"=>\"default\"}                                                                                                    \r\n  ^[[1m^[[35mUser Load (0.3ms)^[[0m  SELECT  \"users\".* FROM \"users\" WHERE \"users\".\"id\" = ?  ORDER BY \"users\".\"id\" ASC LIMIT 1  [[\"id\", 1]]              \r\n  ^[[1m^[[36mForem::Forum Load (0.2ms)^[[0m  ^[[1mSELECT  \"forem_forums\".* FROM \"forem_forums\" WHERE \"forem_forums\".\"slug\" = ?  ORDER BY \"forem_forums\".\r\n\"position\" ASC LIMIT 1^[[0m  [[\"slug\", \"default\"]]                                                                                                      \r\n  ^[[1m^[[35mForem::Category Load (0.1ms)^[[0m  SELECT  \"forem_categories\".* FROM \"forem_categories\" WHERE \"forem_categories\".\"id\" = ? LIMIT 1  [[\"id\", \r\n1]]                                                                                                                                                     \r\nCommand :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-oihgom.gif'                                                                 \r\n[AV] Running command: if command -v avprobe 2>/dev/null; then echo \"true\"; else echo \"false\"; fi                                                        \r\n[AV] Running command: if command -v ffmpeg 2>/dev/null; then echo \"true\"; else echo \"false\"; fi                                                         \r\n[AV] Found [\"avconv\", \"ffmpeg\"], using: Avconv                                                                                                          \r\n[AV] Running command: if command -v avprobe 2>/dev/null; then echo \"true\"; else echo \"false\"; fi                                                        \r\n[AV] Running command: if command -v ffmpeg 2>/dev/null; then echo \"true\"; else echo \"false\"; fi                                                         \r\n[AV] Found [\"avconv\", \"ffmpeg\"], using: Avconv                                                                                                          \r\n[AV] Running command: avconv -i \"/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif\" 2>&1                                                     \r\n[paperclip] [transcoder] Transocding supported file /tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif                                        \r\n[AV] Adding output parameter [\"acodec\", \"aac\"]                                                                                                          \r\n[AV] Adding output parameter [\"strict\", \"experimental\"]                                                                                                 \r\n[AV] Running command: avconv -loglevel quiet -i \"/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif\" -acodec aac -strict experimental -y \"/tmp\r\n/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-nyp8zp.mp4\"                                                                             \r\n[paperclip] [transcoder] Successfully transcoded 098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid to #<File:0x000000046bf298>                        \r\n[paperclip] [qtfaststart] :source :dest                                                                                                                 \r\nCommand :: qtfaststart '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-nyp8zp.mp4' '/tmp/098f6bcd4621d373cade4e832627b4f620150405-5\r\n0-1lz9oid20150405-50-nyp8zp20150405-50-1cczssi.mp4' \r\nCommand :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-nyp8zp20150405-50-1cczssi.mp4'                           \r\nCommand :: identify -format '%wx%h,%[exif:orientation]' '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif[0]' 2>/dev/null                   \r\nCommand :: identify -format %m '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif[0]'                                                        \r\nCommand :: convert '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid.gif' -coalesce -auto-orient -resize \"x70\" -crop \"70x70+27+0\" +repage -layer\r\ns \"optimize\" '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-19tfyp0'                                                              \r\nCommand :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1lz9oid20150405-50-19tfyp0'                                                 \r\n  ^[[1m^[[36m (0.2ms)^[[0m  ^[[1mbegin transaction^[[0m                                                                                                 \r\n  ^[[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\" = \r\n? LIMIT 1  [[\"slug\", \"sfgfgsfg\"]]                                                                                                                       \r\nCommand :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-50-1kui4uq.gif'                                                                \r\n  ^[[1m^[[36mSQL (0.7ms)^[[0m  ^[[1mINSERT INTO \"forem_topics\" (\"subject\", \"forum_id\", \"user_id\", \"slug\", \"created_at\", \"updated_at\") VALUES (?, ?, ?, ?\r\n, ?, ?)^[[0m  [[\"subject\", \"sfgfgsfg\"], [\"forum_id\", 1], [\"user_id\", 1], [\"slug\", \"sfgfgsfg\"], [\"created_at\", \"2015-04-05 14:05:38.824979\"], [\"updated_a\r\nt\", \"2015-04-05 14:05:38.824979\"]]                                                                                                                      \r\n  ^[[1m^[[35mSQL (0.2ms)^[[0m  INSERT INTO \"forem_posts\" (\"text\", \"user_id\", \"topic_id\", \"created_at\", \"updated_at\") VALUES (?, ?, ?, ?, ?)  [[\"text\", \"\r\nsfhsg\"], [\"user_id\", 1], [\"topic_id\", 9], [\"created_at\", \"2015-04-05 14:05:38.828987\"], [\"updated_at\", \"2015-04-05 14:05:38.828987\"]]                   \r\n  ^[[1m^[[36mForem::Topic Load (0.2ms)^[[0m  ^[[1mSELECT  \"forem_topics\".* FROM \"forem_topics\" WHERE \"forem_topics\".\"id\" = ? LIMIT 1^[[0m  [[\"id\", 9]]  \r\n  ^[[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]]     \r\n  ^[[1m^[[36mForem::Subscription Load (0.4ms)^[[0m  ^[[1mSELECT  \"forem_subscriptions\".* FROM \"forem_subscriptions\" WHERE \"forem_subscriptions\".\"topic_i\r\nd\" = ?  ORDER BY \"forem_subscriptions\".\"id\" ASC LIMIT 1000^[[0m  [[\"topic_id\", 9]]\r\n```\r\n\r\n### As one would expect, this was never a problem with paperclip-ffmpeg:\r\n\r\nhttp://runnable.com/VSFEpaY88OsqHGa0/paperclip-reverted-to-ffmpeg\r\n\r\n```\r\nStarted POST \"/default/topics\" for ::ffff at 2015-04-05 14:16:37 +0000                                                                      \r\nProcessing by Forem::TopicsController#create as HTML                                                                                                    \r\n  Parameters: {\"utf8\"=>\"�~\\~S\", \"authenticity_token\"=>\"ZLQT2hWb+VtRpso+IWo/iAv2bf6x2Fcgp/bV9F8bwQdouiumXUXMNbtJrrdpkGkW1AMByf8R1bxiZVLA7BiUOQ==\", \"topic\r\n\"=>{\"subject\"=>\"shfhfhf\", \"posts_attributes\"=>{\"0\"=>{\"text\"=>\"asdasdasd\", \"photos_attributes\"=>{\"0\"=>{\"attachment\"=>#<ActionDispatch::Http::UploadedFile\r\n:0x00000005ba0a40 @tempfile=#<File:/tmp/RackMultipart20150405-60-1au05n3.gif>, @original_filename=\"test.gif\", @content_type=\"image/gif\", @headers=\"Conte\r\nnt-Disposition: form-data; name=\\\"topic[posts_attributes][0][photos_attributes][0][attachment]\\\"; filename=\\\"test.gif\\\"\\r\\nContent-Type: image/gif\\r\\n\">\r\n}}}}}, \"commit\"=>\"Create Topic\", \"forum_id\"=>\"default\"}                                                                                                 \r\n  ^[[1m^[[35mUser Load (0.3ms)^[[0m  SELECT  \"users\".* FROM \"users\" WHERE \"users\".\"id\" = ?  ORDER BY \"users\".\"id\" ASC LIMIT 1  [[\"id\", 1]]              \r\n  ^[[1m^[[36mForem::Forum Load (0.2ms)^[[0m  ^[[1mSELECT  \"forem_forums\".* FROM \"forem_forums\" WHERE \"forem_forums\".\"slug\" = ?  ORDER BY \"forem_forums\".\r\n\"position\" ASC LIMIT 1^[[0m  [[\"slug\", \"default\"]]                                                                                                      \r\n  ^[[1m^[[35mForem::Category Load (0.2ms)^[[0m  SELECT  \"forem_categories\".* FROM \"forem_categories\" WHERE \"forem_categories\".\"id\" = ? LIMIT 1  [[\"id\", \r\n1]]                                                                                                                                                     \r\nCommand :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-1d84keo.gif'                                                                \r\n[paperclip] [ffmpeg] ffprobe \"/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif\" 2>&1                                                         \r\n[paperclip] [ffmpeg] Command Success                                                                                                                    \r\n[paperclip] [ffmpeg] Making...                                                                                                                          \r\n[paperclip] [ffmpeg] Building Destination File: '098f6bcd4621d373cade4e832627b4f620150405-60-akyw04' + 'mp4'                                            \r\n[paperclip] [ffmpeg] Destination File Built                                                                                                             \r\n[paperclip] [ffmpeg] Adding Geometry                                                                                                                    \r\n[paperclip] [ffmpeg] Adding Format                                                                                                                      \r\n[paperclip] [ffmpeg] Adding Source                                                                                                                      \r\n[paperclip] [ffmpeg] Building Parameters                                                                                                                \r\n[paperclip] [ffmpeg] -i :source -acodec aac -strict experimental -y :dest                                                                               \r\nCommand :: ffmpeg -i '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif' -acodec aac -strict experimental -y '/tmp/098f6bcd4621d373cade4e83262\r\n7b4f620150405-60-akyw0420150405-60-nx0j61.mp4'                                                                                                          \r\n[paperclip] [qtfaststart] :source :dest                                                                                                                 \r\nCommand :: qt-faststart '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw0420150405-60-nx0j61.mp4' '/tmp/098f6bcd4621d373cade4e832627b4f620150405-6\r\n0-akyw0420150405-60-nx0j6120150405-60-jbc80d.mp4'                                                                                                       \r\nCommand :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw0420150405-60-nx0j6120150405-60-jbc80d.mp4'                             \r\nCommand :: identify -format '%wx%h,%[exif:orientation]' '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif[0]' 2>/dev/null                    \r\nCommand :: identify -format %m '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif[0]'                                                         \r\nCommand :: convert '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw04.gif' -coalesce -auto-orient -resize \"x70\" -crop \"70x70+27+0\" +repage -layers\r\n \"optimize\" '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw0420150405-60-1benqrt'                                                                \r\nCommand :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-akyw0420150405-60-1benqrt'                                                  \r\n  ^[[1m^[[36m (0.2ms)^[[0m  ^[[1mbegin transaction^[[0m                                                                                                 \r\n  ^[[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\" = \r\n? LIMIT 1  [[\"slug\", \"shfhfhf\"]]                                                                                                                        \r\nCommand :: file -b --mime '/tmp/098f6bcd4621d373cade4e832627b4f620150405-60-kdq57l.gif'                                                                 \r\n  ^[[1m^[[36mSQL (1.0ms)^[[0m  ^[[1mINSERT INTO \"forem_topics\" (\"subject\", \"forum_id\", \"user_id\", \"slug\", \"created_at\", \"updated_at\") VALUES (?, ?, ?, ?\r\n, ?, ?)^[[0m  [[\"subject\", \"shfhfhf\"], [\"forum_id\", 1], [\"user_id\", 1], [\"slug\", \"shfhfhf\"], [\"created_at\", \"2015-04-05 14:16:42.081114\"], [\"updated_at\"\r\n, \"2015-04-05 14:16:42.081114\"]]                                                                                                                        \r\n  ^[[1m^[[35mSQL (0.4ms)^[[0m  INSERT INTO \"forem_posts\" (\"text\", \"user_id\", \"topic_id\", \"created_at\", \"updated_at\") VALUES (?, ?, ?, ?, ?)  [[\"text\", \"\r\nasdasdasd\"], [\"user_id\", 1], [\"topic_id\", 9], [\"created_at\", \"2015-04-05 14:16:42.085832\"], [\"updated_at\", \"2015-04-05 14:16:42.085832\"]]               \r\n  ^[[1m^[[36mForem::Topic Load (0.1ms)^[[0m  ^[[1mSELECT  \"forem_topics\".* FROM \"forem_topics\" WHERE \"forem_topics\".\"id\" = ? LIMIT 1^[[0m  [[\"id\", 9]]  \r\n  ^[[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]]      \r\n  ^[[1m^[[36mForem::Subscription Load (0.2ms)^[[0m  ^[[1mSELECT  \"forem_subscriptions\".* FROM \"forem_subscriptions\" WHERE \"forem_subscriptions\".\"topic_i\r\nd\" = ?  ORDER BY \"forem_subscriptions\".\"id\" ASC LIMIT 1000^[[0m  [[\"topic_id\", 9]]\r\n```"}}