Blog Projects
Escape Keys
A ColdFusion and Web Development Blog by Tom de Manincor
 
FFMPEG and ColdFusion

This topic seems to come up often.

I worked on a project recently that required the use of FFMPEG to convert videos into FLV. Your typical YouTube approach. There are some posts out there that offer what they can, but most using the native CFEXECUTE. Which I can say myself was not an effective solution.

It seems the thread would either close too early or not at all. No matter what you set for your timeout.

Our solution was to use the Java Runtime library.

The function looked like this:

(Keep in mind your arguments will vary depending on what you are trying to do here)

<cffunction name="convertVideo" access="public" output="false" returntype="struct">
<cfargument name="binPath" required="Yes" type="string" />
<cfargument name="srcPath" required="Yes" type="string" />
<cfargument name="destPath" required="Yes" type="string" />

<cfset var rtnStruct = structNew() />
<cfset var r = '' />
<cfset var ar_arg = arrayNew(1) />

<cfscript>
rtnStruct.success = false;
arrayappend(ar_arg, "-i");
arrayAppend(ar_arg, '"#arguments.srcPath#"');
arrayappend(ar_arg, "-g 300");
arrayappend(ar_arg, "-y");
arrayappend(ar_arg, "-s");
arrayappend(ar_arg, "320x240");
arrayappend(ar_arg, "-aspect");
arrayappend(ar_arg, "4:3");
arrayappend(ar_arg, "-f");
arrayappend(ar_arg, "flv");
arrayappend(ar_arg, "-ar");
arrayappend(ar_arg, "44100");
arrayAppend(ar_arg, '"#arguments.destPath#"');

try{
r = createObject('java','java.lang.Runtime').getRuntime();
r.exec('#arguments.binPath#\ffmpeg.exe #arraytoList(ar_arg,' ')#');
r.runFinalization();
r.freeMemory();
rtnStruct.success = true;
}

catch(excpt any){
rtnStruct.message = excpt.message;
}
</cfscript>

<cfreturn rtnStruct />
</cffunction>

UltraMon - A Must For Multiple Monitors in Windows

I've tried a handful of Virtual Desktop Management Apps and Window Managers for Windows but nothing quite as nice as you'll find native in Linux.

UltraMon is not the ultimate solution, since it doesn't handle multiple desktops. But when it comes to Window Management with Dual or more monitors in Windows, it's tough to beat.

Give the link a click and try it out.

Curious to hear some feedback and always open to better solutions.

(Still looking for a solid Virtual Desktop Manager)

Synergy - The Software KVM

This has to be one of my favorite Apps out there and its free.

"Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display(s), without special hardware."

I've had multiple machines at home for years. Back in the day those KVMs were great at saving me space on the desk. There was nothing worse then shuffling between keyboards and mice.

That delay between switching and having to double tap scroll lock and then an arrow key, has been replaced with a tiny deamon and a simple client that uses the network to share 1 keyboard and 1 mouse. Giving you simultaneous access to your machines.

I can move through screens fluently from left to right; up and down. You can have the same setup they have in the Matrix without paying for a few multi monitor video cards and trying to stuff them all into one machine.

Synergy even allows for clipboard sharing. So you can copy and paste from one machine to the other. My laptop keyboard and trackpad rarely sees action unless I am on the road.

Check out there site on SourceForge or give the above link a click.

A co-worker of mine ran into this today.

If you get this error when trying to load your CFEclipse perspective:

problems opening perspective 'org.cfeclipse.cfml.perspective.CFML'

Apparently, you need at least version 1.5 of the Java Runtime Environment. Chances are you are running version 1.4.

Download and install the latest JRE from java.com.