ruby-av / paperclip-av-transcoder

Audio/Video Transcoder for Paperclip using FFMPEG/Avconv
MIT License
136 stars 83 forks source link

Command error #8

Closed casertap closed 9 years ago

casertap commented 9 years ago

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'
casertap commented 9 years ago

Forcing the cocaine version to 0.5.3 solved this issue but I do not think this should be the final solution. I reported the bug to the cocaine gem. Maybe it the the command send to cocaine by paperclip-av-transcoder that needs to be changed to work on mac?

owahab commented 9 years ago

I think upgrading cocaine to 0.5.3 is not a bad idea at all.

owahab commented 9 years ago

Please confirm the fix for av gem master branch.

cdub32k commented 9 years ago

Hey owahab,

I am trying to use paperclip-av-transcoder and it is working, except it is not generating the correct size for my thumbnails. I believe I have spotted the issue on line 37 of paperclip/paperclip_processors/transcoder.rb. There is a typo in the geometry variable:

@convert_options[:output][:s] = format_geometry(@geometry) if @gemotry.present?

The conversion works if I set convert_options directly.

Thanks, Chris

cdub32k commented 9 years ago

Actually setting covert_options does not work either.

owahab commented 9 years ago

@cdub32k this was fixed in #11

cdub32k commented 9 years ago

Ok thanks, I saw there was already an issue for this after I posted my comments.

However I am still seeing the "gemotry" typo when I install the gem directly from github using

gem 'paperclip-av-transcoder', github: 'ruby-av/paperclip-av-transcoder'

If I modify the gem code to fix this typo, I can resize my thumbnails.

owahab commented 9 years ago

Just released 0.6.3 with this fix. Please test and update.