Solved

Using Java to record RTP Streams to file

Posted on 2007-11-14
4
2,342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java mysql insert application 14 66
Eclipse for Java EE development 2 67
Java List 4 73
Pass multiple values or string arrays in java as a parameter 3 73
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Suggested Courses

739 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