RTSP-Client

 view release on metacpan or  search on metacpan

lib/RTSP/Client.pm  view on Meta::CPAN

package RTSP::Client;

use Moose;
use RTSP::Lite;
use Carp qw/croak/;

our $VERSION = '0.4';

=head1 NAME

RTSP::Client - High-level client for the Real-Time Streaming Protocol

=head1 SYNOPSIS

  use RTSP::Client;
  my $client = new RTSP::Client(
      port               => 554,
      client_port_range  => '6970-6971',
      transport_protocol => 'RTP/AVP;unicast',
      address            => '10.0.1.105',
      media_path         => '/mpeg4/media.amp',
  );
  
  # OR
  my $client = RTSP::Client->new_from_uri(uri => 'rtsp://10.0.1.105:554/mpeg4/media.amp');

  $client->open or die $!;
  
  my $sdp = $client->describe;
  my @allowed_public_methods = $client->options_public;

  $client->setup;
  $client->reset;
  
  $client->play;
  $client->pause;
  
  
  $client->teardown;
  
  
=head1 DESCRIPTION

This module provides a high-level interface for communicating with an RTSP server.
RTSP is a protocol for controlling streaming applications, it is not a media transport or a codec. 
It supports describing media streams and controlling playback, and that's about it.

In typical usage, you will open a connection to an RTSP server and send it the PLAY method. The server
will then stream the media at you on the client port range using the specified transport protocol.
You are responsible for listening on the client port range and handling the actual media data yourself,
actually receiving a media stream or decoding it is beyond the scope of RTSP and this module.

=head2 EXPORT

No namespace pollution here!

=head2 ATTRIBUTES

=over 4

=item session_id

RTSP session id. It will be set on a successful OPEN request and added to each subsequent request

=cut
has session_id => (
    is => 'rw',
    isa => 'Str',
);

=item client_port_range

Ports the client receives data on. Listening and receiving data is not handled by RTSP::Client

=cut
has client_port_range => (
    is => 'rw',
    isa => 'Str',
);

=item media_path

Path to the requested media stream

e.g. /mpeg4/media.amp

=cut
has media_path => (
    is => 'rw',
    isa => 'Str',
    default => sub { '/' },
);

=item transport_protocol

Requested transport protocol, RTP by default

=cut
has transport_protocol => (
    is => 'rw',
    isa => 'Str',
    default => sub { 'RTP/AVP;unicast' },
);

=item address



( run in 0.646 second using v1.01-cache-2.11-cpan-39bf76dae61 )