Need help running Libjitsi examples - newbie


#1

I’m a newbie to jitsi and to streaming in general. I have separately used ice4j successfully to get a path between two agents. Now I’m trying to use libjitsi to send audio data. But no joy.

Steps

  1. Clone https://github.com/jitsi/libjitsi.git
  2. Import into Eclipse as a Maven project. Everything compiles fine.
  3. I eventually realized (by looking at the Ant buildfile) that I needed some native libs (I didn’t realize they were there in the project at first) so I downloaded the release 1071.zip from Github, unzipped it, and pointed the Eclipse run configuration at them with -Djava.library.path=/Users/Ken/java/libjitsi-1071/lib/native/linux-x86-64;/Users/Ken/java/libjitsi-1071/lib/native/linux-x86;/Users/Ken/java/libjitsi-1071/lib/native/darwin;/Users/Ken/java/libjitsi-1071/lib/native/win32-x86-64;/Users/Ken/java/libjitsi-1071/lib/native/win32-x86
  4. I am running AVTransmit2 with --local-port-base=5100 --remote-host=localhost --remote-port-base=5200 and AVReceive2 with --local-port-base=5200 --remote-host=localhost --remote-port-base=5100.

When I run either file, I get to this error:

WARNING: Failed to initialize org.jitsi.impl.neomedia.device.DirectShowSystem
java.lang.reflect.UndeclaredThrowableException
	at org.jitsi.impl.neomedia.device.DeviceSystem.invokeDeviceSystemInitialize(DeviceSystem.java:441)
	...
	at org.jitsi.service.libjitsi.LibJitsi.getMediaService(LibJitsi.java:124)
	at org.jitsi.examples.AVTransmit2.start(AVTransmit2.java:104)
	at org.jitsi.examples.AVTransmit2.main(AVTransmit2.java:359)
Caused by: java.lang.UnsatisfiedLinkError: org.jitsi.impl.neomedia.codec.FFmpeg.av_get_pix_fmt(Ljava/lang/String;)I
	at org.jitsi.impl.neomedia.codec.FFmpeg.av_get_pix_fmt(Native Method)
	...

and finally I get this nasty thing:

WARNING: Failed to initialize org.jitsi.impl.neomedia.device.DirectShowSystem
java.lang.reflect.UndeclaredThrowableException
	at org.jitsi.impl.neomedia.device.DeviceSystem.invokeDeviceSystemInitialize(DeviceSystem.java:441)
	at org.jitsi.impl.neomedia.device.DeviceSystem.invokeDeviceSystemInitialize(DeviceSystem.java:348)
	at org.jitsi.impl.neomedia.device.DeviceSystem.<init>(DeviceSystem.java:493)
	at org.jitsi.impl.neomedia.device.DeviceSystem.<init>(DeviceSystem.java:475)
	at org.jitsi.impl.neomedia.device.DirectShowSystem.<init>(DirectShowSystem.java:61)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at org.jitsi.impl.neomedia.device.DeviceSystem.initializeDeviceSystems(DeviceSystem.java:288)
	at org.jitsi.impl.neomedia.device.DeviceSystem.initializeDeviceSystems(DeviceSystem.java:230)
	at org.jitsi.impl.neomedia.MediaServiceImpl.getDevices(MediaServiceImpl.java:577)
	at org.jitsi.impl.neomedia.MediaServiceImpl.getDefaultDevice(MediaServiceImpl.java:500)
	at org.jitsi.examples.AVTransmit2.start(AVTransmit2.java:119)
	at org.jitsi.examples.AVTransmit2.main(AVTransmit2.java:359)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jitsi.impl.neomedia.jmfext.media.protocol.directshow.DataSource
	at org.jitsi.impl.neomedia.device.DirectShowSystem.doInitialize(DirectShowSystem.java:97)
	at org.jitsi.impl.neomedia.device.DeviceSystem.initialize(DeviceSystem.java:642)
	at org.jitsi.impl.neomedia.device.DeviceSystem$1.run(DeviceSystem.java:393)

Exception in thread "main" java.lang.IllegalArgumentException: direction
	at org.jitsi.service.neomedia.AbstractMediaStream.assertDirection(AbstractMediaStream.java:105)
	at org.jitsi.impl.neomedia.MediaStreamImpl.setDirection(MediaStreamImpl.java:2831)
	at org.jitsi.examples.AVTransmit2.start(AVTransmit2.java:128)
	at org.jitsi.examples.AVTransmit2.main(AVTransmit2.java:359)

Since I saw “ffmpeg” in the unsatisfied link error, I tried downloading ffmpeg from https://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-4.1-win64-shared.zip. I chose the “shared” one because it has DLLs that I thought were needed to link the JNI interfaces to. I added the bin folder of the ffmpeg installtion to the java.library.path, but no joy - same error.

From the error stack, I’m guessing that somehow I’m missing some native libraries that are needed for DirectShow, but I cannot figure out what they should be.

Could anyone help me get this demo running.