LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Watching remote webcam over piping and SSH? (https://www.linuxquestions.org/questions/linux-general-1/watching-remote-webcam-over-piping-and-ssh-4175518483/)

Xeratul 09-13-2014 02:55 PM

Watching remote webcam over piping and SSH?
 
Hello,

I am trying to watch a remote/distant webcam from /dev/video1 over piping and ssh. I logged onto SSH to the distant pc and try to send it to my remote X11 machine. 2 debian boxes on local network.

This is not working:

mplayer -zoom -fs -tv device=/dev/video1 tv:// - | ssh -l username 192.168.1.120 -C mplayer -


my local pc is : username192.168.1.120

dd if=/dev/video1 | ssh username192.168.1.120 -C mplayer tv:// -




ok, lets try to ffmpeg stream:
Code:

  ffmpeg  -r 5 -s 320x240 -f video4linux2 -i /dev/video1 -itsoffset  -6 http://127.0.0.1:8090/feed1.ffm
RESULTS IN :
Code:

x821e800] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2, from '/dev/video1':
  Duration: N/A, start: 2696.694139, bitrate: 18432 kb/s
    Stream #0.0: Video: rawvideo, yuyv422, 320x240, 18432 kb/s, 15 tbr, 1000k tbn, 15 tbc
[tcp @ 0x821f060] TCP connection to 127.0.0.1:8090 failed: Connection refused
http://127.0.0.1:8090/feed1.ffm: Input/output error




Would you know the trick?

Thank you

schneidz 09-13-2014 05:29 PM

i dont know specifically but would mounting the pc via sshfs allow you to work with /dev/video1 as if it is local.

maybe playing with netcat mite work (i stole this from someones signature):
Code:

#!/bin/bash
PL=$(find /root/user/music -name "*.mp3")
NUM=$(echo $PL |wc -w)
{
while true; do
r=$(($RANDOM%$NUM))
s=$(echo $PL |cut -d ' ' -f$r)
echo "HTTP/1.0 200 OK\nContent-Type: audio/x-mp3stream\n\n"
dd if=$s bs=1024
done
} | nc -l -s address -p 8020


Xeratul 09-14-2014 04:05 AM

Quote:

Originally Posted by schneidz (Post 5237445)
i dont know specifically but would mounting the pc via sshfs allow you to work with /dev/video1 as if it is local.

maybe playing with netcat mite work (i stole this from someones signature):
Code:

#!/bin/bash
PL=$(find /root/user/music -name "*.mp3")
NUM=$(echo $PL |wc -w)
{
while true; do
r=$(($RANDOM%$NUM))
s=$(echo $PL |cut -d ' ' -f$r)
echo "HTTP/1.0 200 OK\nContent-Type: audio/x-mp3stream\n\n"
dd if=$s bs=1024
done
} | nc -l -s address -p 8020


nc :
I dont understand so much how it works if its on remote or distant. i know that with ssh, you can run cmd with -C and gzip/gunzip it to make it faster. cpu are good enough to compress and ssh/gzip it over rj45 cable.

nc is installed on my pc. cool:
so do you mean like this?
on distant:
Code:

dd if=/dev/video0  bs=1024 | nc -l -s 127.0.0.1 -p 8020
on remote:
Code:

mplayer 192.168.1.10:8090
mplayer can pipe. i believe that mplayer could stream too such as vlc-nox.

maybe ffplay and ffmpeg can pipe and stream


All times are GMT -5. The time now is 03:36 PM.