Create connection to theserver and send requests

Posted on 2005-03-23
Medium Priority
Last Modified: 2008-03-03
I need to do implement simple rtsp requests

1. Create connection to the server (
2. send "Describe" request
                DESCRIBE rtsp:// RTSP/1.0
2. send "Setup" request
                SETUP rtsp:// RTSP/1.0
2. send "Play" request
                PLAY rtsp:// RTSP/1.0

How can I do this in simple way ,if it possible ,
Question by:Inga_dusha
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
LVL 84

Accepted Solution

ozo earned 400 total points
ID: 13609760
use IO::Socket::INET;
use strict;
my $socket = IO::Socket::INET->new( '') or die "Can't create socket $!";
print $socket "DESCRIBE rtsp:// RTSP/1.0\n";
print $socket "SETUP rtsp:// RTSP/1.0\n";
print $socket "PLAY rtsp:// RTSP/1.0\n";


Author Comment

ID: 13609840
to manav_mathur  ,

I know about this module ,but I didn't understand how it works ,
no example ,and I tryed some requests ,it didn'w work .

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 13619964

maybe you know ,after I send this commands ,
my client close the connection .I see this in Ethereal (FIN,ACK) ,and doesn't wait for the answer.

How can I make to my program wait for the anser and not close the the connection  

Thanks for help.
LVL 18

Expert Comment

ID: 13626044
Net::RTSP looks like a good implementation of the protocol, and I doubt it will be easier to rewrite it yourself.
I do agree, however, that the documentation is severely lacking. Then again, it's only version 0.20.

In any case, it looks like it should get you started fairly quickly.

    # untested code

    $rtsp = new Net::RTSP(Interface => 'Procedural');
    # $presentation is a Net::RTSP::Presentation object
    $presentation = $rtsp->initialize('rtsp://');

    # send describe request
    $desc = $presentation->describe;

    # $desc is a RTSP::Response object
    # just showing you some of the methods
    print $desc->code, $desc->description, $desc->content if $desc->is_ok;

    # $session is a Net::RTSP::Session object
    # this sends a setup request
    $session = $presentation->setup_session;

    # send play request
    # returns another RTSP::Response object
    $play = $session->play;

    # or
    # $record = $session->record;

Author Comment

ID: 13630165
to kandura

this module doesn't work ,I tryed a lot of times ,

what I need is to continue listen and not close the connection ,how can I make it ?
LVL 18

Expert Comment

ID: 13632070
use IO::Socket::INET;
use strict;
my $socket = IO::Socket::INET->new( '') or die "Can't create socket $!";
print $socket "DESCRIBE rtsp:// RTSP/1.0\n";
print $socket->getlines();

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

765 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