v4l2loopback sink may only support a subset of jpeg encoding, especially colorspace and sof marker.
Beforehand, if running R32.6, the v4l2loopback-dkms packaged version 0.10.0 may not work properly for this case (seems 0.10.0 is working with R32.5.1, though).
You may have to build and install either 0.9.1 or 0.12.5 version.
Here is how to install 0.12.5 version in case you would not be familiar with this :
# log in as root
sudo su
# update apt sources list and install dkms package
apt update
apt install dkms
# get v4l2loopback sources
cd /usr/src
git clone https://github.com/umlaeute/v4l2loopback.git v4l2loopback
# Checkout tag 0.12.5
cd v4l2loopback
git checkout v0.12.5
# back to /usr/src, and create a symbolic as expected by dkms
cd ..
ln -s v4l2loopback v4l2loopback-0.12.5
# ready for dkms to build and install module
dkms build -m v4l2loopback/0.12.5
dkms install -m v4l2loopback/0.12.5
# now you should have freshly built module /lib/modules/4.9.253-tegra/updates/dkms/v4l2loopback.ko
# load v4l2loopback module
rmmod v4l2loopback
modprobe v4l2loopback && dmesg | tail -n 1
exit
Now you would use a pipeline similar to the following converting a ZED camera (video1) in 1344x376p30 into a JPEG v4l2loopback (video2), using nvjpegenc producing jpeg with sof-marker=4 and colorspace bt601 or bt709 and using multipart mux/demux to convert into colorspace 2:4:7:1 and sof-marker 0 as expected by v4l2sink:
gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,format=YUY2,width=1344,height=376,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvjpegenc ! multipartmux ! multipartdemux single-stream=1 ! 'image/jpeg, parsed=(boolean)true, width=(int)1344, height=(int)376, colorimetry=(string)2:4:7:1, framerate=(fraction)30/1,sof-marker=(int)0' ! v4l2sink device=/dev/video2 -v
You would adapt the resolution, framerate and input format for your usb camera.
Check result with :
gst-launch-1.0 -e v4l2src device=/dev/video2 ! jpegdec ! videoconvert ! xvimagesink
# or, using HW decoder
gst-launch-1.0 -e v4l2src device=/dev/video2 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! xvimagesink