Thanks to Christian for the guide, here is the gist:
1sudo apt install ffmpeg gphoto2 v4l2loopback-dkms v4l2loopback-utils
1sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2
1➜ gphoto2 --auto-detect
2Model Port
3----------------------------------------------------------
4Sony ILCE-6400 (PC Control) usb:001,017
1gphoto2 --capture-image-and-download
1# Without hardware acceleration
2gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video2
3# With hardware acceleration (I have a NVIDIA RTX 2060)
4gphoto2 --stdout --capture-movie | ffmpeg -hwaccel nvdec -c:v mjpeg_cuvid -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video2
-hwaccel_device 1
for ffmpeg commang. (I got an overview of the cards usage with nvidia-smi
command). This reduces the lagThis is what gave me the least lag. I recommend it over the USB cable
1sudo v4l2-ctl --device=/dev/video0 --all
2Driver Info:
3 Driver name : uvcvideo
4 Card type : MiraBox Video Capture : MiraBox
5 Bus info : usb-0000:02:00.0-7.1.3.4
6 Driver version : 6.12.1
7 Capabilities : 0x84a00001
8 Video Capture
9 Metadata Capture
10 Streaming
11 Extended Pix Format
12 Device Capabilities
13 Device Caps : 0x04200001
14 Video Capture
15 Streaming
16 Extended Pix Format
17Media Driver Info:
18 Driver name : uvcvideo
19 Model : MiraBox Video Capture : MiraBox
20 Serial : 20000130041415
21 Bus info : usb-0000:02:00.0-7.1.3.4
22 Media version : 6.12.1
23 Hardware revision: 0x00000100 (256)
24 Driver version : 6.12.1
25Interface Info:
26 ID : 0x03000002
27 Type : V4L Video
28Entity Info:
29 ID : 0x00000001 (1)
30 Name : MiraBox Video Capture : MiraBox
31 Function : V4L2 I/O
32 Flags : default
33 Pad 0x01000007 : 0: Sink
34 Link 0x02000010: from remote pad 0x100000a of entity 'Extension 4' (Video Pixel Formatter): Data, Enabled, Immutable
35Priority: 2
36Video input : 0 (Camera 1: ok)
37Format Video Capture:
38 Width/Height : 1920/1080
39 Pixel Format : 'MJPG' (Motion-JPEG)
40 Field : None
41 Bytes per Line : 0
42 Size Image : 4147200
43 Colorspace : sRGB
44 Transfer Function : Rec. 709
45 YCbCr/HSV Encoding: ITU-R 601
46 Quantization : Default (maps to Full Range)
47 Flags :
48Crop Capability Video Capture:
49 Bounds : Left 0, Top 0, Width 1920, Height 1080
50 Default : Left 0, Top 0, Width 1920, Height 1080
51 Pixel Aspect: 1/1
52Selection Video Capture: crop_default, Left 0, Top 0, Width 1920, Height 1080, Flags:
53Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1920, Height 1080, Flags:
54Streaming Parameters Video Capture:
55 Capabilities : timeperframe
56 Frames per second: 60.000 (60/1)
57 Read buffers : 0