public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Jelle De Loecker <skerit@kipdola.com>
To: linux-dvb@linuxtv.org
Subject: [linux-dvb] Extracting video stream
Date: Thu, 29 Jan 2009 14:03:54 +0100	[thread overview]
Message-ID: <4981A93A.7080909@kipdola.com> (raw)

Hi everyone,

This is not a real -dvb question, but -media seemed too official.

A device of mine is serving a video stream on a certain port, (Hawking 
HNC210, video surveillance cam)
unfortunately it uses its own (very simple) protocol: it's a bunch of 
jpegs in a row.

I have this script that checks the stream every second and creates a 
jpeg out of it,
but I really want a continuous video stream. Is there a way to do this?

This is the script:

#!/usr/bin/perl
use IO::Socket;
#SET WHERE CAMERA IS
$sock = new IO::Socket::INET (PeerAddr => '10.11.0.101',
                                PeerPort => 4321,
                                Proto    => 'tcp',
                                Timeout  => 1);
#do it again forever
while (1){
#sleep timeout (this value give us 1fps)
select(undef, undef, undef, 0.5);

$sock->send("0110\n");
$sock->read($size, 2);
$sock->read($j1, 1);
$sock->read($j2, 1);
$j1=oct("0x".unpack("H*", $j1));
$j2=oct("0x".unpack("H*", $j2));
#print "J1_USERS:".$j1."\n";
#print "J2:".$j2."\n";
$size=oct("0x".unpack("H*", $size));
#print "SIZE:".$size."\n";
if ($size != 0) {
$sock->read($data, $size);
open OUTF, "> /var/www/hawking.jpg" or die "Can't open $outfile : $!";
print OUTF $data;
close OUTF;
}
}

Greetings,
Jelle De Loecker

_______________________________________________
linux-dvb users mailing list
For V4L/DVB development, please use instead linux-media@vger.kernel.org
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

             reply	other threads:[~2009-01-29 13:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29 13:03 Jelle De Loecker [this message]
2009-02-02 18:09 ` [linux-dvb] Extracting video stream BOUWSMA Barry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4981A93A.7080909@kipdola.com \
    --to=skerit@kipdola.com \
    --cc=linux-dvb@linuxtv.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox