linux-pipewire: Support MJPEG and H264 devices#11371
Conversation
e84c7b6 to
5d60e66
Compare
397bd5a to
dae65cb
Compare
dae65cb to
a9699a1
Compare
|
tested this patch on top of gentoo obs-studio-9999 package and it worked for me so far. One little thing: My use case is I can't change resolutions on pipewire-v4l2 so I use obs to change resolution and now video formats. Now I can select 1080p@30fps. I would recommend to test this patch using other software running at the same time. Thank you, now I can go to work meetings using 1080p before it defaults to 640x480. PS: |
|
Just tested this for my use case in #10180 and it seems to be working very well for MJPEG! Turns out my stream from gphoto2 was raw jpeg and not MJPEG though so I still needed to do some encoding to test 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 \
! jpegdec \
! jpegenc \
! jpegparse \
! queue \
! pipewiresink stream-properties="$pipewire_sink_props" |
|
@dimtpap would you mind resolving the merge conflicts please? |
a9699a1 to
b1edc1c
Compare
|
For the record I'm waiting for #11741 so I can finish and undraft this |
|
@dimtpap I've discovered that I sometimes get a segfault when switching between scene collections when a PipeWire MJPEG source is used. Steps to reproduce:
I ran OBS in GDB and reproduced the segfault, here's the log for that: Usually it says |
|
@dimtpap there seems to be an issue with this when compiling and running against latest PipeWire. Do you think this needs to be resolved in this PR? |
@ChrisLane - can you provide the results of |
I don't think I'll have the time to provide that I'm afraid, I don't use the same set up any more. |
3465208 to
3e4c838
Compare
I got segfaults like this and in generally when destroying the source because the decoder was destroyed before the stream using it. This is now fixed. |
3e4c838 to
b2cc8d0
Compare
b2cc8d0 to
a465a81
Compare
|
I am very happy to see activity on this PR, because it would solve my Logitech HD Pro Webcam C920 being limited to My impression is that C920s are very common in the wild after the pandemic, and the current experience of using them with OBS on Wayland has a ton of hiccups. So I think this will increase the perceived stability/functionality of Pipewire and OBS on linux for a lot of the people who don't ever open Github. |
a465a81 to
fce7232
Compare
|
Let's get this reviewed! |
|
can confirm it works perfectly with my cheap webcam and capture card |
9d390f2 to
cf556a2
Compare
|
Also note that while working on this I ran into the same problem described in #12779 and had to include that for this to work |
cf556a2 to
8184969
Compare
|
Gentle ping here, just in case it fell through the cracks - otherwise sorry for the noise! :) AFAICS all requested changes in the last review have been addressed and the MR has been rebased on top of #12779 @RytoEX @GeorgesStavracas when you have time, any chance you can have another look? |
8184969 to
519b09c
Compare

Description
With #9771, support was added for the Camera portal. However, code to support MJPEG and H264 devices didn't make it. This PR is basically the code that didn't land + some more to finish it up.
Similarly to the v4l2 plugin, it uses ffmpeg to decode the encoded streams.
Motivation and Context
MJPEG and H264 devices exist
Fixes #10180
Fixes #10994
How Has This Been Tested?
Connected an MJPEG webcam, added the source, video was coming through.
Raw formats worked when converting the MJPEG stream to a raw format using GStreamer.
I couldn't get H264 working with GStreamer, I'd appreciate if someone with an H264 device tested this.
Types of changes
Checklist: