[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using Java to record RTP Streams to file

Posted on 2007-11-14
4
Medium Priority
?
2,364 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 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…
Suggested Courses

656 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