Solved

Using Java to record RTP Streams to file

Posted on 2007-11-14
4
2,337 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

828 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