Skip to content

Commit

Permalink
more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
revmischa committed Jul 26, 2010
1 parent b56c414 commit b3d3469
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 16 deletions.
14 changes: 11 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,23 @@ To install this module type the following:
RUNNING

Simply fire up the included rtsp-server.pl application and it will
listen for clients on port 5454, and source streams on port 5455.
listen for clients on port 554 (standard RTSP port), and source
streams on port 5545.

To begin sending video, you can use any client which supports the
ANNOUNCE and RECORD RTSP methods, such as ffmpeg:

ffmpeg -i /input.avi -f rtsp rtsp://12.34.56.78:555/abc
ffmpeg -i /input.avi -f rtsp rtsp://12.34.56.78:5545/abc

You should then be able to play that stream with any decent media
player. Just point it at rtsp://12.34.56.78:554/abc
player. Just point it at rtsp://12.34.56.78/abc

If you don't want to run it as root, you may specify non-priviliged
ports with --clientport/-c and --sourceport/-s

COMING SOON:

Priv dropping, authentication, client encoder, stats, tests

DEPENDENCIES

Expand Down
37 changes: 26 additions & 11 deletions lib/RTSP/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ has 'client_listen_port' => (
has 'source_listen_port' => (
is => 'rw',
isa => 'Int',
default => '555',
default => '5545',
cmd_flag => 'serverport',
cmd_aliases => 's',
metaclass => 'MooseX::Getopt::Meta::Attribute',
Expand Down Expand Up @@ -187,22 +187,29 @@ sub build_logger {
);
}

1;
__PACKAGE__->meta->make_immutable;

__END__
=head1 NAME
RTSP::Server - Lightweight RTSP/RTP server. Like icecast, for video.
RTSP::Server - Lightweight RTSP/RTP server. Like icecast, for
audio/video streams.
=head1 SYNOPSIS
use AnyEvent;
use RTSP::Server;
# defaults:
my $srv = new RTSP::Server(
log_level => 2,
max_clients => 10,
log_level => 2, # 0 = no output, 5 = most verbose
max_clients => 100,
client_listen_port => 554,
source_listen_port => 5545,
rtp_start_port => 20000,
client_listen_address => '0.0.0.0',
source_listen_address => '0.0.0.0',
);
# listen and accept incoming connections asynchronously
Expand All @@ -219,16 +226,24 @@ RTSP::Server - Lightweight RTSP/RTP server. Like icecast, for video.
=head1 DESCRIPTION
This server is designed to enable to rebroadcasting of RTSP/RTP
streams to clients.
This server is designed to enable to rebroadcasting of RTP media
streams to clients, controlled by RTSP. Please see README for more
information.
=head2 EXPORT
=head1 USAGE
None by default.
After starting the server, stream sources may send an ANNOUNCE for a
desired mountpoint, followed by a RECORD request to begin streaming.
Clients can then connect on the client port at the same mountpoint and
send a PLAY request to receive the RTP data streamed from the source.
=head1 TODO
=head1 BUNDLED APPLICATIONS
Authentication, automated tests.
Includes rtsp-server.pl, which basically contains the synopsis.
=head2 COMING SOON
Priv dropping, authentication, client encoder, stats, tests
=head1 SEE ALSO
Expand Down
3 changes: 1 addition & 2 deletions rtsp-server.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
use AnyEvent;
use RTSP::Server;

# you may pass your own options in here or via command-line
my $srv = RTSP::Server->new_with_options(
max_clients => 10,
log_level => 4,
);

# listen and accept incoming connections
Expand Down

0 comments on commit b3d3469

Please sign in to comment.