UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to connect a webcam

    Scheduled Pinned Locked Moved General
    10 Posts 3 Posters 1.7k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • mihaelM Offline
        mihael
        last edited by mihael

        If I connect a usb web cam to my Meizu Pro 5 UBports 15.04 edition, how can a view the image on my device screen?

        I installed cheese but it does not run giving an error of not being able to connect to the Mir server.

        1 Reply Last reply Reply Quote 0
        • G Offline
          guru
          last edited by

          Try using http://appear.in and see if the browser uses your additional cam too.

          1 Reply Last reply Reply Quote 0
          • mihaelM Offline
            mihael
            last edited by

            @guru Thanks for the idea! I did not subscribe to appear.in but I found another website that would let me access my webcam through the browser. Still, only the front camera of the phone was available in that test. Does appear.in let you choose the camera you want to use on mobile?

            1 Reply Last reply Reply Quote 0
            • G Offline
              guru
              last edited by

              When I do a connect with some USB cam, in /var/log/syslog the following lines show up:

              Jan 25 11:26:57 ubuntu-phablet kernel: [63770.026862][USBPHY]slew calibration:FM_OUT =329,x=4183,value=4
              Jan 25 11:26:57 ubuntu-phablet kernel: [63770.605713]usb 1-1: new full-speed USB device number 3 using musb-hdrc
              

              and a new device is created in /dev:

              phablet@ubuntu-phablet-bq:~$ ls -ltr /dev/usb*
              crw------- 1 root root 189,  0 Jan 23 20:37 /dev/usbdev1.1
              crw-rw---- 1 root root  10, 20 Jan 23 20:37 /dev/usb_accessory
              phablet@ubuntu-phablet-bq:~$ ls -ltr /dev/usb*
              crw------- 1 root root 189,  0 Jan 23 20:37 /dev/usbdev1.1
              crw-rw---- 1 root root  10, 20 Jan 23 20:37 /dev/usb_accessory
              crw------- 1 root root 189,  3 Jan 25 11:28 /dev/usbdev1.3   <********* new
              

              Connecting the browser to appear.in does not let you select any device and I have no idea about what else could be used to get the movie to the (MIR-) screen. Linux' vlc would be my first guess on any desktop system with X11.

              mihaelM 1 Reply Last reply Reply Quote 0
              • mihaelM Offline
                mihael @guru
                last edited by

                @guru Oh, when I connect my usb cam, the /var/log/syslog says "Device not responding to set address" and no new device is created in /dev/usb* ...

                G 1 Reply Last reply Reply Quote 0
                • G Offline
                  guru @mihael
                  last edited by

                  @mihael I have to admit, that this BQ E4.5 still runs the latest OTA of Canonical. The UBports BQ E4.5 I do have too, sits at home, I will try it later/tomorrow.

                  mihaelM 1 Reply Last reply Reply Quote 0
                  • mihaelM Offline
                    mihael @guru
                    last edited by

                    @guru Thank you for offering to help with this. I have a usb endoscope camera that I want to use and that is why I would like to view it on my phone.

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      doniks
                      last edited by

                      maybe the media player app can be hacked into submission to show the camera rather than a file

                      https://github.com/ubports/mediaplayer-app/blob/master/src/mediaplayer.cpp#L128

                      that is, IF the device is setup by the OS

                      1 Reply Last reply Reply Quote 0
                      • mihaelM Offline
                        mihael
                        last edited by

                        I have no idea which devices are my cams. There are so many /dev/video* ...

                        1 Reply Last reply Reply Quote 0
                        • G Offline
                          guru
                          last edited by guru

                          Btw: I have no /dev/vi* device at all, not in my BQ E4.5 running Canonical's UT, and not in the UBport's one.

                          I pluged today a cam into the latter and the result is the same:

                          phablet@ubuntu-phablet:~$ ls -l /dev/vi*
                          ls: cannot access /dev/vi*: No such file or directory
                          phablet@ubuntu-phablet:~$ ls -l /dev/usb*
                          crw-rw---- 1 root root  10, 20 Jan 26 07:59 /dev/usb_accessory
                          crw------- 1 root root 189,  0 Jan 26 07:59 /dev/usbdev1.1
                           
                          (plugin)
                           
                          an 26 08:03:28 ubuntu-phablet kernel: [  222.669106][USBPHY]slew calibration:FM_OUT =329,x=4183,valu
                          e=4
                          Jan 26 08:03:29 ubuntu-phablet kernel: [  223.247221]usb 1-1: new full-speed USB device number 2 usi
                          ng musb-hdrc
                           
                           
                          phablet@ubuntu-phablet:~$ ls -l /dev/usb*
                          crw-rw---- 1 root root  10, 20 Jan 26 07:59 /dev/usb_accessory
                          crw------- 1 root root 189,  0 Jan 26 07:59 /dev/usbdev1.1
                          crw------- 1 root root 189,  1 Jan 26 08:03 /dev/usbdev1.2
                          

                          Over the night I got an answer in the old ubuntu-phone mailing list, her it is:

                          Date: Thu, 25 Jan 2018 20:36:33 +0100                                                               
                          From: Christoph Schulz <ch.schulz@joinout.de>                                                       
                          To: ubuntu-phone@lists.launchpad.net                                                                
                          Subject: Re: [Ubuntu-phone] connecting an USB video cam to the BQ E4.5 -- how to view the video  stream?
                          ...
                          Maybe QtMultimedia detects the webcam and you can use it from there?
                          
                          $ cat >cameras.qml <<EOT
                          import QtQuick 2.4
                          import QtMultimedia 5.6
                          
                          ListView {
                            model: QtMultimedia.availableCameras
                            delegate: Text {
                              text: "id: " + modelData.id + ", name: " + modelData.displayName
                            }
                          }
                          EOT
                          
                          $ cat >$HOME/.local/share/applications/cameras.desktop <<EOT
                          [Desktop Entry]
                          Name=Camera List
                          Exec=qmlscene $HOME/cameras.qml
                          Type=Application
                          X-Ubuntu-Touch=true
                          EOT
                          
                          Then refresh your app scope and start it from there and see if there
                          are more than the two default cameras (front/back).
                          
                          My E4.5's output:
                          
                            id: undefined, name: Camera 0 Back facing
                            id: undefined, name: Camera 1 Front facing
                          
                          Hope this helps.
                          

                          For the moment this is all. No 🙂

                          I followed the advice of Christoph, and it shows only the two mentioned cams (Back and Front).

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post