I
I
Ilya Zelikin2012-10-26 13:53:59
linux
Ilya Zelikin, 2012-10-26 13:53:59

/dev/video0 >> netcat >> motion - how?

There is a gigabit router with OpenWRT from USB, a UVC webcam is connected to it. It works verified.
When trying to do cat /dev/video0, it gives an error:
cat: read error: Invalid argument.
The device file itself is present, there are read rights.
Is it possible to somehow extract raw data from it and transfer it over the network without particularly loading the router's processor?
The task is to launch motion on a third-party server and feed it a stream from a camera connected to a router over the network.
If you run motion directly on the router, then it mercilessly loads the percent, it’s impossible.
I want to use netcat like this:
cat /dev/video0 | nc [server_IP] 5000
and on the server to accept It is
nc -l -p 5000
not clear 2 things:
firstly, cat hands on the camera
; secondly, how then on the server to feed the stream in motion
man v4l2 gave nothing intelligibly
As a result, the ultimate task is to reduce the load on the router's CPU to a minimum.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexey Zhurbitsky, 2012-10-26
@blo

I suggest looking to the side.

dd if=/dev/video0 of=/dev/stdout ...

U
ur3ckr, 2012-10-26
@ur3ckr

As an option, try mjpg-streamer
Perhaps it will suit your purposes (if you are interested in simple viewing)

S
Sergey Lerg, 2012-10-26
@Lerg

And the video is eventually captured on openwrt? If using ffmpeg to write to a file and then look at it?
You can write a simple program that opens a video device and sends data over the network (preferably UDP). True, I don’t know how much this is implemented on openwrt.

J
jcmvbkbc, 2012-10-26
@jcmvbkbc

I once wrote an article about capturing and transmitting images over the network, maybe it will help you: habrahabr.ru/post/66015/#habracut

V
Vladimir, 2012-10-28
@noonv

you can write it yourself with pens) there is nothing complicated;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question