udp - perl - how do I capture a multicast [video] stream? -


i trying record multicast stream coming webcam, , record file. can access multicast stream , see video vlc, can't see when try play file i'm writing via perl.

here's code:

use strict; use warnings; use io::socket::multicast;  $group = shift @argv; $port  = shift @argv;  # set stream $stream = io::socket::multicast->new(proto=>'udp', localport => $port); $stream->mcast_add($group) or die "couldn't set group: $!\n";  # date , time. we'll use name stream file $fname = `date +%y-%m-%dt%h_%m_%s`; chomp $fname; $fname .= ".mpg";  open (my $file, ">", $fname)     or die "couldn't open file  $fname writing: $!"; binmode($file);  print "streaming $group:$port $fname!\n";  $i (0..500){     $data;     next unless $stream->recv($data,1024);     print "data received! $i \n";     print {$file} $data; } close ($file); 

wireshark shows protocol of stream mpeg ts.

i appreciate assistance!


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -