JMF and audio encryption

Hello,
I have successfully compiled and run a JMF program to transmit/receive RTP streams by re-using example programs in the API guide.
I am fairly new in this area. I would like to figure out how audio encryption works. Can someone point me to somewhere where I can give a head start on this? I guess first thing I want to understand what is the general approach to the encryption in RTP. Do I have to create a custom AudioFormat so that only my program play it?
Or is it possible to encrypt the default packets using some key and encryption algorithm? The picture in my mind is that once audio is captured and ready to be transmitted over, I would like call some method which encrypts the packets and hence once receiver receives the packets, it first decrypts the packets and then does whatever it supposed to do..
Any help, pointer, example code is appreciated.
Thanks!

Thanks for the answer.
Looking at the example at the link you provided, AVTransmit3.java is pretty similar to what I have in the program.
As far I can see write() method, in RTPSocketAdapter.java, does the actual data transfer in this example. However, in my program, start() in AVTransmit.java is called do start the tranmission. In start () method, processor.start() is called. Here is the code for that:
     * Starts the transmission. Returns null if transmission started ok.
     * Otherwise it returns a string with the reason why the setup failed.
    public synchronized String start() {
        String result;
        // Create a processor for the specified media locator
        // and program it to output JPEG/RTP
        result = createProcessor();
        if (result != null)
            return result;
        // Create an RTP session to transmit the output of the
        // processor to the specified IP address and port no.
        result = createTransmitter();
        if (result != null) {
            processor.close();
            processor = null;
            return result;
        // Start the transmission
        processor.start();
        return null;
    }Could I do what I want in a simple way without using sockets? Could I modify createTransmitter() to achieve this?
Would it be possible to encrypt dataOutput before caaling createSendStream? Or does it not even make sense?
sendStream = rtpMgrs.createSendStream(dataOutput, i);
    private String createTransmitter() {
        // Cheated.  Should have checked the type.
        PushBufferDataSource pbds = (PushBufferDataSource)dataOutput;
        PushBufferStream pbss[] = pbds.getStreams();
        rtpMgrs = new SessionManager[pbss.length];
        SessionAddress localAddr, destAddr;
        InetAddress ipAddr;
        SendStream sendStream;
        int port;
        SourceDescription srcDesList[];
        for (int i = 0; i < pbss.length; i++) {
            try {
                rtpMgrs[i] = new RTPSessionMgr();          
                srcDesList = new SourceDescription[] {
                    new SourceDescription(
                                        SourceDescription.SOURCE_DESC_EMAIL,
                                        "[email protected]",
                                        1,
                                        false),
                    new  SourceDescription(SourceDescription.SOURCE_DESC_CNAME,
                                        rtpMgrs.generateCNAME(),
1,
false),
new SourceDescription(SourceDescription.SOURCE_DESC_TOOL,
"JMF RTP Player v2.0",
1,
false),
localAddr = new SessionAddress();
port = portBase + 2*i;
ipAddr = InetAddress.getByName(ipAddress);
destAddr = new SessionAddress(ipAddr, port,
ipAddr, port + 1);
rtpMgrs[i].initSession(localAddr, srcDesList, 0.05, 0.25);
rtpMgrs[i].startSession(destAddr, 1, null);
temp = "Started transmission channel at " + ipAddress + " " + port + "\n";
MyApp.DisplayMess(temp);
//System.err.println("Created RTP session: " + ipAddress + " " + port);
sendStream = rtpMgrs[i].createSendStream(dataOutput, i);
sendStream.start();
} catch (Exception e) {
return e.getMessage();
Thanks very much again!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Are the Facetime Video and Audio encrypted between users?

    Are the Facetime Video and Audio encrypted between users?

    I don't know the answer but I hope someone who does will respond. I know Skype is encrypted and I know Google talk is not. I am a psychotherapist, and I use webcam to conduct therapy occasonally, and naturally, I need an encrypted audio/video to help maintain client confidentiality. I would love to use FaceTime. Despite some on this forum, I use it with Lion and I have less problems with FaceTime than I do Skype. But I can't use it for my clients until I know for sure that it is encrypted. Anyone out there with a knowledgable answer for both Cephsaiii and me?

  • Problems with JMF and audio files.

    Sofware:
    Java Version 1.5.0_03
    JMF Version 2.1.1e
    Windows XP SP2
    I have a application that consists of 2 parts. The first is an editor for creating exercises, like multiple-choice, matching and so on. The second part is a &#8220;client&#8221;, used to solve the exercises. The client uses Java Webstart.
    When I include audio clips in the exercises they play just fine using the client, but in the editor program I just get a clicking sound, and then the application stops responding.
    The strange part is that the editor and client use the exact same code to playback audio clips.
    The old version of the editor (developed for Java 1.3.x) works just fine under Java 1.3.x, but when the same byte-code is launched under Java 1.5 I get the same problem (clicking sound and then the application stops responding).
    Any suggestions?

    When installing JMF, two new packages are stored in the jre\lib\ext folder : jmf.jar and sound.jar.
    Sound.jar contains the same api that are in the packages sound.midi and sound sampled contained in jre.
    Maybe these new api are an improved version but i noticed some trouble playing sound and i delete sound.jar file, now it works fine.
    Try this, maybe you had the same problem.

  • JMF and audio streams

    Hi all,
    I am writing an application that reads an audio stream and performs some analysis on the audio samples (e.g. detection of dtmf tones). I'd like to be able to write some code that works both on streams from files and from RTP connections (in order to easily write test classes). I made a little test program that reads a wav file with javasound and does some audio analysis.
    public static void main(String[] args)
       AudioInputStream sound = AudioSystem.getAudioInputStream(new File(args[0]));
       int length = (int) sound.getFrameLength();
       for(int i=0; i<length; i++)
          byte[] sample = new byte[2];
          int res = in.read(sample, 0, sample.length);
          if(res != sample.length)
             throw new RuntimeException(
                "Couldn't read a 2 bytes sample from audio stream.");
          if(!in.getFormat().isBigEndian())
             byte tmp = sample[0];
             sample[0] = sample[1];
             sample[1] = tmp;
          DataInputStream ds = new DataInputStream(
             new ByteArrayInputStream(sample));
          goertzel(ds.readShort());
    }Now, I tried to do the same using JMF but I failed. More specific in JMF:
    1) How can I get informations about the stream I'm reading? (e.g. all infos I can get from AudioInputStream's getFormat() method)
    2) Is there a way to get a stream from a DataSource and determine at runtime if the stream is in a particular format I'm expecting, WITHOUT bothering if it is coming form RTP, audio file or something else?
    3) Eventually, Is it hard to use the stream I'm reading to create a new DataSource that some other component will use?

    Sorry but.. I don't know which is the appropriate subclass: I can't find it. I guess you missed "instanceof" in Java 101, eh?
    Moreover I'd like to find a class that is not something like "RTPStream" or "AudioFileInputStream" but something representing just the audio stream itself.There are ways you can get access to the raw data as it flows through the system, but as far as I know, there's no way of gaining random access to the audio stream itself...
    Note that a solution could be to use javasound AudioInputStream class and a simple java rtp library. I could implement my Audio analysis methods in order to work on "abstract streams" (given a particular audio format), then write a test class that work with audio files and a real application that gets input streams from RTP connections.
    I just want to know whether JMF allows me do do that or not?It'd be relatively simple to use JMF to receive an RTP stream and "export" it to JavaSound... you'd just need to write a custom DataSink.

  • Javafx use jmf and capture audio device

    Hello, I noticed a problem with the use JavaFX and Java Media Framework (JMF), in a project javafx call Java classes using JMF, but are not recognized PC audio devices, in fact when I executed 's the code CaptureDeviceManager.getDeviceList (null), displays the error: "could not commit protocolPRefixList", without recognizing any audio device. Instead I call if my application using JMF, outside of a JavaFX project, the devices are found and everything works properly, perhaps this problem depends on the security settings of JavaFX, or inability to use JavaFX is that jmf interfaces with audio and video devices?
    thanks for the help

    I'd use jmf and javafx but it was not for capture devices.
    If you use jmf there are native libraries.
    The thing i found was about the java.library.path wich is overriden when you start javafx that jmf can't load approriate libs.
    Try to compare the System.getProperties for java and javafx then you should find where is the problem.

  • Not able to recognize any video/audio devices using jmf and java soun

    Hi ,
    I need one help from your side.
    Here I am expecting some clarifications from you. Before that let you my environement.
    My working environment :
    Eclipse tool and added jmf jar to my project I did not do any thing more.
    If any thing I need to do just let me know. My target platform is MAC & UBUNTU.
    Please bare with my questions.
    1) I am not able to recognize any video/audio devices using jmf and java sound APIs on My system.
    ( I checked with the app mentioned in the http://www.java-forums.org/new-java/11201-jmf-cannot-connect-device.html )
    Do we need any administrives rights for our working PC.
    What is the procedure/ setup I need to follow from a java application to enable particular audio/video device since I dont about end-user system setup right.
    If possible send some sample code to recognize /r detect audio device ( voice input ). It should run on both MAC and UBUNTU.
    2) I run the one sample audio recording application of this link (http://www.jsresources.org/examples/SimpleAudioRecorder.java.html) which is provided by YOU.
    I got output audio file and able to hear voice on UBUNTU system but not able to hear voice on MAC system.
    I heared that default line in ( audio setup of the sys) is wont take any voice data on MAC.Why I made this stmt means we are getting false when using isSupported methods of JAVA SOUND API.
    ( like for TragetdataLine ...i,e, all ports are getting false)
    I have one sample audio recording app implemented by QUICKTIME API. In this case also he taking audio ftom device only using quicetime API.
    With that we are able to record and hear audio ( voice input --> not line in , external device we added some thing like SSB...)
    3) In case of Video capturing DataSource, Streams are implemented by PullBufferDataSource , PullBufferStream intefaces used.
    In case of Audio capturing DataSource, Streams are implemented by PushBufferDataSource, PushBufferStream intefaces used.
    Can you explain the reasons ? I gone through API but i am not clear.
    HOPE I WILL BE CLARIFIED EVERY THING FROM YOU.
    Thanks
    RamaRao.G

    Hi ,
    I need one help from your side.
    Here I am expecting some clarifications from you. Before that let you my environement.
    My working environment :
    Eclipse tool and added jmf jar to my project I did not do any thing more.
    If any thing I need to do just let me know. My target platform is MAC & UBUNTU.
    Please bare with my questions.
    1) I am not able to recognize any video/audio devices using jmf and java sound APIs on My system.
    ( I checked with the app mentioned in the http://www.java-forums.org/new-java/11201-jmf-cannot-connect-device.html )
    Do we need any administrives rights for our working PC.
    What is the procedure/ setup I need to follow from a java application to enable particular audio/video device since I dont about end-user system setup right.
    If possible send some sample code to recognize /r detect audio device ( voice input ). It should run on both MAC and UBUNTU.
    2) I run the one sample audio recording application of this link (http://www.jsresources.org/examples/SimpleAudioRecorder.java.html) which is provided by YOU.
    I got output audio file and able to hear voice on UBUNTU system but not able to hear voice on MAC system.
    I heared that default line in ( audio setup of the sys) is wont take any voice data on MAC.Why I made this stmt means we are getting false when using isSupported methods of JAVA SOUND API.
    ( like for TragetdataLine ...i,e, all ports are getting false)
    I have one sample audio recording app implemented by QUICKTIME API. In this case also he taking audio ftom device only using quicetime API.
    With that we are able to record and hear audio ( voice input --> not line in , external device we added some thing like SSB...)
    3) In case of Video capturing DataSource, Streams are implemented by PullBufferDataSource , PullBufferStream intefaces used.
    In case of Audio capturing DataSource, Streams are implemented by PushBufferDataSource, PushBufferStream intefaces used.
    Can you explain the reasons ? I gone through API but i am not clear.
    HOPE I WILL BE CLARIFIED EVERY THING FROM YOU.
    Thanks
    RamaRao.G

  • JMF Video and Audio

    I am working on AVTransmit and AVReceive trying to make them both transmit and receive audio and video at the same time. I cant seem to be able to at least get video and audio sent over a LAN similtaneously. How should i manage the original AVTransmit and Receive in order to do what i just said above? please give me some hints, and if someone is kind enough to give me directions, i would appreciate it.
    I am new at JMF, and having difficulties understanding how it all works.
    Currently working on my final year project, have a few month left before deadline, so ,please help me.
    Cheers guys.
    Chris

    First of all, you can't open two times the same port on the same computer.
    - If you have different sources (i.e. audio.mp3 and video.mpg) you must use two different ports, like 20000 and 20002. AVReceive can then start for you two players doing something like that:
    java AVReceive2 x.y.z.k/20000/1 x.y.z.k/20002/1
    - If you have only one file to send which contains both audio and video, then there are two alternatives: (1) you send across two different sessions (AVTransmit2 does this automatically; the first session is on the port you told the program to use, the second session is baseport+2 (20000 and 20002, in out example)).
    (2) you must use MERGED DATASOURCES, but here, I'm sorry I don't know how to help...

  • Does JMF support audio PCMA or PCMU codec?

    Hi experts,
    The first thing I must say that I'm really not good at audio/video/codec field, so I'm not sure I can use the term exactly. Please correct me if any mistakes.
    I use JMF and make a desktop application to record my voice, and packetize to RTP packet formatted with ULAW_RTP, GSM_RTP or Gxxx_RTP before sending them to my other android application. My Android app supports two codecs - PCMA and PCMU, and it cannot understand those packets sent from the desktop one.
    So I wonder if I can use JMF to create RTP packet which is understandable for Android. Does anyone experience on this problem?
    Thanks,
    H
    Edited by: 866652 on Jun 17, 2011 8:56 AM
    I must correct something after reading several lovely complains of Andrew Thompson :-)

    hoangtuansu wrote:
    their payloadtype's value is the same, in this case is 0. But Android can not undersatnd it, and in addition, their ULAW packet's size is also different, from Android -> PC (PC can understand) is 172 but the one from PC->Android is 492 (???). Things like sample rate, sample size, number of channels, etc will affect the packet size. Additionally, mobile devices may very well have a lower MTU than a normal machine, so that can affect it too.
    Even then, there's nothing saying how big an RTP packet should be, how many encoded samples it should hold, etc. So it could be a simple as the PC packing more data per packet.
    Most likelly the issue is that Android is 0-4 years old, whereas JMF is 12 years old... so it's almost definately using different versions of the RTP standard.

  • Changing Video and Audio Formats

    Hi
    Can I use JMF to convert videos and audio from one format to another?
    Regards,
    N�stor Bosc�n

    Yes you can, I'm struggling to do just than, with audio captured from a mic to mp3 file, and also from mp3 file to wav file.
    Message was edited by:
    MuadDib

  • Displaying a .gif image and audio in java

    Hi all I need a simple working example that shows how to have Java show a .gif image. I have done several searches but everyone over complicates it and makes in not understandable. I just want a super simple way of displaying an image in java.
    I also need to know how to play an audio clip through java.
    Your help is much appreciated as I have been banging my head for hours now

    Download and install JMF for audio and vedeo clips. JMF is freely available.
    To display an image which is not a difficult task, just tell where you want to display an image.
    regards

  • How to combine rtp data containing video and audio?

    Hi
    I have a problem. I was examining with AVTransmit3.java and AVReceive3.java. I found that AVTransmit3 sending video and audio with different ports. It's okey as it is done as JMStudio. but my question is how can I receive this packets as raw bytes and combines them into one media file to play at a time in a player. May be very fundamental question but tough for me as i m novis as jmf programmer.
    waitin for repply...................

    Look in the JMF Guide regarding multiplexors and demultiplexors. It give the whole breakdown of how this works (and I think examples).

  • How can synchronize video and audio?? (Help me!!)

    I was writen a Client/Server program, but in Client's part Video and Audio doesn't not synchronize thought i was used method in 2.0 programer guide (use Player control Controller). Any one can help me??

    http://java.sun.com/products/java-media/jmf/1.0/guide/JavaMediaFrame.fm7.html

  • Creating Video with single Image and Audio

    Hi All,
    My requirement is to pass an Image and audio and the expected out put is a like a video which shows the image and plays the background. Can it done in JMF if so how can it be done? Thanks.

    Hi,
    I am also trying to do almost the same thing using the JpegToMovieConverter, however I am facing a problem.
    Objective: To create a video file which will include the output from webcam and my mic. Also, there are some images. Whenever the user selects an image, then instead of the webcam video, that image should be shown until it is unselected or the user selects some other image.
    Problem: I have implemented the mic and webcam streams but
    1. I dont understand how would I create a stream from my image, given that the length of stream should be as long as the image is selected.
    2. Also, how would I merge the three stream so that the images' stream overwrites the webcam's video stream.
    Thank you.

  • Sync of Video and Audio streams

    I got a main project to make a video conferance system. And i'm not sure how to sync the video and Audio streams. (Audio need to have higher priority than video)
    Video is all moust real-time but audio is around 0.5 sec delay at the fastest.
    I realy need to find out how to sync them since its one of my main subjects in the project.
    So if anyone know how to, plz let me know.

    Hello,
    I try to implement a videoconference in Java with JMF. At the reception, audio and vid�o aren't synchronizing. I'm looking for a solution to resolve this problem because i think in this kind of application, audio and video tracks must be synchronized. I'd like to know when and how can i do the synchronization : at the capture, before transmission, or at the reception ?

  • Hello All... Back after a brief absence, things look a little bit different. I'm trying to take a 16 minute mini dv video and compress it for use on the web. I'm interested in any suggestions you may have on settings for the video and audio tracks. I'v

    Hello All...
    Back after a brief absence, things look a little bit different.
    I'm trying to take a 16 minute mini dv video and compress it for use on the web. I'm interested in any suggestions you may have on settings for the video and audio tracks. I've tried using Sorenson 3 (15 frames, key frames set to automatic, 320 x 240) for video and IMA 4:1 (mono) for audio. The resulting video looked great but the file size came in at about 255 Mb.
    Thanks!
    PowerMac G5 1.8 Dual   Mac OS X (10.4.3)  
    Message was edited by: Dan Foley

    Thank you for the replies.  Everyone was correct about the jack, interface, and phasing problems.  I have been unplugging my motu audio interface and then using headphones at work.  I have not changed any detailed audio output settings in logic.  When I read that the jack might be a problem I tried switching headphones.  This actually helped.  I am using dre-beats headphones and they seem to be having issues with the mac/jack-(the phasing/panning problems.  I can use these headphones with other devices but not the mac.  I have to use ipod ear buds and the phasing seems fixed.  Hopefully this information is helpful to someone else. 
    If anyone knows how to correct this issue please let me know its difficult to know what my final mixes are going to sound like and I have had to keep bouncing everything into i-tunes- sync to ipod and then listen in my car radio. 

Maybe you are looking for