Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command error #8

Closed
casertap opened this issue Feb 5, 2015 · 8 comments
Closed

Command error #8

casertap opened this issue Feb 5, 2015 · 8 comments
Assignees

Comments

@casertap
Copy link

casertap commented Feb 5, 2015

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
Copy link
Author

casertap commented Feb 5, 2015

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
Copy link
Member

owahab commented Mar 2, 2015

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

@owahab owahab self-assigned this Mar 2, 2015
owahab added a commit to ruby-av/av that referenced this issue Mar 2, 2015
@owahab
Copy link
Member

owahab commented Mar 2, 2015

Please confirm the fix for av gem master branch.

@cdub32k
Copy link

cdub32k commented Mar 8, 2015

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
Copy link

cdub32k commented Mar 8, 2015

Actually setting covert_options does not work either.

@owahab
Copy link
Member

owahab commented Mar 8, 2015

@cdub32k this was fixed in #11

@owahab owahab closed this as completed Mar 8, 2015
@cdub32k
Copy link

cdub32k commented Mar 9, 2015

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
Copy link
Member

owahab commented Mar 11, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants