Can I pipe /dev/video over ssh

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
26
down vote

favorite
14












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









share|improve this question



























    up vote
    26
    down vote

    favorite
    14












    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









    share|improve this question

























      up vote
      26
      down vote

      favorite
      14









      up vote
      26
      down vote

      favorite
      14






      14





      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









      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 27 '14 at 22:49









      Gilles

      522k12610401575




      522k12610401575










      asked Sep 21 '10 at 10:52









      Stefan

      11.4k3181123




      11.4k3181123




















          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:



          1. Try without named pipe

          2. Check bandwidth

          Also - how does in not work (display black screen, complains about unknown device etc.)?






          share|improve this answer




















          • 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




            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










          • 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

















          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, … See arecord -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.






          share|improve this answer





























            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.






            share|improve this answer




















            • And so, could you elaborate for this scenario, please ...?
              – MikeW
              Jun 23 '17 at 9:10

















            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).






            share|improve this answer





























              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.






              share|improve this answer




















              • I tried clarifying my question. please see the updated version
                – Stefan
                Sep 21 '10 at 13:47










              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "106"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













               

              draft saved


              draft discarded


















              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

























              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:



              1. Try without named pipe

              2. Check bandwidth

              Also - how does in not work (display black screen, complains about unknown device etc.)?






              share|improve this answer




















              • 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




                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










              • 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














              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:



              1. Try without named pipe

              2. Check bandwidth

              Also - how does in not work (display black screen, complains about unknown device etc.)?






              share|improve this answer




















              • 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




                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










              • 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












              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:



              1. Try without named pipe

              2. Check bandwidth

              Also - how does in not work (display black screen, complains about unknown device etc.)?






              share|improve this answer












              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:



              1. Try without named pipe

              2. Check bandwidth

              Also - how does in not work (display black screen, complains about unknown device etc.)?







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Sep 21 '10 at 16:37









              Maciej Piechotka

              11.1k64277




              11.1k64277











              • 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




                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










              • 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
















              • 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




                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










              • 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















              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












              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, … See arecord -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.






              share|improve this answer


























                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, … See arecord -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.






                share|improve this answer
























                  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, … See arecord -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.






                  share|improve this answer














                  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, … See arecord -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.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 13 '17 at 12:36









                  Community

                  1




                  1










                  answered Feb 27 '14 at 22:45









                  erik

                  9,18742034




                  9,18742034




















                      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.






                      share|improve this answer




















                      • And so, could you elaborate for this scenario, please ...?
                        – MikeW
                        Jun 23 '17 at 9:10














                      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.






                      share|improve this answer




















                      • And so, could you elaborate for this scenario, please ...?
                        – MikeW
                        Jun 23 '17 at 9:10












                      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.






                      share|improve this answer












                      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.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      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
















                      • 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










                      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).






                      share|improve this answer


























                        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).






                        share|improve this answer
























                          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).






                          share|improve this answer














                          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).







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Nov 22 at 3:23

























                          answered Nov 21 at 23:58









                          confetti

                          394118




                          394118




















                              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.






                              share|improve this answer




















                              • I tried clarifying my question. please see the updated version
                                – Stefan
                                Sep 21 '10 at 13:47














                              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.






                              share|improve this answer




















                              • I tried clarifying my question. please see the updated version
                                – Stefan
                                Sep 21 '10 at 13:47












                              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.






                              share|improve this answer












                              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.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              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
















                              • 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

















                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              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





















































                              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






                              Popular posts from this blog

                              How to check contact read email or not when send email to Individual?

                              Displaying single band from multi-band raster using QGIS

                              How many registers does an x86_64 CPU actually have?