V4L2Loopback Support for NV12 Stream in Chromium?

I am ingesting tx2 data from cameras, doing some processing, overlaying bounding boxes, and outputting that output out to a v4l2loopback(git clone https://github.com/umlaeute/v4l2loopback.git) device which I am showing in a web browser in Chromium. Currently, the camera streams are coming in as NV12 input. We have to color convert those to RGB24(I believe) before we can output to the v4l2loopback device and have it shown in Chromium.

My question is, DO we have to convert to RGB24 or something other than NV12? When we convert, all is well and the camera feeds show up appropriately in Chromium via WebRTC (meaning the exclusive_caps are being recognized by the browser). However, when I switch the output to maintain NV12 format, all I get out is a gray box in the browser. Does anyone have an idea what is going on or have some suggestions for utilizing NV12 OUTPUT to v4l2loopback and chromium?

This is more a v4l2loopback related issue, so you would get better help asking there but providing some expected informations (TX2, your L4T release, Ubuntu and Linux kernel version, your v4l2loopback version) and easy way to reproduce such as with gstreamer (give also gstreamer version).

I indeed see that any NV* format can’t run while I420 works fine with v4l2loopback v0.9.1:

<b>uname -a</b>
Linux tegra-ubuntu 4.4.38-tegra #1 SMP PREEMPT Thu May 17 00:15:19 PDT 2018 aarch64 aarch64 aarch64 GNU/Linux

<b>dmesg | grep v4l2loopback</b>
[    6.916433] v4l2loopback driver version 0.9.1 loaded

<b>cat /etc/lsb-release </b>

<b>head -n 1 /etc/nv_tegra_release</b> 
# R28 (release), REVISION: 2.1, GCID: 11272647, BOARD: t186ref, EABI: aarch64, DATE: Thu May 17 07:29:06 UTC 2018

#This fails:
gst-launch-1.0 videotestsrc is-live=true ! 'video/x-raw, format=NV12, framerate=30/1' ! tee ! v4l2sink device=/dev/video2

#This works:
gst-launch-1.0 videotestsrc is-live=true ! 'video/x-raw, format=I420, framerate=30/1' ! tee ! v4l2sink device=/dev/video2

This piece of evidence might help them to reproduce and investigate better than your piece of code they don’t know about.


I have asked there before with no response. I will try again. What are your videotestsrc’s supposed to show? All i see from both of those streams are color bars and snow in the bottom right corner (when viewed using guvcview -d /dev/video2.

This is the normal behavior of videotestsrc. It serves as default video source and has a lot of formats available. Some pipelines fail saying an internal error happened in this plugin, but in some cases the error may be caused by one plugin but detected by or crashing another one.

Interesting. Both of those work in the terminal, but only the i420 is recognized as an output device in chromium.

gst-launch-1.0 videotestsrc is-live=true ! 'video/x-raw, format=NV12, framerate=30/1' ! tee ! v4l2sink device=/dev/video2
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

You may share your config, especially v4l2loopback version. It may explain the difference.
Still unusable, but this may give some tracks for investigating.

I notice in the issue you’ve created (may be adding a new post to the previous topic would have been better) that you mention 0.12.0.
[EDIT: Sorry, just understood now you’ve edited your previous post, which is fine.]
Not sure it’s related, but you read also read this topic.