Tested a chinese endoscope camera with the jp2, I can see the camera and it adds /dev/video3, /dev/video4
# lsusb
Bus 001 Device 002: ID 1bcf:0b15 Sunplus Innovation Technology Inc. SPCA2650 PC Camera
However there is nothing on the device to do much with it by default. (And I also tried the various apps on the various repos, but I think their issue is that they are not for general display of v4l2 devices.)
If you have v4l2-ctl you could query the cameras etc, but it is not available by default on sfos.
There seems to be a v4l-utils package for sfos (GitHub - sailfishos-native/v4l-utils: libv4l2 packaging for mer-core · GitHub) but build.sailfishos.org is down, so I compiled it myself with sailfish-sdk build-engine:
git clone https://github.com/sailfishos-native/v4l-utils.git
cd v4l-utils/
git submodule update --init --recursive
/path/to/sailfish-sdk/bin/sfdk -c target="SailfishOS-5.1.0.11-aarch64" build-init
/path/to/sailfish-sdk/bin/sfdk -c target="SailfishOS-5.1.0.11-aarch64" -c specfile=rpm/v4l-utils.spec build
and copied them from the dir RPMS/ to the phone and installed:
pkcon install-local libv4l-1.26.1+git3-1.aarch64.rpm libdvbv5-1.26.1+git3-1.aarch64.rpm v4l-utils-1
.26.1+git3-1.aarch64.rpm
And I could query the device:
# v4l2-ctl -d 3 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'MJPG' (Motion-JPEG, compressed)
Size: Discrete 1280x720
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 1280x712
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 1280x480
Interval: Discrete 0.050s (20.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x472
Interval: Discrete 0.033s (30.000 fps)
[1]: 'YUYV' (YUYV 4:2:2)
Size: Discrete 1280x720
Interval: Discrete 0.100s (10.000 fps)
Size: Discrete 1280x712
Interval: Discrete 0.100s (10.000 fps)
Size: Discrete 1280x480
Interval: Discrete 0.100s (10.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.100s (10.000 fps)
Size: Discrete 640x472
Interval: Discrete 0.100s (10.000 fps)
Now that I identified the correct dev, I tried to show the image with gst-launch-1.0 v4l2src device=/dev/video3 ! autovideosink and it seems to correctly turn on etc. but the video stream did not appear anywhere on sfos.
I managed to save a stream to a .avi though with gst-launch-1.0 v4l2src device=/dev/video3 ! jpegenc ! avimux ! filesink location=test.avi. It played fine with mvp with my quick testing.