LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-13-2014, 02:55 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
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

Last edited by Xeratul; 09-13-2014 at 03:28 PM.
 
Old 09-13-2014, 05:29 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
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
 
Old 09-14-2014, 04:05 AM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by schneidz View Post
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

Last edited by Xeratul; 09-14-2014 at 04:14 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
piping shell commands interactively to a persistent ssh gurcani Linux - Server 10 12-31-2009 09:17 AM
Linux piping vs Windows piping emanabela Linux - Newbie 1 05-10-2009 12:58 PM
Webcam over SSH? MasterOfTheWind Linux - Software 2 10-18-2008 09:13 AM
Watching Server SSH Commands leebrent Linux - Security 6 02-13-2008 11:08 PM
Watching SSH pts/# connections live... KneeLess Linux - Networking 4 01-22-2004 06:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration