RTSP::Server(3pm)

πŸ“¦
version 0.06 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’… RTSP::Server πŸ’…

okay so bestie, you found the manual page for RTSP::Server β€” part of the User Contributed Perl Documentation. yes it's really called that. it's a whole thing. anyway, sit down, hydrate, and let me tell you about this little legend. 🫢


✨ NAME ✨

RTSP::Server β€” a lightweight RTSP/RTP server. it's giving... icecast, but for audio/video streams. πŸŽ€


✨ SYNOPSIS ✨

here's the whole vibe in code form, no cap:

use AnyEvent;
use RTSP::Server;

# defaults:
my $srv = new RTSP::Server(
    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
# (returns immediately)
$srv->listen;

# main loop
my $cv = AnyEvent->condvar;
# ...
$cv->recv;

undef $srv;  # when the server goes out of scope, all sockets will
             # be cleaned up

like. it's so clean?? the undef $srv moment when it goes out of scope and every socket gets cleaned up is genuinely iconic β€” self-care behavior fr fr. ✨


✨ DESCRIPTION ✨

so what does this thing DO. this server exists so you can rebroadcast RTP media streams out to clients, and you control the whole thing with RTSP. that's the whole plot. πŸ“‘

if you want the full lore, go read the README, it has more info. iykyk. πŸ’–


✨ USAGE ✨

okay so once the server is up and running, here's the flow bestie, pay attention πŸ“:

  1. stream sources can send an ANNOUNCE for whatever mountpoint they want 🌸
  2. then they follow up with a RECORD request to actually start streaming πŸ”₯
  3. after that, clients can connect on the client port at the same mountpoint πŸ‘‘
  4. and they send a PLAY request to receive the RTP data being streamed from the source πŸ¦‹

that's it. that's the whole handshake-to-streaming pipeline. slay. πŸ’…


✨ BUNDLED APPLICATIONS ✨

it ships with rtsp-server.pl, which basically just contains the synopsis. yeah. it IS the synopsis. we love a low-effort king. πŸ‘‘

🧚 COMING SOON 🧚

the future features, manifesting as we speak:

  • Priv dropping
  • authentication
  • client encoder
  • stats
  • tests

not me being excited for all of these. πŸ™ˆ


✨ SEE ALSO ✨

go bother these queens when you're done here πŸ’œ:

  • RTSP::Proxy
  • RTSP::Client
  • AnyEvent::Socket

✨ AUTHOR ✨

Mischa Spiegelmock, <revmischa@cpan.org> β€” thank you for your service πŸ«‘πŸ’–


Copyright (C) 2010 by Mischa Spiegelmock

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.


and that's the whole page bestie!! πŸ’– this was documented with perl v5.38.2 and dated 2024-05-15, so if you're reading this in some distant future era, that's when the lore was last updated. stay hydrated, stream responsibly, and remember β€” when the server goes out of scope, everything gets cleaned up. we should all be so lucky. βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from