Skip to content

Errors and no video with PipeWire Camera Portal #10180

Closed

Description

@ChrisLane

Operating System Info

Other

Other OS

Arch Linux

OBS Studio Version

Git

OBS Studio Version (Other)

https://aur.archlinux.org/packages/obs-studio-git, commit: 348793b

OBS Studio Log URL

https://obsproject.com/logs/8BTtKV5wC9IrzeGd

OBS Studio Crash Log URL

No response

Expected Behavior

Successful display of my webcam feed that's piped into PipeWire.

Current Behavior

I am able to select my device when I add a "Video Capture Device (PipeWire) (BETA)" source but none of the other dropdowns have values that I can select.

The gphoto2/gstreamer command I use to pipe my webcam feed to pipewire exits with an error when OBS connects. Here's the output:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Capturing preview frames as movie to 'stdout'. Press Ctrl-C to abort.
ERROR: from element /GstPipeline:pipeline0/GstPipeWireSink:pipewiresink0: stream error: no more input formats
Additional debug info:
../pipewire/src/gst/gstpipewiresink.c(543): on_state_changed (): /GstPipeline:pipeline0/GstPipeWireSink:pipewiresink0
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Steps to Reproduce

  1. Connect a camera supported by gphoto2 to the system
  2. Pipe the camera feed to a pipewire sink via gstreamer
  3. Attempt to add the PipeWire camera as a "Video Capture Device (PipeWire) (BETA)" source
    ...

Anything else we should know?

Here's the script I use to pipe the preview feed from my Canon 250D camera to PipeWire.

#!/usr/bin/env bash
set -euo pipefail
sink_name="DSLR"
pipewire_sink_props="p,node.description=$sink_name,node.name=$sink_name,media.role=Camera,media.class=Video/Source"

gphoto2 --stdout --capture-movie \
  | gst-launch-1.0 \
      fdsrc \
      ! decodebin \
      ! pipewiresink stream-properties="$pipewire_sink_props"

This allows my camera to work flawlessly as a webcam in both Firefox and Zoom.

  • Firefox by enabling the media.webrtc.camera.allow-pipewire option
  • Zoom by wrapping the zoom process with pw-v4l2

Activity

  1. ChrisLane commented on Feb 1, 2024

    @ChrisLane
    Author

    @GeorgesStavracas I'm guessing you're the person to ping for this given you submitted the pull request that implemented the feature.

  2. tytan652 commented on Feb 1, 2024

    @tytan652
    Collaborator

    5:40:53.767: [camera-portal] Selected format for 'DSLR'
    15:40:53.767: [pipewire] Stream 0x563fc2a699a0 state: "paused" (error: none)
    15:40:53.770: [pipewire] Stream 0x563fc2a699a0 state: "error" (error: no more input formats)
    15:40:53.770: [pipewire] Error id:4 seq:15 res:-32 (Broken pipe): no more input formats

    My guess is that your stream does not provide YUY2 format, so it's technically not supported.
    The YUY2 format cover most of the camera/webcam scenarios, supporting other formats requires more work and is planned IIRC.

  3. ChrisLane commented on Feb 1, 2024

    @ChrisLane
    Author

    5:40:53.767: [camera-portal] Selected format for 'DSLR'
    15:40:53.767: [pipewire] Stream 0x563fc2a699a0 state: "paused" (error: none)
    15:40:53.770: [pipewire] Stream 0x563fc2a699a0 state: "error" (error: no more input formats)
    15:40:53.770: [pipewire] Error id:4 seq:15 res:-32 (Broken pipe): no more input formats

    My guess is that your stream does not provide YUY2 format, so it's technically not supported. The YUY2 format cover most of the camera/webcam scenarios, supporting other formats requires more work and is planned IIRC.

    You're right, thank you!
    The output from gphoto2 seems to be JPEG frames and I was able to add a conversion to YUY2 in my gstreamer pipeline.
    My working command now looks like this

    #!/usr/bin/env bash
    set -euo pipefail
    
    sink_name="DSLR"
    pipewire_sink_props="p,node.description=$sink_name,node.name=$sink_name,media.role=Camera,media.class=Video/Source"
    gphoto2 --stdout --capture-movie \
      | gst-launch-1.0 \
          fdsrc \
          ! decodebin \
          ! videoconvert \
          ! video/x-raw,format=YUY2 \
          ! pipewiresink stream-properties="$pipewire_sink_props"
  4. ChrisLane commented on Feb 1, 2024

    @ChrisLane
    Author

    Interestingly, I do get similar "no more input formats" errors if I start piping video to pipewire AFTER OBS is already running.

    info: [pipewire] Stream 0x5635e3fcfc60 state: "streaming" (error: none)
    info: [camera-portal] Found device DSLR
    info: [pipewire] Stream 0x7f700c0025c0 state: "unconnected" (error: none)
    info: [camera-portal] streaming camera 'DSLR'
    info: [pipewire] Created stream 0x7f700c0025c0
    info: [pipewire] Stream 0x7f700c0025c0 state: "connecting" (error: none)
    info: [pipewire] Playing stream 0x7f700c0025c0
    info: [pipewire] Stream 0x7f700c0025c0 state: "paused" (error: none)
    info: [pipewire] Stream 0x5635e3fcfc60 state: "paused" (error: none)
    info: [pipewire] Negotiated format:
    info: [pipewire]     Format: 4 (Spa:Enum:VideoFormat:YUY2)
    info: [pipewire]     Size: 1024x576
    info: [pipewire]     Framerate: 0/1
    info: [pipewire] Stream 0x5635e3fcfc60 state: "error" (error: no more input formats)
    error: [pipewire] Error id:2 seq:154 res:-32 (Broken pipe): no more input formats
    info: [pipewire] Stream 0x7f700c0025c0 state: "streaming" (error: none)
    info: [pipewire] Stream 0x7f700c0025c0 state: "paused" (error: none)
    info: [pipewire-camera] Removed device DSLR
    info: [pipewire] Negotiated format:
    info: [pipewire]     Format: 8 (Spa:Enum:VideoFormat:BGRx)
    info: [pipewire]     Modifier: 0x20000002096bb03
    info: [pipewire]     Size: 1920x1080
    info: [pipewire]     Framerate: 0/1
    info: [pipewire] Stream 0x5635e3fcfc60 state: "streaming" (error: none)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions