Solved

Using Java to record RTP Streams to file

Posted on 2007-11-14
4
2,330 Views
Last Modified: 2013-11-23
I am looking for a way to record RTP streams using Java. I am not an experienced Java programmer, mostly .net. I have been looking at the AvReceive2.java program and it works well for receiving RTP streams however, I cannot see a way for recording that stream into a file. Can anyone advise?

phodat
0
Comment
Question by:pHOdAT
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 20279142
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 20279186
I think here is a complete working solution for the same

http://forum.java.sun.com/thread.jspa?threadID=649762&messageID=3822599
0
 
LVL 5

Accepted Solution

by:
deeppra earned 500 total points
ID: 20279321
Below is a program to store RTP stream from network to a file

 public void update(ReceiveStreamEvent event) {
         // find the source session manager for this event
         SessionManager source = (SessionManager)event.getSource();
       
         // create a filewriter datasink if a new ReceiveStream
         // is detected
         if (event instanceof NewReceiveStreamEvent) {
             String cname = "Java Media Player";
             ReceiveStream stream = null;
             
             try {
                 // get the ReceiveStream
                 stream =((NewReceiveStreamEvent)event)
                         .getReceiveStream();
 
                 Participant part = stream.getParticipant();
 
                 // get the ReceiveStream datasource
                 DataSource dsource = stream.getDataSource();
 
                 // hand this datasource over to a file datasink
                 MediaLocator f = new MediaLocator("file://foo.au");
 
                 Manager.createDataSink(dsource, f);    
             } catch (Exception e) {
                 System.err.println("newReceiveStreamEvent exception " 
                                    + e.getMessage());
                 return;
             }
         }
     }

for more information u can see this tutorial
http://72.5.124.55/products/java-media/jmf/2.1.1/guide/RTPExporting.html
0
 

Author Closing Comment

by:pHOdAT
ID: 31409166
Thanks for the info I couldn't find a code example to save myself and this is exactly what I needed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now