kamaitachi - perl flash media server

YAPC::Asia 2009 Tokyo

Sep 11th, 2009

About me

kamaitachi

FMS

FMS

WebServices using FMS

Our works using FMS

shiritori-ring

http://shiritori-ring.jp/

Our works using FMS

こえ部

http://koebu.com/

provides online audio recorder

FMS implementations

All implementation sucks because it's not "Perl"

You should write ActionScript for Adobe's FMS

Java for red5

XML for wowza

Perl for kamaitachi

:)

with perl

kamaitachi supports

RPC

package Service::Echo;
use Moose;

extends 'Kamaitachi::Service';

with 'Kamaitachi::Service::AutoConnect';

sub on_invoke_echo {
    my ($self, $session, $req) = @_;
    $req->response(@{ $req->args });
}

__PACKAGE__->meta->make_immutable;
my $kamaitachi = Kamaitachi->new;

$kamaitachi->register_services(
    'rpc' => 'Service::Echo',
);

$kamaitachi->run;
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, status_handler);
nc.objectEncoding = ObjectEncoding.AMF0;
nc.connect("rtmp:/rpc");
// or
// nc.connect("rtmp://hostname/rpc");
nc.call("echo", new Responder(EchoResponseHandler), "foo bar");

Demo

RTMP Hacking tips

...

RTMP Hacking tips

...

RTMP Hacking tips

...

RTMP Hacking tips

Sniffer::RTMP

Packet sniffer for RTMP stream

http://github.com/typester/sniffer-rtmp-perl/

Sniffer::RTMP

Sniffer::RTMP->new(
    filter => "tcp port $port",
    device  => 'en1',
    callbacks => {
        notify => \&log_method,
        invoke => \&log_method,
        # ...
    },
)->run;

Demo

Demo (FW--)

Demo

sudo ./script/rtmp_flvdump.pl en1 ustream.flv

and open ustream live in your browser

(the script is bundled in Sniffer::RTMP)

Development

Future plan

Thank you!