v4l2looback
commands to install v4l2loopback
sudo rmmod v4l2loopback.ko
sudo insmod v4l2loopback.ko video_nr=12 max_buffers=2 exclusive_caps=1 card_label="VirtualCam"
Other commands
sudo modprobe v4l2loopback video_nr=12 max_buffers=2 exclusive_caps=1 card_label="VirtualCam"
sudo modprobe v4l2loopback video_nr="12"\
'card_label=VirtualCam' \
exclusive_caps=1 max_buffers=2
gst-launch-1.0 videotestsrc ! \
video/x-raw, format=YUY2, width=320, height=240 ! \
xvimagesink
gst-launch-1.0 v4l2src device=/dev/video12 ! autovideosink
gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video12
gst-launch-1.0 -v videotestsrc ! navigationtest ! v4l2sink device=/dev/video12
gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg, width=1920, height=1080, framerate=20/1 ! tee ! v4l2sink device=/dev/video12
sudo gst-launch-1.0 -v videotestsrc pattern=ball ! "video/x-raw,width=640,height=480,framerate=10/1" ! avenc_mjpeg ! v4l2sink device=/dev/video1
```
# check device
v4l2-ctl --all -d /dev/video12
## outout of good device
v4l2-ctl --all -d /dev/video12
Driver Info (not using libv4l2):
Driver name : v4l2 loopback
Card type : VirtualCam
Bus info : platform:v4l2loopback-000
Driver version: 4.9.140
Capabilities : 0x85208001
Video Capture
Video Memory-to-Memory
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x85208001
Video Capture
Video Memory-to-Memory
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Priority: 0
Video input : 0 (loopback: ok)
Format Video Capture:
Width/Height : 320/240
Pixel Format : 'YUYV'
Field : None
Bytes per Line : 640
Size Image : 153600
Colorspace : sRGB
Transfer Function : sRGB
YCbCr/HSV Encoding: ITU-R 601
Quantization : Limited Range
Flags :
Format Video Output:
Width/Height : 320/240
Pixel Format : 'YUYV'
Field : None
Bytes per Line : 640
Size Image : 153600
Colorspace : sRGB
Transfer Function : sRGB
YCbCr/HSV Encoding: ITU-R 601
Quantization : Limited Range
Flags :
Streaming Parameters Video Capture:
Frames per second: 30.000 (30/1)
Read buffers : 2
Streaming Parameters Video Output:
Frames per second: 30.000 (30/1)
Write buffers : 2
User Controls
keep_format 0x0098f900 (bool) : default=0 value=0
sustain_framerate 0x0098f901 (bool) : default=0 value=0
timeout 0x0098f902 (int) : min=0 max=100000 step=1 default=0 value=0
timeout_image_io 0x0098f903 (bool) : default=0 value=0
## output of bad device
Driver Info (not using libv4l2):
Driver name : v4l2 loopback
Card type : VirtualCam
Bus info : platform:v4l2loopback-012
Driver version: 4.9.255
Capabilities : 0x85200002
Video Output
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x05200002
Video Output
Read/Write
Streaming
Extended Pix Format
Priority: 2
Video output: 0 (loopback in)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'JPEG'
Field : None
Bytes per Line : 0
Size Image : 1228800
Colorspace : SMPTE 170M
Transfer Function : Rec. 709
YCbCr/HSV Encoding: ITU-R 601
Quantization : Limited Range
Flags :
Format Video Output:
Width/Height : 640/480
Pixel Format : 'JPEG'
Field : None
Bytes per Line : 0
Size Image : 1228800
Colorspace : SMPTE 170M
Transfer Function : Rec. 709
YCbCr/HSV Encoding: ITU-R 601
Quantization : Limited Range
Flags :
Streaming Parameters Video Capture:
Frames per second: 30.000 (30/1)
Read buffers : 2
Streaming Parameters Video Output:
Frames per second: 30.000 (30/1)
Write buffers : 2
User Controls
keep_format 0x0098f900 (bool) : default=0 value=0
sustain_framerate 0x0098f901 (bool) : default=0 value=0
timeout 0x0098f902 (int) : min=0 max=100000 step=1 default=0 value=0
timeout_image_io 0x0098f903 (button) : flags=write-only, execute-on-write
# send and receive video rtp
* send
gst-launch-1.0 v4l2src device=/dev/video12 ! decodebin ! videoconvert ! omxh264enc ! video/x-h264,stream-format=byte-stream ! rtph264pay ! udpsink host=192.168.104.214 port=5000
* receive
gst-launch-1.0 -v udpsrc port=5000 caps=application/x-rtp ! rtph264depay ! avdec_h264 ! autovideosink