The current options that Video Monkey feeds to ffmpeg use the default single thread. Fortunately Video Monkey is setup in a rather clever way, and we are able change the commands used easily.
To use all of your CPU cores:
- Open your applications folder, right click on Video Monkey, select "Show Package Contents"
- a new finder window appears, open "Contents" and then "Resources"
- open "commands.xml" in your favorite text editor
- find the section "<device_group title="iTunes">"
- go down a few more lines to get to the element "<command id="ffmpeg_options">"
This is the command line that is executed when you encode a video usting any of the devices that are under the "iTunes" group in the UI.
On the end of that list of command line parameters add "-threads 2". Use the number of CPU cores you have.
Your finished product should look something like this:
-vcodec $ffmpeg_vcodec -b $output_video_bitrate -s $(output_video_width)x$(output_video_height)
-aspect $(output_video_width):$(output_video_height) -r $(output_video_frame_rate)
-acodec $ffmpeg_acodec -ab $output_audio_bitrate -ar $output_audio_sample_rate -ac $output_audio_channels
Grab a new video to encode, and watch your CPU meter.
I've gone from using 8% of my CPU to 12% with this little fix. There has to be a way to utilize most of our cores on our Mac Pros.
Andrew's tip works if you have 2 cores / CPUs.
To allow ffmpeg to automatically determine how many cores to use (i.e. the maximum) it should be -threads 0
After making this -threads 2 change on my iMac (intel Core 2 Duo) I did notice that my CPU usage jumped way up close to the max, however, on the console I get this message:
-> Warning: not compiled with thread support, using thread emulation
I'm assuming that "thread emulation" is way less efficient than "thread support". Can the ffmpeg embedded in VideoMonkey be replaced with a copy that has this thread support turned on? If so, has anyone been able to build a copy of ffmpeg on Snow Leopard with this option, or at all for that matter? I've tried downloading the source and building it, but all my attempts have failed.
Cheers for this, halved my compress times… amazing! :)
yes I have been able to compile ffmepg in snow loepard and replace the one that comes with video monkey.. it has made a nice improvement… it is now 64 bit and runs 4 threads cutting my encoding in half.
You can easily install an optimized version of the latest ffmpeg with homebrew
- install homebrew
brew install ffmpeg
moondogg any chance you could share the compiled ffmepg? I would be most appreciative.
Is this tweak still applicable in v.10 ?
Asking, as I've switched to using an intel i3 CPU based mac and am seeing much longer compress times compared to a 3yr old macbook pro with an Intel core 2 duo CPU.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.