Giter Site home page Giter Site logo

Comments (3)

madebr avatar madebr commented on July 17, 2024

On Fedora 39, it looks like pipewire uses v4l2 behind the scenes:

$ SDL_CAMERA_DRIVER=v4l2 test/testcamera --trackmem
INFO:   - Camera #0:  HD WebCam: HD WebCam
$ SDL_CAMERA_DRIVER=pipewire test/testcamera --trackmem
INFO:   - Camera #0:  HD WebCam (V4L2)

The camera device name is a bit counter-intuitive here.

from sdl.

1bsyl avatar 1bsyl commented on July 17, 2024

with pipe wire, I got

INFO: Saw 0 camera devices.
INFO: No cameras available?

not sure what to configure to get it working ...

from sdl.

Green-Sky avatar Green-Sky commented on July 17, 2024

check your config, in my config i have:

context.spa-libs = {
    #<factory-name regex> = <library-name>
    #
    # Used to find spa factory names. It maps an spa factory name
    # regular expression to a library name that should contain
    # that factory.
    #
    audio.convert.* = audioconvert/libspa-audioconvert
    avb.*           = avb/libspa-avb
    api.alsa.*      = alsa/libspa-alsa
    api.v4l2.*      = v4l2/libspa-v4l2
    api.libcamera.* = libcamera/libspa-libcamera
    api.bluez5.*    = bluez5/libspa-bluez5
    api.vulkan.*    = vulkan/libspa-vulkan
    api.jack.*      = jack/libspa-jack
    support.*       = support/libspa-support
    #videotestsrc   = videotestsrc/libspa-videotestsrc
    #audiotestsrc   = audiotestsrc/libspa-audiotestsrc
}

( run pw-config )

You can also run pw-dump and inspect the json to see all available devices (in case SDL does not pick up the video device)
example excerpt:

  {
    "id": 52,
    "type": "PipeWire:Interface:Node",
    "version": 3,
    "permissions": [ "r", "w", "x", "m" ],
    "info": {
      "max-input-ports": 0,
      "max-output-ports": 1,
      "change-mask": [ "input-ports", "output-ports", "state", "props", "params" ],
      "n-input-ports": 0,
      "n-output-ports": 1,
      "state": "suspended",
      "error": null,
      "props": {
        "api.libcamera.location": "front",
        "api.libcamera.path": "\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685",
        "client.id": 34,
        "clock.quantum-limit": 8192,
        "device.api": "libcamera",
        "device.description": "Chicony USB2.0 Camera: Chicony ",
        "device.id": 46,
        "device.name": "libcamera_device.\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685",
        "device.product.name": "Chicony USB2.0 Camera: Chicony ",
        "factory.id": 10,
        "factory.name": "api.libcamera.source",
        "media.class": "Video/Source",
        "media.role": "Camera",
        "node.description": "Built-in Front Camera",
        "node.driver": true,
        "node.name": "libcamera_input.__SB_.PCI0.GP18.XHC0.RHUB.PRT4-4_1.0-04f2_b685",
        "node.nick": "Chicony USB2.0 Camera  Chicony ",
        "node.pause-on-idle": false,
        "object.id": 52,
        "object.path": "libcamera:\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685",
        "object.serial": 55,
        "priority.session": 800
      },
      "params": {
        "PropInfo": [
          {
            "id": "device",
            "description": "The libcamera device",
            "type": "\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685"
          },
          {
            "id": "deviceName",
            "description": "The libcamera device name",
            "type": ""
          },
          {
            "id": "brightness",
            "description": "Brightness",
            "type": { "default": 0.000000, "min": -1.000000, "max": 1.000000 }
          },
          {
            "id": "contrast",
            "description": "Contrast",
            "type": { "default": 1.000000, "min": 0.500000, "max": 2.062500 }
          },
          {
            "id": "saturation",
            "description": "Saturation",
            "type": { "default": 1.000000, "min": 0.000000, "max": 3.125000 }
          }
        ],
        "Props": [
          {
            "device": "\\_SB_.PCI0.GP18.XHC0.RHUB.PRT4-4:1.0-04f2:b685",
            "deviceName": ""
          }
        ],
        "EnumFormat": [
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 640, "height": 480 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 160, "height": 120 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 176, "height": 144 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 320, "height": 240 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 352, "height": 288 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 640, "height": 360 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 640, "height": 480 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 1280, "height": 720 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "mjpg",
            "size": { "width": 1280, "height": 720 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 640, "height": 480 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 160, "height": 120 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 176, "height": 144 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 320, "height": 240 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 352, "height": 288 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 640, "height": 360 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 640, "height": 480 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 1280, "height": 720 }
          },
          {
            "mediaType": "video",
            "mediaSubtype": "raw",
            "format": "YUY2",
            "size": { "width": 1280, "height": 720 }
          }
        ],
        "Format": [ ]
      }
    }
  },

from sdl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.