{"id":1079,"date":"2023-11-02T10:31:41","date_gmt":"2023-11-02T02:31:41","guid":{"rendered":"https:\/\/www.fanyamin.com\/wordpress\/?p=1079"},"modified":"2023-11-02T11:49:47","modified_gmt":"2023-11-02T03:49:47","slug":"v4l2looback","status":"publish","type":"post","link":"https:\/\/www.fanyamin.com\/wordpress\/?p=1079","title":{"rendered":"v4l2looback"},"content":{"rendered":"<h1>commands to install v4l2loopback<\/h1>\n<pre><code>sudo rmmod v4l2loopback.ko\n\nsudo insmod v4l2loopback.ko video_nr=12 max_buffers=2 exclusive_caps=1 card_label=&quot;VirtualCam&quot;<\/code><\/pre>\n<h1>Other commands<\/h1>\n<pre><code>sudo modprobe v4l2loopback video_nr=12 max_buffers=2 exclusive_caps=1 card_label=&quot;VirtualCam&quot;\n\nsudo modprobe v4l2loopback video_nr=&quot;12&quot;\\\n    &#039;card_label=VirtualCam&#039; \\\n    exclusive_caps=1 max_buffers=2\n\ngst-launch-1.0  videotestsrc ! \\\n  video\/x-raw, format=YUY2, width=320, height=240 ! \\\n  xvimagesink\n\ngst-launch-1.0 v4l2src device=\/dev\/video12 ! autovideosink\n\ngst-launch-1.0 videotestsrc ! v4l2sink device=\/dev\/video12\n\n gst-launch-1.0 -v videotestsrc ! navigationtest ! v4l2sink  device=\/dev\/video12\n\n gst-launch-1.0 v4l2src device=\/dev\/video1 ! image\/jpeg, width=1920, height=1080, framerate=20\/1 ! tee ! v4l2sink device=\/dev\/video12  \n\n  sudo gst-launch-1.0 -v videotestsrc pattern=ball ! &quot;video\/x-raw,width=640,height=480,framerate=10\/1&quot; ! avenc_mjpeg ! v4l2sink device=\/dev\/video1\n\n ```\n# check device\n<\/code><\/pre>\n<p>v4l2-ctl --all -d \/dev\/video12<\/p>\n<pre><code>\n## outout of good device\n<\/code><\/pre>\n<p>v4l2-ctl --all -d \/dev\/video12<br \/>\nDriver Info (not using libv4l2):<br \/>\nDriver name   : v4l2 loopback<br \/>\nCard type     : VirtualCam<br \/>\nBus info      : platform:v4l2loopback-000<br \/>\nDriver version: 4.9.140<br \/>\nCapabilities  : 0x85208001<br \/>\nVideo Capture<br \/>\nVideo Memory-to-Memory<br \/>\nRead\/Write<br \/>\nStreaming<br \/>\nExtended Pix Format<br \/>\nDevice Capabilities<br \/>\nDevice Caps   : 0x85208001<br \/>\nVideo Capture<br \/>\nVideo Memory-to-Memory<br \/>\nRead\/Write<br \/>\nStreaming<br \/>\nExtended Pix Format<br \/>\nDevice Capabilities<br \/>\nPriority: 0<br \/>\nVideo input : 0 (loopback: ok)<br \/>\nFormat Video Capture:<br \/>\nWidth\/Height      : 320\/240<br \/>\nPixel Format      : 'YUYV'<br \/>\nField             : None<br \/>\nBytes per Line    : 640<br \/>\nSize Image        : 153600<br \/>\nColorspace        : sRGB<br \/>\nTransfer Function : sRGB<br \/>\nYCbCr\/HSV Encoding: ITU-R 601<br \/>\nQuantization      : Limited Range<br \/>\nFlags             :<br \/>\nFormat Video Output:<br \/>\nWidth\/Height      : 320\/240<br \/>\nPixel Format      : 'YUYV'<br \/>\nField             : None<br \/>\nBytes per Line    : 640<br \/>\nSize Image        : 153600<br \/>\nColorspace        : sRGB<br \/>\nTransfer Function : sRGB<br \/>\nYCbCr\/HSV Encoding: ITU-R 601<br \/>\nQuantization      : Limited Range<br \/>\nFlags             :<br \/>\nStreaming Parameters Video Capture:<br \/>\nFrames per second: 30.000 (30\/1)<br \/>\nRead buffers     : 2<br \/>\nStreaming Parameters Video Output:<br \/>\nFrames per second: 30.000 (30\/1)<br \/>\nWrite buffers    : 2<\/p>\n<p>User Controls<\/p>\n<pre><code>                keep_format 0x0098f900 (bool)   : default=0 value=0\n          sustain_framerate 0x0098f901 (bool)   : default=0 value=0\n                    timeout 0x0098f902 (int)    : min=0 max=100000 step=1 default=0 value=0\n           timeout_image_io 0x0098f903 (bool)   : default=0 value=0<\/code><\/pre>\n<pre><code>\n## output of bad device\n<\/code><\/pre>\n<p>Driver Info (not using libv4l2):<br \/>\nDriver name   : v4l2 loopback<br \/>\nCard type     : VirtualCam<br \/>\nBus info      : platform:v4l2loopback-012<br \/>\nDriver version: 4.9.255<br \/>\nCapabilities  : 0x85200002<br \/>\nVideo Output<br \/>\nRead\/Write<br \/>\nStreaming<br \/>\nExtended Pix Format<br \/>\nDevice Capabilities<br \/>\nDevice Caps   : 0x05200002<br \/>\nVideo Output<br \/>\nRead\/Write<br \/>\nStreaming<br \/>\nExtended Pix Format<br \/>\nPriority: 2<br \/>\nVideo output: 0 (loopback in)<br \/>\nFormat Video Capture:<br \/>\nWidth\/Height      : 640\/480<br \/>\nPixel Format      : 'JPEG'<br \/>\nField             : None<br \/>\nBytes per Line    : 0<br \/>\nSize Image        : 1228800<br \/>\nColorspace        : SMPTE 170M<br \/>\nTransfer Function : Rec. 709<br \/>\nYCbCr\/HSV Encoding: ITU-R 601<br \/>\nQuantization      : Limited Range<br \/>\nFlags             :<br \/>\nFormat Video Output:<br \/>\nWidth\/Height      : 640\/480<br \/>\nPixel Format      : 'JPEG'<br \/>\nField             : None<br \/>\nBytes per Line    : 0<br \/>\nSize Image        : 1228800<br \/>\nColorspace        : SMPTE 170M<br \/>\nTransfer Function : Rec. 709<br \/>\nYCbCr\/HSV Encoding: ITU-R 601<br \/>\nQuantization      : Limited Range<br \/>\nFlags             :<br \/>\nStreaming Parameters Video Capture:<br \/>\nFrames per second: 30.000 (30\/1)<br \/>\nRead buffers     : 2<br \/>\nStreaming Parameters Video Output:<br \/>\nFrames per second: 30.000 (30\/1)<br \/>\nWrite buffers    : 2<\/p>\n<p>User Controls<\/p>\n<pre><code>                keep_format 0x0098f900 (bool)   : default=0 value=0\n          sustain_framerate 0x0098f901 (bool)   : default=0 value=0\n                    timeout 0x0098f902 (int)    : min=0 max=100000 step=1 default=0 value=0\n           timeout_image_io 0x0098f903 (button) : flags=write-only, execute-on-write<\/code><\/pre>\n<pre><code>\n# send and receive video rtp \n * send<\/code><\/pre>\n<p>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<\/p>\n<pre><code>\n * receive\n<\/code><\/pre>\n<p>gst-launch-1.0 -v udpsrc  port=5000 caps=application\/x-rtp ! rtph264depay ! avdec_h264 ! autovideosink<\/p>\n<pre><code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>commands to install v4l2loopback sudo rmmod v4l2loopback.ko sudo insmod v4l2loopback.ko video_nr=12 max_buffers=2 exclusive_caps=1 card_label=&quot;VirtualCam&quot; Other commands sudo modprobe v4l2loopback video_nr=12 max_buffers=2 exclusive_caps=1 card_label=&quot;VirtualCam&quot; sudo modprobe v4l2loopback video_nr=&quot;12&quot;\\ &#039;card_label=VirtualCam&#039; \\ 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 [&hellip;] <a class=\"read-more\" href=\"https:\/\/www.fanyamin.com\/wordpress\/?p=1079\" title=\"Permanent Link to: v4l2looback\">&rarr;Read&nbsp;more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1079","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1079"}],"collection":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1079"}],"version-history":[{"count":8,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1079\/revisions"}],"predecessor-version":[{"id":1087,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1079\/revisions\/1087"}],"wp:attachment":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}