Video streaming using Jingle library

Programming Add comments

We’ve implemented the Smack API provided by Ignite Realtime which integrates a Java version of Google’s C++ Jingle library. The audio sessions over XMPP works almost out of the box using Jingle. As we needed video integration in one of our university project, we considered developing additional classes to support video format. After some nice hours of coding, we now have successfully accomplished this duty and we can post the source here with informations on how to get video working.

So here are the general steps to take to get a video session established between two parties. Please note that the way the libraries do not currently allow a simultaneous video and audio session. We might work on that in the next days.

1 - You need a XMPP server. Unfortunately, there are some differences in the Jingle integration of Google and Ignite Realtime. While we are able to connect to the GTalk server using Smack API, it is not possible to directly use Smack’s Jingle to create audio-video sessions with other GTalk users. The best thing is to use Ignitime Realtime’s Openfire application.

2 - Create users and add manage their rosters. Once the server is up, add several users via the web administration interface (http://localhost:9090). Then, the best thing is to use a XMPP client such as Ignite Realtime’s Spark application and add the users you want to be able to communicate with.

3 - Open Eclipse and get projects to compile. While this can seem quite easy for some people, it can be very painful for others. You will need 2 projects in your Eclipse workspace: the Jingle project available from a subdirectory in the Smack library and the project provided here. Both projects need a reference to smack.jar and smackx.jar. Jingle will also need to have all the jars in it’s /lib and /build/merge.

4 - Install JMF (link), open the JMF registry editor application once the installation complete. You will then have to hit detect devices to have any usb webcam found. Unfortunately for mac users, it seems like the iSight camera doesn’t get detected by the application. We have used a regular USB logitech camera for our successful tests.

5 - You will need two computers, one to act as a client and one as a server. The AVManager class has can be run has an application. The server waits for an XMPP Jingle session request while the client immediately tries to establish a connection with the first available contact on it’s roster.

Download files:
Video Jinglle Library
replace your /jingle/source/org/jivesoftware/smackx/jingle/mediaimpl/jmf
from the Smack’s 3.0.4+ source code.

CommClient project

9 Responses to “Video streaming using Jingle library”

  1. Adam Nemeth Says:

    As far as I know, on Mac, QT java library is used by Smack, but of course, it should be asked on igniterealtime.org, Jive guys know better the answer than me.

    Generally, JMF isn’t always a good choice over QT as some says.

  2. Thiago Says:

    Nice work guys!
    In the next month we will update smack to support audio and another content in the same session.

    The necessary changes in Openfire will come after.

    Cheers,
    Thiago

  3. J Says:

    Any sign of C++ version by any chance?

    regards

  4. mm Says:

    Hi, what is mainpackage.Communication? (used in AVManager.java)

    Regards,

  5. Earlence Says:

    Hi,

    You mentioned in your blog that you were able to stream audio using the smack implementation of Jingle. Could you mail me the details on how you accomplished that?

    Cheers,
    Earlence Fernandes ( earlenceferns@gmail.com )

  6. Carrie Says:

    Great ! I will add this to my bookmarks. TY

  7. Nuwansam Says:

    Hi,
    Thanks for the nice work. one question. does this work with gtalk. (can i use this to develop an app which will enable video chat with gtalk users)

  8. Skaber Says:

    I’ve worked with this API 3 years ago and don’t recall if we were able to use the Smack API with the Google Talk servers. I don’t see why you wouldn’t be able to do such a thing thought.
    I’m pretty sure you’ll be able to stream video through Google Talk.

  9. am Says:

    hey there, im dying to try this, sounds like exactly what i was looking for ;) have u developed it to get audio and video in sync?

Leave a Reply