ruby-av / paperclip-av-transcoder

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

CPU limit ffmpeg #47

Open lohqua opened 8 years ago

lohqua commented 8 years ago

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.

ghost commented 8 years ago

I'm trying to wrap ffmpeg inside https://github.com/opsengine/cpulimit on FreeBSD but so far it's still using 100%:

mv /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg_raw
echo '/usr/local/bin/cpulimit --limit 20 /usr/local/bin/ffmpeg_raw "$@"' > /usr/local/bin/ffmpeg
chmod +x /usr/local/bin/ffmpeg

Could you try and see if this works?