<div dir="auto">I’m coming back to this finally. I’ve yet to find a solution to v4l2jpegdec not working with this specific make/model camera. It works fine with jpegdec. With v4l2jpegdec there’s no downstream data, observable using identity element, but I do see data upstream using identity. I’m not seeing any errors in dmesg or in the gstreamer output if I up the debug levels. What else can be done to try and figure out why things aren’t working? </div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto"><br></div><div dir="auto">Josh Q</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 13, 2022 at 4:46 PM Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca">nicolas@ndufresne.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le vendredi 13 mai 2022 à 14:28 -0400, Joshua Quesenberry a écrit :<br>
> That seems very confusingly labeled, am I missing something in the below high-level description? From an element's perspective, I wouldn't expect to be outputting to my sink pad (upstream) or capturing from my src pad (downstream).<br>
> <br>
> Src element -> v4l2 sink using output-io-mode ... v4l2 src using capture-io-mode -> Sink element<br>
> <br>
> In this example, should the elements dmabuf-import be on the upstream or<br>
> downstream side? Likewise with the dmabuf? I'm not certain if A) the<br>
> downstream is creating the dmabuf and the upstream is importing it to dump to<br>
> or B) the upstream is creating the dmabuf and the downstream is importing it<br>
> for use... it seems like maybe both work when I try?<br>
<br>
I don't see a pipeline description I could comment on. By default, all v4l2<br>
srcpad are dmabuf exporters. But the sink pad are not automatically importer, as<br>
this code is experimental and need some polishing and testing.<br>
<br>
> <br>
> Thanks!<br>
> <br>
> JQ<br>
> <br>
> -----Original Message-----<br>
> From: Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca" target="_blank">nicolas@ndufresne.ca</a>> <br>
> Sent: Friday, May 13, 2022 8:47 AM<br>
> To: Joshua Quesenberry <<a href="mailto:engnfrc@gmail.com" target="_blank">engnfrc@gmail.com</a>><br>
> Cc: Discussion of the development of and with GStreamer <<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a>><br>
> Subject: Re: Issues Using GStreamer with v4l2 Elements<br>
> <br>
> Le vendredi 13 mai 2022 à 00:52 -0400, Joshua Quesenberry a écrit :<br>
> > Hi Nicolas,<br>
> > <br>
> > Sorry for the late reply, I got covered up with other stuff and am <br>
> > just getting a minute to come back to this.<br>
> > <br>
> > > Just read your post, looks like you are asking about at least two <br>
> > > distinct issue. In one case, v4l2jpegdec does not work at all for <br>
> > > you. There isn't much information, have you considering prepending <br>
> > > jpegparse in front of it ? That may help ? Jpeg V4L2 decoder is <br>
> > > probably one of the least tested decoder in the v4l2 lot.<br>
> > <br>
> > Correct, two separate issues I'm running into.<br>
> > <br>
> > v4l2jpegdec works fine with one camera, but not the other. I'm setting <br>
> > them both up very similarly, so it escapes me what could be different <br>
> > to cause this behavior. I just tried jpegparse in the pipeline just <br>
> > before v4l2jpegdec and that didn't have any effect, still the identity <br>
> > just after the decode is never printed. I also tried dropping down <br>
> > from 1280x720@60fps to 1024x768@30fps to lessen the load a bit and <br>
> > that had no effect either.<br>
> > <br>
> > > In the second issue, it works, but its slow. Could it be that you <br>
> > > are loading the CPU ? v4l2h264enc does not automatically do <br>
> > > zero-copy. You can experimentally enable it passing output-io-mode=dmabuf-import.<br>
> > <br>
> > I suppose it could be GPU load? When I've looked for ways to measure <br>
> > what the GPU is doing, I've unfortunately not found much of <br>
> > significance. The CPU load is quite low during this testing, <10% for <br>
> > the gstreamer pipeline according to htop. I have a pipeline already <br>
> > with the output-io-modes set to dmabuf-import, but before my original <br>
> > post I switched everything back to auto in hopes things may start <br>
> > working appropriately, however that was not the case. Keep in mind <br>
> > that I have an identity in between the source caps and the capssetter, <br>
> > this is where I see the average framerate drop with v4l2h264enc <br>
> > present.<br>
> > <br>
> > I've found that by adding more queues to the pipeline and then setting <br>
> > all queues to have a leaky downstream that the average rate at the <br>
> > source has now climbed back up to what I expected all along, so I'm <br>
> > assuming the issue is a clogged up downstream affecting the upstream <br>
> > as far as the source? After these changes input rate is ~30fps and <br>
> > output to file ~15fps, which is what I'm asking for, and the CPU usage <br>
> > is around ~30%. Playing around with the dmabuf-import option it <br>
> > appears I'm able to get similar rates with a drop in CPU usage to <br>
> > around ~10%, very exciting!<br>
> > <br>
> > How do the v4l2 elements work with queues? What do they do when stuck <br>
> > in between a dmabuf-import src pad and dmabuf sink pad? They don't <br>
> > have io-modes to be specified (at least at the user level) and I don't <br>
> > see a v4l2queue or something of the like. Tomorrow I'll do some more <br>
> > experiments to see which queues that I've added are unnecessary.<br>
> <br>
> M2M elements have two queues, so you have output-io-mode (the sink pad) and capture-io-mode (for the src pad).<br>
> <br>
> > <br>
> > So now, camera #1 not getting through v4l2jpegdec is my major <br>
> > roadblock. Anyone have ideas on how to debug this one or know what <br>
> > could cause this behavior?<br>
> > <br>
> > FYI, I did dump additional information to the RPi Forums question a <br>
> > few days ago, if something else is needed, just let me know.<br>
> > <br>
> > Thanks!<br>
> > <br>
> > JQ<br>
> > <br>
> > On Mon, May 9, 2022 at 4:15 PM Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca" target="_blank">nicolas@ndufresne.ca</a>> wrote:<br>
> > > <br>
> > > Le lundi 09 mai 2022 à 12:04 -0400, Joshua Quesenberry via <br>
> > > gstreamer-devel a écrit :<br>
> > > > Hey Everyone!<br>
> > > > <br>
> > > > I’m having some trouble using the v4l2 elements on an RPi. I’ve <br>
> > > > posted a detailed summary on the Raspberry Pi forum. Can anyone <br>
> > > > lend a hand? I’m not sure how many of you are frequent users of <br>
> > > > the RPi, so figured I’d reach out here in parallel in case the RPi forum isn’t the right audience.<br>
> > > > <a href="https://forums.raspberrypi.com/viewtopic.php?t=334215" rel="noreferrer" target="_blank">https://forums.raspberrypi.com/viewtopic.php?t=334215</a><br>
> > > <br>
> > > Just read your post, looks like you are asking about at least two <br>
> > > distinct issue. In one case, v4l2jpegdec does not work at all for <br>
> > > you. There isn't much information, have you considering prepending <br>
> > > jpegparse in front of it ? That may help ? Jpeg V4L2 decoder is <br>
> > > probably one of the least tested decoder in the v4l2 lot.<br>
> > > <br>
> > > In the second issue, it works, but its slow. Could it be that you <br>
> > > are loading the CPU ? v4l2h264enc does not automatically do <br>
> > > zero-copy. You can experimentally enable it passing output-io-mode=dmabuf-import.<br>
> > > <br>
> > > Nicolas<br>
> > > <br>
> > > > <br>
> > > > Thanks,<br>
> > > > <br>
> > > > JQ<br>
> > > > <br>
> > > > <br>
> > > <br>
> <br>
> <br>
<br>
</blockquote></div></div>