Alex Rivera | Logout

How to capture video using JMF, but without installing JMF

Asked 2010-10-28T19:48:10.633
14

A videoconferencing project I was working on used JMF to capture video and audio, and transmit it to another endpoint. An issue was that my team didn't want the user of the product to have to install JMF.

I thought it might be worthwhile to share our solution to this problem. It works. It works well. My question to you is: does anyone have a better way to do it?

Environment: Windows, XP and above

  1. Download JMF for Windows
  2. Install it on your machine

  3. Locate the following dlls in the system32 folder after jmf installs:

    jmacm.dll
    jmam.dll
    jmcvid.dll
    jmdaud.dll
    jmdaudc.dll
    jmddraw.dll
    jmfjawt.dll
    jmg723.dll
    jmgdi.dll
    jmgsm.dll
    jmh261.dll
    jmh263enc.dll
    jmjpeg.dll
    jmmci.dll
    jmmpa.dll
    jmmpegv.dll
    jmutil.dll
    jmvcm.dll
    jmvfw.dll
    jmvh263.dll
    jsound.dll

  4. Copy the dlls into a temporary folder

  5. Locate the jmf.properties file (Do a search on your computer for it)
  6. Download the JMF source code
    In the source code, find the following files:

JMFinit.java
JMRPropertiesGen.java
Registry.java
RegistryGen.java

  1. Create a package; I'll call it JMFNoInstall
  2. Add the files listed in step 6
  3. Add a class called Main to this package as such:

 

package JMFNoInstall;
// add your imports and whatnot here
public class Main()
{
    public Main()
    {
        JMFinit.main(null);
        JMFPropertiesGen.main(null);
        Registry.main(null);
        RegistryGen.main(new String[] {
            new File(".").getAbsolutePath(),
            "registrylib"
        });
    }
}

The jmf.properties file needs to go in the same folder as the class that has your main method or the same folder as the JAR archive that contains the main

Edit
Report

1 Answer

4

I don't think there is a better way. Unless the DLLs are explicitly loaded by path name, you would just need to make sure they are in the system path, so if they lived right next to the JVM executables it should also work. Windows does implicitly include the directory the program was started from in the system path, so that is another potential location.

Installers are a double edged sword, they make it easy to add new functionality and remove it later, but they also make it harder to deploy solutions that use the product.

One of the nice things about Java in general is that you don't have to install it for it to work. Essentially, once you perform the install of the JRE on one system, you can bundle it up and use it on another system as a zip file. Java doesn't need to explicitly register the DLLs because it loads them dynamically as needed.

answered 2010-12-10T17:19:11.380

Your Answer