Can I pipe /dev/video over ssh
Clash Royale CLAN TAG#URR8PPP
up vote
26
down vote
favorite
I have two computers, a desktop in my office ( with a webcam attached ) and a laptop somewhere else on the network.
Usually I take a look at my office through my webcam by running
ssh Office -Y "mplayer tv://device=/dev/video0"
from my laptop. I don't like Xforwarding mplayer, so why can't I tunnel /dev/video
to my pc by running this on my laptop?
sudo mkfifo /dev/video1
ssh Office 'dd if=/dev/video' | sudo dd of=/dev/video1'
and then to watch the webcam ( on my laptop )
mplayer tv://device=/dev/video1
ssh video ssh-tunneling
add a comment |
up vote
26
down vote
favorite
I have two computers, a desktop in my office ( with a webcam attached ) and a laptop somewhere else on the network.
Usually I take a look at my office through my webcam by running
ssh Office -Y "mplayer tv://device=/dev/video0"
from my laptop. I don't like Xforwarding mplayer, so why can't I tunnel /dev/video
to my pc by running this on my laptop?
sudo mkfifo /dev/video1
ssh Office 'dd if=/dev/video' | sudo dd of=/dev/video1'
and then to watch the webcam ( on my laptop )
mplayer tv://device=/dev/video1
ssh video ssh-tunneling
add a comment |
up vote
26
down vote
favorite
up vote
26
down vote
favorite
I have two computers, a desktop in my office ( with a webcam attached ) and a laptop somewhere else on the network.
Usually I take a look at my office through my webcam by running
ssh Office -Y "mplayer tv://device=/dev/video0"
from my laptop. I don't like Xforwarding mplayer, so why can't I tunnel /dev/video
to my pc by running this on my laptop?
sudo mkfifo /dev/video1
ssh Office 'dd if=/dev/video' | sudo dd of=/dev/video1'
and then to watch the webcam ( on my laptop )
mplayer tv://device=/dev/video1
ssh video ssh-tunneling
I have two computers, a desktop in my office ( with a webcam attached ) and a laptop somewhere else on the network.
Usually I take a look at my office through my webcam by running
ssh Office -Y "mplayer tv://device=/dev/video0"
from my laptop. I don't like Xforwarding mplayer, so why can't I tunnel /dev/video
to my pc by running this on my laptop?
sudo mkfifo /dev/video1
ssh Office 'dd if=/dev/video' | sudo dd of=/dev/video1'
and then to watch the webcam ( on my laptop )
mplayer tv://device=/dev/video1
ssh video ssh-tunneling
ssh video ssh-tunneling
edited Feb 27 '14 at 22:49
Gilles
522k12610401575
522k12610401575
asked Sep 21 '10 at 10:52
Stefan
11.4k3181123
11.4k3181123
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
up vote
11
down vote
accepted
Something like:
dd if=/dev/video0 | mplayer tv://device=/dev/stdin
works for me (SOA#1) locally. So does:
ssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
As well as
mkfifo test
dd if=/dev/video0 of=test &
mplayer tv://device=test
Hence:
- Try without named pipe
- Check bandwidth
Also - how does in not work (display black screen, complains about unknown device etc.)?
I think something is wrong with my mplayer. If I rundd if=/dev/video0 | mplayer tv://device=/dev/stdin
it tells me the resource is busy. Otherwise it works ( I see video ) even when I runmplayer tv://device=/dev/null
– Stefan
Sep 22 '10 at 8:09
1
This answer is quite misleading. The "correct" invocation ofmplayer
would bemplayer tv:// -tv device=/dev/stdin
or similar, but this does not work (character devices are more special thandd
can handle properly). When you runmplayer tv://device=/dev/stdin
it is not seeing a device specification and so falling back to/dev/video0
directly, giving the illusion of "working". But it won't work at all when the webcam andmplayer
process are separated by the network.
– Daniel Wagner
Mar 28 '17 at 21:59
Yes, this looks like it's working right because you're SSH'ing to localhost, but in reality it's failing and mplayer is falling back to /dev/video0 on localhost. If you try these commands SSHing to a different computer (i.e. not localhost), you'll see your local webcam, not the remote one.
– Jason Antman
Sep 27 '17 at 11:02
You tried in local host but how to run the commandssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
when using two different computers?
– Francesco Boi
Nov 15 at 10:27
What is an alternative ofmplayer tv://device=/dev/stdin
on OSX?
– Francesco Boi
Nov 15 at 10:35
add a comment |
up vote
12
down vote
If you have a low bandwidth I recommend compression of the video stream:
ssh USER@REMOTEHOST ffmpeg -an -f video4linux2 -s 640x480 -i /dev/video0 -r 10 -b:v 500k -f matroska - | mplayer - -idle -demuxer matroska
where
-an
turns off audio encoding. If you want audio, replace-an
with-f alsa -ac 1 -i hw:3
(where hw:3 could also be hw:0 or hw:1, … Seearecord -l
for your device). If you want audio only (no video), use this)-s 640x480
is the size of your video in x and y dimension-r 10
is the framerate you want to receive (lower makes better images at low bitrates, but looks more bumby)-b:v 500k
is a bitrate of 500 kilobit/s
You need ffmpeg on the remote host and mplayer on the local machine installed.
add a comment |
up vote
4
down vote
The VideoLAN Project exists in large part to do just what you desire.
I've not used its streaming capabilities but in its single machine use it has shown to be rock solid for me.
And so, could you elaborate for this scenario, please ...?
– MikeW
Jun 23 '17 at 9:10
add a comment |
up vote
1
down vote
The accepted answer does not work for me. dd
simply won't read it. nc
is bad if you cant spare another port (I didn't get that to work at all either anyway). cat
didn't work for me either.
What ended up working for me was this on the receiving end:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | mplayer - -idle
This has the benefit of it being encoded, so you save bandwidth as a bonus. Nothing else on any forum/website was working for me on a debian machine.
Combine with tee and you can watch and record at the same time:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | tee $(date +%Y-%m-%d_%H-%M-%S)_recording.mkv | mplayer - -idle
This will open mplayer for live streaming and save it to a file containing the current datetime at the same time (example filename: 2018-11-22_01-22-10_recording.mkv
).
add a comment |
up vote
0
down vote
I don't know if there's any reason you can't do it, but one problem I see with your implementation is that the remote system will look for /dev/video1 on its system, but won't be able to find it because you created it on your local system.
What I'd do is something along the following
nc -l 12345 | sudo tee /dev/video > /dev/null &
ssh Office
and then try something by telling it to go to your local system's TCP port 12345.
I tried clarifying my question. please see the updated version
– Stefan
Sep 21 '10 at 13:47
add a comment |
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
11
down vote
accepted
Something like:
dd if=/dev/video0 | mplayer tv://device=/dev/stdin
works for me (SOA#1) locally. So does:
ssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
As well as
mkfifo test
dd if=/dev/video0 of=test &
mplayer tv://device=test
Hence:
- Try without named pipe
- Check bandwidth
Also - how does in not work (display black screen, complains about unknown device etc.)?
I think something is wrong with my mplayer. If I rundd if=/dev/video0 | mplayer tv://device=/dev/stdin
it tells me the resource is busy. Otherwise it works ( I see video ) even when I runmplayer tv://device=/dev/null
– Stefan
Sep 22 '10 at 8:09
1
This answer is quite misleading. The "correct" invocation ofmplayer
would bemplayer tv:// -tv device=/dev/stdin
or similar, but this does not work (character devices are more special thandd
can handle properly). When you runmplayer tv://device=/dev/stdin
it is not seeing a device specification and so falling back to/dev/video0
directly, giving the illusion of "working". But it won't work at all when the webcam andmplayer
process are separated by the network.
– Daniel Wagner
Mar 28 '17 at 21:59
Yes, this looks like it's working right because you're SSH'ing to localhost, but in reality it's failing and mplayer is falling back to /dev/video0 on localhost. If you try these commands SSHing to a different computer (i.e. not localhost), you'll see your local webcam, not the remote one.
– Jason Antman
Sep 27 '17 at 11:02
You tried in local host but how to run the commandssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
when using two different computers?
– Francesco Boi
Nov 15 at 10:27
What is an alternative ofmplayer tv://device=/dev/stdin
on OSX?
– Francesco Boi
Nov 15 at 10:35
add a comment |
up vote
11
down vote
accepted
Something like:
dd if=/dev/video0 | mplayer tv://device=/dev/stdin
works for me (SOA#1) locally. So does:
ssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
As well as
mkfifo test
dd if=/dev/video0 of=test &
mplayer tv://device=test
Hence:
- Try without named pipe
- Check bandwidth
Also - how does in not work (display black screen, complains about unknown device etc.)?
I think something is wrong with my mplayer. If I rundd if=/dev/video0 | mplayer tv://device=/dev/stdin
it tells me the resource is busy. Otherwise it works ( I see video ) even when I runmplayer tv://device=/dev/null
– Stefan
Sep 22 '10 at 8:09
1
This answer is quite misleading. The "correct" invocation ofmplayer
would bemplayer tv:// -tv device=/dev/stdin
or similar, but this does not work (character devices are more special thandd
can handle properly). When you runmplayer tv://device=/dev/stdin
it is not seeing a device specification and so falling back to/dev/video0
directly, giving the illusion of "working". But it won't work at all when the webcam andmplayer
process are separated by the network.
– Daniel Wagner
Mar 28 '17 at 21:59
Yes, this looks like it's working right because you're SSH'ing to localhost, but in reality it's failing and mplayer is falling back to /dev/video0 on localhost. If you try these commands SSHing to a different computer (i.e. not localhost), you'll see your local webcam, not the remote one.
– Jason Antman
Sep 27 '17 at 11:02
You tried in local host but how to run the commandssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
when using two different computers?
– Francesco Boi
Nov 15 at 10:27
What is an alternative ofmplayer tv://device=/dev/stdin
on OSX?
– Francesco Boi
Nov 15 at 10:35
add a comment |
up vote
11
down vote
accepted
up vote
11
down vote
accepted
Something like:
dd if=/dev/video0 | mplayer tv://device=/dev/stdin
works for me (SOA#1) locally. So does:
ssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
As well as
mkfifo test
dd if=/dev/video0 of=test &
mplayer tv://device=test
Hence:
- Try without named pipe
- Check bandwidth
Also - how does in not work (display black screen, complains about unknown device etc.)?
Something like:
dd if=/dev/video0 | mplayer tv://device=/dev/stdin
works for me (SOA#1) locally. So does:
ssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
As well as
mkfifo test
dd if=/dev/video0 of=test &
mplayer tv://device=test
Hence:
- Try without named pipe
- Check bandwidth
Also - how does in not work (display black screen, complains about unknown device etc.)?
answered Sep 21 '10 at 16:37
Maciej Piechotka
11.1k64277
11.1k64277
I think something is wrong with my mplayer. If I rundd if=/dev/video0 | mplayer tv://device=/dev/stdin
it tells me the resource is busy. Otherwise it works ( I see video ) even when I runmplayer tv://device=/dev/null
– Stefan
Sep 22 '10 at 8:09
1
This answer is quite misleading. The "correct" invocation ofmplayer
would bemplayer tv:// -tv device=/dev/stdin
or similar, but this does not work (character devices are more special thandd
can handle properly). When you runmplayer tv://device=/dev/stdin
it is not seeing a device specification and so falling back to/dev/video0
directly, giving the illusion of "working". But it won't work at all when the webcam andmplayer
process are separated by the network.
– Daniel Wagner
Mar 28 '17 at 21:59
Yes, this looks like it's working right because you're SSH'ing to localhost, but in reality it's failing and mplayer is falling back to /dev/video0 on localhost. If you try these commands SSHing to a different computer (i.e. not localhost), you'll see your local webcam, not the remote one.
– Jason Antman
Sep 27 '17 at 11:02
You tried in local host but how to run the commandssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
when using two different computers?
– Francesco Boi
Nov 15 at 10:27
What is an alternative ofmplayer tv://device=/dev/stdin
on OSX?
– Francesco Boi
Nov 15 at 10:35
add a comment |
I think something is wrong with my mplayer. If I rundd if=/dev/video0 | mplayer tv://device=/dev/stdin
it tells me the resource is busy. Otherwise it works ( I see video ) even when I runmplayer tv://device=/dev/null
– Stefan
Sep 22 '10 at 8:09
1
This answer is quite misleading. The "correct" invocation ofmplayer
would bemplayer tv:// -tv device=/dev/stdin
or similar, but this does not work (character devices are more special thandd
can handle properly). When you runmplayer tv://device=/dev/stdin
it is not seeing a device specification and so falling back to/dev/video0
directly, giving the illusion of "working". But it won't work at all when the webcam andmplayer
process are separated by the network.
– Daniel Wagner
Mar 28 '17 at 21:59
Yes, this looks like it's working right because you're SSH'ing to localhost, but in reality it's failing and mplayer is falling back to /dev/video0 on localhost. If you try these commands SSHing to a different computer (i.e. not localhost), you'll see your local webcam, not the remote one.
– Jason Antman
Sep 27 '17 at 11:02
You tried in local host but how to run the commandssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
when using two different computers?
– Francesco Boi
Nov 15 at 10:27
What is an alternative ofmplayer tv://device=/dev/stdin
on OSX?
– Francesco Boi
Nov 15 at 10:35
I think something is wrong with my mplayer. If I run
dd if=/dev/video0 | mplayer tv://device=/dev/stdin
it tells me the resource is busy. Otherwise it works ( I see video ) even when I run mplayer tv://device=/dev/null
– Stefan
Sep 22 '10 at 8:09
I think something is wrong with my mplayer. If I run
dd if=/dev/video0 | mplayer tv://device=/dev/stdin
it tells me the resource is busy. Otherwise it works ( I see video ) even when I run mplayer tv://device=/dev/null
– Stefan
Sep 22 '10 at 8:09
1
1
This answer is quite misleading. The "correct" invocation of
mplayer
would be mplayer tv:// -tv device=/dev/stdin
or similar, but this does not work (character devices are more special than dd
can handle properly). When you run mplayer tv://device=/dev/stdin
it is not seeing a device specification and so falling back to /dev/video0
directly, giving the illusion of "working". But it won't work at all when the webcam and mplayer
process are separated by the network.– Daniel Wagner
Mar 28 '17 at 21:59
This answer is quite misleading. The "correct" invocation of
mplayer
would be mplayer tv:// -tv device=/dev/stdin
or similar, but this does not work (character devices are more special than dd
can handle properly). When you run mplayer tv://device=/dev/stdin
it is not seeing a device specification and so falling back to /dev/video0
directly, giving the illusion of "working". But it won't work at all when the webcam and mplayer
process are separated by the network.– Daniel Wagner
Mar 28 '17 at 21:59
Yes, this looks like it's working right because you're SSH'ing to localhost, but in reality it's failing and mplayer is falling back to /dev/video0 on localhost. If you try these commands SSHing to a different computer (i.e. not localhost), you'll see your local webcam, not the remote one.
– Jason Antman
Sep 27 '17 at 11:02
Yes, this looks like it's working right because you're SSH'ing to localhost, but in reality it's failing and mplayer is falling back to /dev/video0 on localhost. If you try these commands SSHing to a different computer (i.e. not localhost), you'll see your local webcam, not the remote one.
– Jason Antman
Sep 27 '17 at 11:02
You tried in local host but how to run the command
ssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
when using two different computers?– Francesco Boi
Nov 15 at 10:27
You tried in local host but how to run the command
ssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin
when using two different computers?– Francesco Boi
Nov 15 at 10:27
What is an alternative of
mplayer tv://device=/dev/stdin
on OSX?– Francesco Boi
Nov 15 at 10:35
What is an alternative of
mplayer tv://device=/dev/stdin
on OSX?– Francesco Boi
Nov 15 at 10:35
add a comment |
up vote
12
down vote
If you have a low bandwidth I recommend compression of the video stream:
ssh USER@REMOTEHOST ffmpeg -an -f video4linux2 -s 640x480 -i /dev/video0 -r 10 -b:v 500k -f matroska - | mplayer - -idle -demuxer matroska
where
-an
turns off audio encoding. If you want audio, replace-an
with-f alsa -ac 1 -i hw:3
(where hw:3 could also be hw:0 or hw:1, … Seearecord -l
for your device). If you want audio only (no video), use this)-s 640x480
is the size of your video in x and y dimension-r 10
is the framerate you want to receive (lower makes better images at low bitrates, but looks more bumby)-b:v 500k
is a bitrate of 500 kilobit/s
You need ffmpeg on the remote host and mplayer on the local machine installed.
add a comment |
up vote
12
down vote
If you have a low bandwidth I recommend compression of the video stream:
ssh USER@REMOTEHOST ffmpeg -an -f video4linux2 -s 640x480 -i /dev/video0 -r 10 -b:v 500k -f matroska - | mplayer - -idle -demuxer matroska
where
-an
turns off audio encoding. If you want audio, replace-an
with-f alsa -ac 1 -i hw:3
(where hw:3 could also be hw:0 or hw:1, … Seearecord -l
for your device). If you want audio only (no video), use this)-s 640x480
is the size of your video in x and y dimension-r 10
is the framerate you want to receive (lower makes better images at low bitrates, but looks more bumby)-b:v 500k
is a bitrate of 500 kilobit/s
You need ffmpeg on the remote host and mplayer on the local machine installed.
add a comment |
up vote
12
down vote
up vote
12
down vote
If you have a low bandwidth I recommend compression of the video stream:
ssh USER@REMOTEHOST ffmpeg -an -f video4linux2 -s 640x480 -i /dev/video0 -r 10 -b:v 500k -f matroska - | mplayer - -idle -demuxer matroska
where
-an
turns off audio encoding. If you want audio, replace-an
with-f alsa -ac 1 -i hw:3
(where hw:3 could also be hw:0 or hw:1, … Seearecord -l
for your device). If you want audio only (no video), use this)-s 640x480
is the size of your video in x and y dimension-r 10
is the framerate you want to receive (lower makes better images at low bitrates, but looks more bumby)-b:v 500k
is a bitrate of 500 kilobit/s
You need ffmpeg on the remote host and mplayer on the local machine installed.
If you have a low bandwidth I recommend compression of the video stream:
ssh USER@REMOTEHOST ffmpeg -an -f video4linux2 -s 640x480 -i /dev/video0 -r 10 -b:v 500k -f matroska - | mplayer - -idle -demuxer matroska
where
-an
turns off audio encoding. If you want audio, replace-an
with-f alsa -ac 1 -i hw:3
(where hw:3 could also be hw:0 or hw:1, … Seearecord -l
for your device). If you want audio only (no video), use this)-s 640x480
is the size of your video in x and y dimension-r 10
is the framerate you want to receive (lower makes better images at low bitrates, but looks more bumby)-b:v 500k
is a bitrate of 500 kilobit/s
You need ffmpeg on the remote host and mplayer on the local machine installed.
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Feb 27 '14 at 22:45
erik
9,18742034
9,18742034
add a comment |
add a comment |
up vote
4
down vote
The VideoLAN Project exists in large part to do just what you desire.
I've not used its streaming capabilities but in its single machine use it has shown to be rock solid for me.
And so, could you elaborate for this scenario, please ...?
– MikeW
Jun 23 '17 at 9:10
add a comment |
up vote
4
down vote
The VideoLAN Project exists in large part to do just what you desire.
I've not used its streaming capabilities but in its single machine use it has shown to be rock solid for me.
And so, could you elaborate for this scenario, please ...?
– MikeW
Jun 23 '17 at 9:10
add a comment |
up vote
4
down vote
up vote
4
down vote
The VideoLAN Project exists in large part to do just what you desire.
I've not used its streaming capabilities but in its single machine use it has shown to be rock solid for me.
The VideoLAN Project exists in large part to do just what you desire.
I've not used its streaming capabilities but in its single machine use it has shown to be rock solid for me.
answered Sep 21 '10 at 14:05
msw
8,8552236
8,8552236
And so, could you elaborate for this scenario, please ...?
– MikeW
Jun 23 '17 at 9:10
add a comment |
And so, could you elaborate for this scenario, please ...?
– MikeW
Jun 23 '17 at 9:10
And so, could you elaborate for this scenario, please ...?
– MikeW
Jun 23 '17 at 9:10
And so, could you elaborate for this scenario, please ...?
– MikeW
Jun 23 '17 at 9:10
add a comment |
up vote
1
down vote
The accepted answer does not work for me. dd
simply won't read it. nc
is bad if you cant spare another port (I didn't get that to work at all either anyway). cat
didn't work for me either.
What ended up working for me was this on the receiving end:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | mplayer - -idle
This has the benefit of it being encoded, so you save bandwidth as a bonus. Nothing else on any forum/website was working for me on a debian machine.
Combine with tee and you can watch and record at the same time:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | tee $(date +%Y-%m-%d_%H-%M-%S)_recording.mkv | mplayer - -idle
This will open mplayer for live streaming and save it to a file containing the current datetime at the same time (example filename: 2018-11-22_01-22-10_recording.mkv
).
add a comment |
up vote
1
down vote
The accepted answer does not work for me. dd
simply won't read it. nc
is bad if you cant spare another port (I didn't get that to work at all either anyway). cat
didn't work for me either.
What ended up working for me was this on the receiving end:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | mplayer - -idle
This has the benefit of it being encoded, so you save bandwidth as a bonus. Nothing else on any forum/website was working for me on a debian machine.
Combine with tee and you can watch and record at the same time:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | tee $(date +%Y-%m-%d_%H-%M-%S)_recording.mkv | mplayer - -idle
This will open mplayer for live streaming and save it to a file containing the current datetime at the same time (example filename: 2018-11-22_01-22-10_recording.mkv
).
add a comment |
up vote
1
down vote
up vote
1
down vote
The accepted answer does not work for me. dd
simply won't read it. nc
is bad if you cant spare another port (I didn't get that to work at all either anyway). cat
didn't work for me either.
What ended up working for me was this on the receiving end:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | mplayer - -idle
This has the benefit of it being encoded, so you save bandwidth as a bonus. Nothing else on any forum/website was working for me on a debian machine.
Combine with tee and you can watch and record at the same time:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | tee $(date +%Y-%m-%d_%H-%M-%S)_recording.mkv | mplayer - -idle
This will open mplayer for live streaming and save it to a file containing the current datetime at the same time (example filename: 2018-11-22_01-22-10_recording.mkv
).
The accepted answer does not work for me. dd
simply won't read it. nc
is bad if you cant spare another port (I didn't get that to work at all either anyway). cat
didn't work for me either.
What ended up working for me was this on the receiving end:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | mplayer - -idle
This has the benefit of it being encoded, so you save bandwidth as a bonus. Nothing else on any forum/website was working for me on a debian machine.
Combine with tee and you can watch and record at the same time:
ssh user@host "ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f matroska -" | tee $(date +%Y-%m-%d_%H-%M-%S)_recording.mkv | mplayer - -idle
This will open mplayer for live streaming and save it to a file containing the current datetime at the same time (example filename: 2018-11-22_01-22-10_recording.mkv
).
edited Nov 22 at 3:23
answered Nov 21 at 23:58
confetti
394118
394118
add a comment |
add a comment |
up vote
0
down vote
I don't know if there's any reason you can't do it, but one problem I see with your implementation is that the remote system will look for /dev/video1 on its system, but won't be able to find it because you created it on your local system.
What I'd do is something along the following
nc -l 12345 | sudo tee /dev/video > /dev/null &
ssh Office
and then try something by telling it to go to your local system's TCP port 12345.
I tried clarifying my question. please see the updated version
– Stefan
Sep 21 '10 at 13:47
add a comment |
up vote
0
down vote
I don't know if there's any reason you can't do it, but one problem I see with your implementation is that the remote system will look for /dev/video1 on its system, but won't be able to find it because you created it on your local system.
What I'd do is something along the following
nc -l 12345 | sudo tee /dev/video > /dev/null &
ssh Office
and then try something by telling it to go to your local system's TCP port 12345.
I tried clarifying my question. please see the updated version
– Stefan
Sep 21 '10 at 13:47
add a comment |
up vote
0
down vote
up vote
0
down vote
I don't know if there's any reason you can't do it, but one problem I see with your implementation is that the remote system will look for /dev/video1 on its system, but won't be able to find it because you created it on your local system.
What I'd do is something along the following
nc -l 12345 | sudo tee /dev/video > /dev/null &
ssh Office
and then try something by telling it to go to your local system's TCP port 12345.
I don't know if there's any reason you can't do it, but one problem I see with your implementation is that the remote system will look for /dev/video1 on its system, but won't be able to find it because you created it on your local system.
What I'd do is something along the following
nc -l 12345 | sudo tee /dev/video > /dev/null &
ssh Office
and then try something by telling it to go to your local system's TCP port 12345.
answered Sep 21 '10 at 12:49
Kevin M
1,71211212
1,71211212
I tried clarifying my question. please see the updated version
– Stefan
Sep 21 '10 at 13:47
add a comment |
I tried clarifying my question. please see the updated version
– Stefan
Sep 21 '10 at 13:47
I tried clarifying my question. please see the updated version
– Stefan
Sep 21 '10 at 13:47
I tried clarifying my question. please see the updated version
– Stefan
Sep 21 '10 at 13:47
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f2302%2fcan-i-pipe-dev-video-over-ssh%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown