Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7763775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:44:38+00:00 2026-06-01T14:44:38+00:00

I want to capture and stream audio using JMF 2.1.1e in RTP format. I

  • 0

I want to capture and stream audio using JMF 2.1.1e in RTP format. I wrote a simple transmitter, I can transmit and receive the audio. But when I saw in Wireshark, I saw the packets as UDP. Can anyone point me out the problem, please.

And here is my function responsible for audio capture and transmit.

public void captureAudio(){

    // Get the device list for ULAW
    Vector devices = captureDevices();

    CaptureDeviceInfo captureDeviceInfo = null;

    if (devices.size() > 0) {
         //get the first device from the list and cast it as CaptureDeviceInfo
         captureDeviceInfo = (CaptureDeviceInfo) devices.firstElement();
    }
    else {
        // exit if we could not find the relevant capturedevice.
        System.out.println("No such device found");
        System.exit(-1);
    }


    Processor processor = null;
    try {
        //Create a Processor for the specified media.
        processor = Manager.createProcessor(captureDeviceInfo.getLocator());
    } catch (IOException ex) {
        System.err.println(ex);
    } catch (NoProcessorException ex) {
        System.err.println(ex);
    }
    //Prepares the Processor to be programmed.
    //puts the Processor into the Configuring state.
    processor.configure();

    //Wait till the Processor configured.
    while (processor.getState() != Processor.Configured){
       try {
           Thread.sleep(100);
       } catch (InterruptedException e) {
           e.printStackTrace();
       }
   }


    //Sets the output content-type for this Processor
    processor.setContentDescriptor(CONTENT_DESCRIPTOR); 
    /** 
         ContentDescriptor CONTENT_DESCRIPTOR
                = new ContentDescriptor(ContentDescriptor.RAW_RTP); 
      */

    //Gets a TrackControl for each track in the media stream.
    TrackControl track[] = processor.getTrackControls();

    boolean encodingOk = false;

    //searching through tracks to get a supported audio format track.
    for (int i = 0; i < track.length; i++) {
        if (!encodingOk && track[i] instanceof FormatControl) {
            if (((FormatControl)
                    track[i]).setFormat( new AudioFormat(AudioFormat.ULAW_RTP, 8000, 8, 1) ) == null)
            {
               track[i].setEnabled(false);
            }
            else {
                encodingOk = true;
                track[i].setEnabled(encodingOk);
                System.out.println("enc: " + i);
            }
        } else {
            // we could not set this track to ULAW, so disable it
            track[i].setEnabled(false);
        }
    }

    //If we could set this track to ULAW we proceed
    if (encodingOk){            
        processor.realize();
        while (processor.getState() != Processor.Realized){
           try {
               Thread.sleep(100);
           } catch (InterruptedException e) {
               e.printStackTrace();
           }
        }

        DataSource dataSource = null;
        try {
            dataSource = processor.getDataOutput();
        } catch (NotRealizedError e) {
            e.printStackTrace();
        }

        try {

            String url= "rtp://192.168.1.99:49150/audio/1";
            MediaLocator m = new MediaLocator(url);
            DataSink d = Manager.createDataSink(dataSource, m);
            d.open();
            d.start();
            System.out.println("transmitting...");
            processor.start();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

And please ask, if you find anything improper or vague.
Thanks in advance. 🙂

Clarification: I have a peice of C# code for RTP streaming. And when I capture the data using wireshark, I can see them as RTP, but the problem is when I capture the data stream from JMF wireshark show them as UDP. And my question is, why?

I know the difference between UDP and RTP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:44:39+00:00Added an answer on June 1, 2026 at 2:44 pm

    If I understand your question correctly you want to know why the RTP packets are not recognised as RTP packets in wireshark. In my experience this can be the case if wireshark does not have enough information about the RTP session.

    For example: 1) if I sniff an RTP session that has been setup using RTSP or SIP and SDP, then wireshark will show detect RTP. 2) However in another application in which I was setting up the session using local SDP descriptions, the packets show up as UDP. In the second scenario wireshark sees the RTP packets but lacks the information to classify them as RTP. Since RTP usually sits on top of UDP and wireshark can classify UDP packets, they are classified as such.

    FYI, you can then select a packet from stream that you know is RTP, and select “Decode as”. Then select RTP from the protocol list for the appropriate stream (and RTCP for the other one if applicable), and then wireshark will show the packets as being RTP and you’ll be able to see the packet info.

    I’m not sure if this is the reason in your specific case, but perhaps there is a signaling difference between your JMF and your C# example? It sounds like you might be using SIP for the C# application, and nothing for the JMF one?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using vlc to capture a video and audio stream and display it
Using Python2.4 I want to capture output from a mysql command. One caveat is
I want to capture blocks (with an associated name), but without any change in
I want to capture The content of ImageView by using DrawingCache. I written the
I want to capture the stream desktop and send it (to a client) via
I want to use DirectShow.Net to capture the stream from a webcam. What type
I want to capture as a bitmap the system cursor on Windows OSes as
I want to capture the Ctrl - R or F5 shortcut on the browser
I want to capture the browser window/tab close event. I have tried the following
I want to capture text in an attribute within an XML tag. That is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.