Gstreaming - two web cams over tcp












0















I'm trying to stream two web cams on a single gstreaming command, I'm able to start a single camera with :



gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! videoscale ! video/x-raw,width=320,height=240  ! vp8enc ! webmmux ! tcpserversink port=8080


The idea was to start another camera but on a different path, could be IP or PORT, but by standards i tried only different port:



gst-launch-1.0 tee name=stream v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=12/1 ! vp8enc ! webmmux ! tcpserversink port=8080 stream. v4l2src device=/dev/video2 ! video/x-raw,width=640,height=480,framerate=12/1 ! vp8enc ! webmmux ! tcpserversink port=8081 stream.


Using webm output and muxer is required



But i always get this error: Unexpected reference "stream" ignoring



Following this pattern i found here



gst-launch-1.0 tee name=stream v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! jpegdec ! xvimagesink stream. v4l2src device=/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! jpegdec ! xvimagesink stream.









share|improve this question



























    0















    I'm trying to stream two web cams on a single gstreaming command, I'm able to start a single camera with :



    gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! videoscale ! video/x-raw,width=320,height=240  ! vp8enc ! webmmux ! tcpserversink port=8080


    The idea was to start another camera but on a different path, could be IP or PORT, but by standards i tried only different port:



    gst-launch-1.0 tee name=stream v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=12/1 ! vp8enc ! webmmux ! tcpserversink port=8080 stream. v4l2src device=/dev/video2 ! video/x-raw,width=640,height=480,framerate=12/1 ! vp8enc ! webmmux ! tcpserversink port=8081 stream.


    Using webm output and muxer is required



    But i always get this error: Unexpected reference "stream" ignoring



    Following this pattern i found here



    gst-launch-1.0 tee name=stream v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! jpegdec ! xvimagesink stream. v4l2src device=/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! jpegdec ! xvimagesink stream.









    share|improve this question

























      0












      0








      0








      I'm trying to stream two web cams on a single gstreaming command, I'm able to start a single camera with :



      gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! videoscale ! video/x-raw,width=320,height=240  ! vp8enc ! webmmux ! tcpserversink port=8080


      The idea was to start another camera but on a different path, could be IP or PORT, but by standards i tried only different port:



      gst-launch-1.0 tee name=stream v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=12/1 ! vp8enc ! webmmux ! tcpserversink port=8080 stream. v4l2src device=/dev/video2 ! video/x-raw,width=640,height=480,framerate=12/1 ! vp8enc ! webmmux ! tcpserversink port=8081 stream.


      Using webm output and muxer is required



      But i always get this error: Unexpected reference "stream" ignoring



      Following this pattern i found here



      gst-launch-1.0 tee name=stream v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! jpegdec ! xvimagesink stream. v4l2src device=/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! jpegdec ! xvimagesink stream.









      share|improve this question














      I'm trying to stream two web cams on a single gstreaming command, I'm able to start a single camera with :



      gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! videoscale ! video/x-raw,width=320,height=240  ! vp8enc ! webmmux ! tcpserversink port=8080


      The idea was to start another camera but on a different path, could be IP or PORT, but by standards i tried only different port:



      gst-launch-1.0 tee name=stream v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=12/1 ! vp8enc ! webmmux ! tcpserversink port=8080 stream. v4l2src device=/dev/video2 ! video/x-raw,width=640,height=480,framerate=12/1 ! vp8enc ! webmmux ! tcpserversink port=8081 stream.


      Using webm output and muxer is required



      But i always get this error: Unexpected reference "stream" ignoring



      Following this pattern i found here



      gst-launch-1.0 tee name=stream v4l2src device=/dev/video0 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! jpegdec ! xvimagesink stream. v4l2src device=/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1 ! jpegparse ! jpegdec ! xvimagesink stream.






      linux webcam gstreamer v4l2






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 4 at 18:40









      Bruno CerkBruno Cerk

      11




      11






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I'd recommend reading the gst-launch syntax (https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html) to get a better understanding of the error there. You create an element and give it a name: stream. Then you use this reference throughout your pipeline description.



          Let's look at this part:



          jpegdec ! xvimagesink stream. v4l2src device=/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1


          You are linking a jpegdec to xvimagesink and then you have a reference to stream right there. Then you are creating a v4l2src and linking to a capsfilter. The "stream" element you just referenced there in the middle isn't doing anything sitting there, not being linked to anyone. So this is invalid syntax and it fails.



          I believe you actually don't want the tee element, so you could entirely remove it and its references. This is what tee is useful for: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-tee.html



          Additionally, you could also have 2 separate pipelines, one for each camera. Doing it on one or two depends on how you want to manage and if they need to share some pipeline-related data, such as a clock. But that depends on your use case which I don't know deeply.






          share|improve this answer
























          • Thanks for your answer, the piece of code you commented about is from the topic that i linked, its not mine, i just used it as a base to create mine

            – Bruno Cerk
            Feb 7 at 12:09











          • The sample you mentioned (the 2nd one). Also contains the stream element.

            – thiagoss
            Feb 7 at 20:19












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2fsuperuser.com%2fquestions%2f1401962%2fgstreaming-two-web-cams-over-tcp%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I'd recommend reading the gst-launch syntax (https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html) to get a better understanding of the error there. You create an element and give it a name: stream. Then you use this reference throughout your pipeline description.



          Let's look at this part:



          jpegdec ! xvimagesink stream. v4l2src device=/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1


          You are linking a jpegdec to xvimagesink and then you have a reference to stream right there. Then you are creating a v4l2src and linking to a capsfilter. The "stream" element you just referenced there in the middle isn't doing anything sitting there, not being linked to anyone. So this is invalid syntax and it fails.



          I believe you actually don't want the tee element, so you could entirely remove it and its references. This is what tee is useful for: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-tee.html



          Additionally, you could also have 2 separate pipelines, one for each camera. Doing it on one or two depends on how you want to manage and if they need to share some pipeline-related data, such as a clock. But that depends on your use case which I don't know deeply.






          share|improve this answer
























          • Thanks for your answer, the piece of code you commented about is from the topic that i linked, its not mine, i just used it as a base to create mine

            – Bruno Cerk
            Feb 7 at 12:09











          • The sample you mentioned (the 2nd one). Also contains the stream element.

            – thiagoss
            Feb 7 at 20:19
















          0














          I'd recommend reading the gst-launch syntax (https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html) to get a better understanding of the error there. You create an element and give it a name: stream. Then you use this reference throughout your pipeline description.



          Let's look at this part:



          jpegdec ! xvimagesink stream. v4l2src device=/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1


          You are linking a jpegdec to xvimagesink and then you have a reference to stream right there. Then you are creating a v4l2src and linking to a capsfilter. The "stream" element you just referenced there in the middle isn't doing anything sitting there, not being linked to anyone. So this is invalid syntax and it fails.



          I believe you actually don't want the tee element, so you could entirely remove it and its references. This is what tee is useful for: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-tee.html



          Additionally, you could also have 2 separate pipelines, one for each camera. Doing it on one or two depends on how you want to manage and if they need to share some pipeline-related data, such as a clock. But that depends on your use case which I don't know deeply.






          share|improve this answer
























          • Thanks for your answer, the piece of code you commented about is from the topic that i linked, its not mine, i just used it as a base to create mine

            – Bruno Cerk
            Feb 7 at 12:09











          • The sample you mentioned (the 2nd one). Also contains the stream element.

            – thiagoss
            Feb 7 at 20:19














          0












          0








          0







          I'd recommend reading the gst-launch syntax (https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html) to get a better understanding of the error there. You create an element and give it a name: stream. Then you use this reference throughout your pipeline description.



          Let's look at this part:



          jpegdec ! xvimagesink stream. v4l2src device=/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1


          You are linking a jpegdec to xvimagesink and then you have a reference to stream right there. Then you are creating a v4l2src and linking to a capsfilter. The "stream" element you just referenced there in the middle isn't doing anything sitting there, not being linked to anyone. So this is invalid syntax and it fails.



          I believe you actually don't want the tee element, so you could entirely remove it and its references. This is what tee is useful for: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-tee.html



          Additionally, you could also have 2 separate pipelines, one for each camera. Doing it on one or two depends on how you want to manage and if they need to share some pipeline-related data, such as a clock. But that depends on your use case which I don't know deeply.






          share|improve this answer













          I'd recommend reading the gst-launch syntax (https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html) to get a better understanding of the error there. You create an element and give it a name: stream. Then you use this reference throughout your pipeline description.



          Let's look at this part:



          jpegdec ! xvimagesink stream. v4l2src device=/dev/video1 ! image/jpeg,width=800,height=600,framerate=30/1


          You are linking a jpegdec to xvimagesink and then you have a reference to stream right there. Then you are creating a v4l2src and linking to a capsfilter. The "stream" element you just referenced there in the middle isn't doing anything sitting there, not being linked to anyone. So this is invalid syntax and it fails.



          I believe you actually don't want the tee element, so you could entirely remove it and its references. This is what tee is useful for: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-tee.html



          Additionally, you could also have 2 separate pipelines, one for each camera. Doing it on one or two depends on how you want to manage and if they need to share some pipeline-related data, such as a clock. But that depends on your use case which I don't know deeply.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 5 at 21:51









          thiagossthiagoss

          1011




          1011













          • Thanks for your answer, the piece of code you commented about is from the topic that i linked, its not mine, i just used it as a base to create mine

            – Bruno Cerk
            Feb 7 at 12:09











          • The sample you mentioned (the 2nd one). Also contains the stream element.

            – thiagoss
            Feb 7 at 20:19



















          • Thanks for your answer, the piece of code you commented about is from the topic that i linked, its not mine, i just used it as a base to create mine

            – Bruno Cerk
            Feb 7 at 12:09











          • The sample you mentioned (the 2nd one). Also contains the stream element.

            – thiagoss
            Feb 7 at 20:19

















          Thanks for your answer, the piece of code you commented about is from the topic that i linked, its not mine, i just used it as a base to create mine

          – Bruno Cerk
          Feb 7 at 12:09





          Thanks for your answer, the piece of code you commented about is from the topic that i linked, its not mine, i just used it as a base to create mine

          – Bruno Cerk
          Feb 7 at 12:09













          The sample you mentioned (the 2nd one). Also contains the stream element.

          – thiagoss
          Feb 7 at 20:19





          The sample you mentioned (the 2nd one). Also contains the stream element.

          – thiagoss
          Feb 7 at 20:19


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1401962%2fgstreaming-two-web-cams-over-tcp%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

          Список кардиналов, возведённых папой римским Каликстом III

          Deduzione

          Mysql.sock missing - “Can't connect to local MySQL server through socket”