# Video Capture Device (v4l2) plugin



## leonhard (Aug 2, 2014)

Since information about this plugin is spread all over the place (forum threads / mantis bugtracker) this thread aims to gather all information relevant to the v4l2 capture plugin.

*Known Issues*

The framesize/framerate options are currently hardcoded for some devices.
There seem to be problems with devices that need the v4l2compat library.
Interleaved formats are handled incorrectly
Colorspace/Range is currently handled incorrectly (not at all)

*"My device does not work!"*
If you encounter any problems with the capture plugin please make sure your device works with other programs, most notably the "Qt V4L2 Test Utility" that is available in most Distributions with the v4l2 userspace utils package.
In case your device works fine with the test utility but not with the obs plugin please leave a comment in this thread and include a log file and the output of the following command:

```
v4l2-ctl --list-formats
```


*Frequently Asked Questions
Q:* What are "Emulated" Video Formats?
*A:* A v4l2 device may output the video data in different image formats. Obs on the other hand accepts different image formats to use them as a texture. If a format is supported by both the device and obs, the captured data is simply copied.
The v4l2 userspace utilities additionally provide the option of transcoding some formats devices may offer but obs is not able to use directly. The formats listed as "Emulated" are transcoded from a different input format.
On webcams the emulated formats are MJPEG internally most of the time, which is a compressed format. Using those formats can help reduce the needed bandwidth for USB devices and might allow for higher resolutions/framerate.



Spoiler: Recent Changes



2015-04-21 b4a0e79

Added rgb formats supported on newer kernels
2015-02-25 57f32e3

Implemented "dv timing" selection
2015-02-24 aa68111

Implemented "video standard" selection
2014-10-29 10a9133

Improve handling of connecting/disconnecting devices in the properties window.
Some smaller improvements/fixes.
2014-10-15 291b88e

Added (optional) support for udev to detect device removals/additions
2014-09-22 34e2b77

Fixed device capability problems with devices that have more than one device node
Added the 'Leave Unchanged' option for all settings and made that the default
Some internal refactoring of the plugin code
2014-08-14 69b9e72

Added support for selecting inputs
Fixed a Crash and endless Loop
2014-07-29 eecc9ab

The plugin now requires libv4l2, this enables more pixelformats transcoded on the fly
Numerous smaller bugfixes and changes
2014-07-25 94e2bad

Added 720x576 (DV-PAL) to list of fixed resolutions
2014-07-19 eeb6fc6

Added more logging statements to the plugin
Added fixed fallback frame sizes/rates for devices not supporting discrete enumeration
Numerous smaller bugfixes and changes
2014-07-12 1cf19d0

Fixed a bug where obs would hang if a v4l2 source was added without any device attached


----------



## apemax (Aug 5, 2014)

I have a Hauppauge bt848 TV/video capture card and OBS doesn't seem to detect all the video inputs. (composite port, etc.) Log file attached.

Output of:


```
v4l2-ctl --list-formats
```


```
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'GREY'
    Name        : 8 bpp, gray

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'HI24'
    Name        : 8 bpp, dithered color

    Index       : 2
    Type        : Video Capture
    Pixel Format: 'RGBO'
    Name        : 15 bpp RGB, le

    Index       : 3
    Type        : Video Capture
    Pixel Format: 'RGBQ'
    Name        : 15 bpp RGB, be

    Index       : 4
    Type        : Video Capture
    Pixel Format: 'RGBP'
    Name        : 16 bpp RGB, le

    Index       : 5
    Type        : Video Capture
    Pixel Format: 'RGBR'
    Name        : 16 bpp RGB, be

    Index       : 6
    Type        : Video Capture
    Pixel Format: 'BGR3'
    Name        : 24 bpp RGB, le

    Index       : 7
    Type        : Video Capture
    Pixel Format: 'BGR4'
    Name        : 32 bpp RGB, le

    Index       : 8
    Type        : Video Capture
    Pixel Format: 'RGB4'
    Name        : 32 bpp RGB, be

    Index       : 9
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : 4:2:2, packed, YUYV

    Index       : 10
    Type        : Video Capture
    Pixel Format: 'UYVY'
    Name        : 4:2:2, packed, UYVY

    Index       : 11
    Type        : Video Capture
    Pixel Format: '422P'
    Name        : 4:2:2, planar, Y-Cb-Cr

    Index       : 12
    Type        : Video Capture
    Pixel Format: 'YU12'
    Name        : 4:2:0, planar, Y-Cb-Cr

    Index       : 13
    Type        : Video Capture
    Pixel Format: 'YV12'
    Name        : 4:2:0, planar, Y-Cr-Cb

    Index       : 14
    Type        : Video Capture
    Pixel Format: '411P'
    Name        : 4:1:1, planar, Y-Cb-Cr

    Index       : 15
    Type        : Video Capture
    Pixel Format: 'YUV9'
    Name        : 4:1:0, planar, Y-Cb-Cr

    Index       : 16
    Type        : Video Capture
    Pixel Format: 'YVU9'
    Name        : 4:1:0, planar, Y-Cr-Cb
```


----------



## leonhard (Aug 5, 2014)

Thank you for the report, as you already noticed there is currently no option for choosing the input. I'll try to implement support for that in the future.


----------



## apemax (Aug 6, 2014)

No problem, Ok cool.


----------



## leonhard (Aug 14, 2014)

Support for selecting an Input was merged to master with some bug fixes. Setting framesize/rate through the videostandard API is next on the list. If you find some time to test your devices again and report back if something changed for you, that would be highly appreciated.


----------



## a264164 (Sep 12, 2014)

Hi, 

I have found some problem on v4l2 , too ...on Easycap DC60+ 
when I try to Add a Video Capture Device (V4L2) on sources tab
...
Then I select "Video Capture Device (V4L2)" on "Create New" tab 

....
Then a new windows comes up but I can't make any changes (eg: changed S-Video to Composite Video) at all (except close the windows)

The screen cap is the following: (included in this message)






And at the same time... the log shows:

01:35:37 HKT: v4l2-input: Found device 'EM2860/SAA711X Reference Design' at /dev/vbi0
01:35:37 HKT: v4l2-input: Found device 'EM2860/SAA711X Reference Design' at /dev/video0
01:35:37 HKT: v4l2-input: Start capture from /dev/vbi0
01:35:38 HKT: v4l2-input: Unable to set format
01:35:38 HKT: v4l2-input: Initialization failed
01:35:38 HKT: source 'Video Capture Device (V4L2)' (v4l2_input) created
01:35:38 HKT: v4l2-input: Found device 'EM2860/SAA711X Reference Design' at /dev/vbi0
01:35:38 HKT: v4l2-input: Found device 'EM2860/SAA711X Reference Design' at /dev/video0
01:35:38 HKT: v4l2-input: Found input 'S-Video'
01:35:38 HKT: v4l2-input: Found input 'Composite1'
01:35:38 HKT: v4l2-input: Stepwise and Continuous framesizes are currently hardcoded
01:35:38 HKT: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
01:35:38 HKT: v4l2-input: Stepwise and Continuous framesizes are currently hardcoded
01:35:38 HKT: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
01:35:38 HKT: v4l2-input: Stepwise and Continuous framesizes are currently hardcoded
01:35:38 HKT: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
(...endless)

Kindly check this and waiting an better version coming


----------



## leonhard (Sep 15, 2014)

@codythedragomdude @a264164: This should hopefully be fixed in my pr if you don't mind checking that out: https://github.com/jp9000/obs-studio/pull/266
I still need to address some other issues, but i'll update the op when the changes get merged.


----------



## a264164 (Sep 18, 2014)

leonhard said:


> @codythedragomdude @a264164: This should hopefully be fixed in my pr if you don't mind checking that out: https://github.com/jp9000/obs-studio/pull/266
> I still need to address some other issues, but i'll update the op when the changes get merged.


Thanks...
But I'm new to github....how do i apply your pull into my installation? (OBS installed via apt-get command)


----------



## leonhard (Sep 18, 2014)

If you installed from the repository and not from source don't bother unless you are curious and have some free time. The changes should be in the next release, so you'll get them automatically with the next update. Might take a little while though.


----------



## leonhard (Sep 22, 2014)

I updated the op with the changes that just got merged to master, so they should soon be available from the ppa.
The problem with the capture device should be fixed now. Additionally there is a new option ("Leave Unchanged") for all settings, which will cause the plugin to leave that setting when starting the capture.


----------



## leonhard (Sep 25, 2014)

@codythedragomdude could you check if the following steps work for you ?

start obs and add the v4l2 source, set everything to "leave unchanged" and close obs
capture the video in vlc/qv4l2 or any other capture application and close that application
start obs again and check if you have video, if not try changing the image-format first
As far as i can tell from your video it starts the capture fine except when you set a framerate, but there are for some unknown reasons simply no frames retrieved from the device. If you could post a log-file regardless of whether it works or not, that would be highly appreciated.


----------



## ubuntuaddicted (Oct 10, 2014)

i don't know what happened but the adding of video capture devices is GONE from the latest master branch. I just compiled it from git and the option is missing.
Here's my output for the above command however.

```
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUV 4:2:2 (YUYV)

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : MJPEG
```
It's a Logitech C260 webcam. and here's the lsusb -v output
http://paste.ubuntu.com/8530642/


----------



## Jim (Oct 10, 2014)

I'm going to implement a workaround for linux V4L capture at some point.  For unbuffered frame playback I mean.


----------



## bazukas (Oct 10, 2014)

ubuntuaddicted said:


> i don't know what happened but the adding of video capture devices is GONE from the latest master branch. I just compiled it from git and the option is missing.
> Here's my output for the above command however.
> 
> ```
> ...



Do you have libv4l2 development packages installed? I believe it is libv4l-dev on Ubuntu.


----------



## leonhard (Oct 10, 2014)

codythedragomdude said:


> any chance of making a way for obs linux to pickup the blackmagic intensity pro?


Have you tried the way that is described here: http://forum.blackmagicdesign.com/viewtopic.php?f=12&t=3023 ?
Unfortunately there are no v4l2 drivers for this card, just a gstreamer plugin.


----------



## ubuntuaddicted (Oct 11, 2014)

bazukas said:


> Do you have libv4l2 development packages installed? I believe it is libv4l-dev on Ubuntu.


apparently i was missing that package before I compiled obs-studio, maybe you should add that to the INSTALL file as a dependency or optional dependency IF a person has a V4L capture device.

It's not working however, or it's very weird. I've tried to leave everything unchanged, close obs, open guvcview, close guvcview, then open obs-studio again and only IF I choose the exact correct settings it will work. Here's the terminal output trying to get it working if this is useful to you. all thew while it's just a grey screen BUT i see the light on the front of my webcam going on and off.

http://pastebin.com/zCsRucFC

WORK AROUND: to anyone else experiencing this in linux, just open guvcview and use a window capture as a source and choose guvcview video as the window and problem solved.


----------



## ubuntuaddicted (Oct 11, 2014)

codythedragomdude said:


> well i did try that work around i posted the results in the other forum post didint work out so well heres the results
> 
> dragondude@main-desktop:~$ gst-launch-0.10 decklinksrc mode=18 connection=1 ! videoscale ! video/x-raw-yuv,width=1280,height=720 ! v4l2sink device=/dev/video1 sync=false
> Setting pipeline to PAUSED ...
> ...


i don't want to muddy up this forum post so we should really take this to the other forum BUT did you try to run

```
sudo modprobe v4l2loopback
```
and then check each of the video device nodes? then ensure that you choose the correct mode? Answer in the other forum


----------



## leonhard (Oct 11, 2014)

Ok here are some steps i did come up with:

Install the v4l2loopback kernel module (this obviously is specific to your distribution)

create a v4l2 loopback device either as root or with sudo:

```
modprobe v4l2loopback video_nr=9
```
I used "video_nr=9" here so it will create /dev/video9, but you might choose whatever suits you ...

try the gstreamer video test source:

```
gst-launch-1.0 videotestsrc ! video/x-raw,format=YUY2 ! v4l2sink device=/dev/video9
```
again, use your video loopback device, and whatever your gst-launch command is

I don't have a black magic pro so i could not try that, but you might check if that works with gstreamer at all by trying

```
gst-launch-1.0 decklinksrc mode=18 connection=1 ! video/x-raw,format=YUY2,width=1280,height=720 ! autovideosink
```

Some observations i made:

 Specify a "Video Format" in the source properties, otherwise the video will be very choppy and a lot of error messages will be posted.
 trying to open the device in the qv4l2 test utility seems to screw that up, so i need to remove and readd the kernel module
 Getting the gstreamer pipeline to work correctly is kind of hard, so make sure to test with the "autovideosink" device if in doubt

Just for the fun of it:

```
gst-launch-1.0 filesrc location=~/Movies/Aliens.mp4 ! decodebin name=demux \
    demux. ! queue ! videoconvert ! video/x-raw,format=\(string\)YUY2 ! v4l2sink device=/dev/video9 \
    demux. ! queue ! audioconvert ! autoaudiosink
```
again, the video is quite choppy ... but it kind of works

*Update:*
In the source properties set the "Video Format" to something specific like "[YUYV]", that will make the video go smooth


----------



## ubuntuaddicted (Oct 23, 2014)

i finally figured out how to get my Logitech C260 webcam to work using the V4L plugin. I had to set the following
Input = Camera 1
VideoFormat = YV12 (Emulated)
Resolution = 320x240
FPS = 15
Unbuffered video playback


```
./obs 
Attempted path: ../../data/obs-studio/locale/en-US.ini
Attempted path: ../../data/obs-studio/locale.ini
Attempted path: ../../data/obs-studio/license/gplv2.txt
QObject::connect: invalid null parameter
info: OBS 0.6.2-12-gee96d5e-modified (linux)
info: Processor: 4 logical cores
info: Processor: Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz
info: Physical Memory: 7929MB Total
info: Kernel Version: Linux 3.13.0-38-generic
info: Distribution: "Ubuntu" "14.04"
info: audio settings reset:
    samples per sec: 44100
    speakers:        2
    buffering (ms):  100

info: X and Y: 911 484
Backbuffers: 2
Color Format: 3
ZStencil Format: 0
Adapter: 0

info: OpenGL version: 3.2.0 NVIDIA 343.22

info: Created new platform data
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: convert_sampler_info: 1 <= max_anisotropy <= 16 violated, selected: 0, set: 1
info: video settings reset:
    base resolution:   1920x1080
    output resolution: 1280x720
    fps:               60/1
info: output 'default_file_output' (flv_output) created
info: output 'default_stream' (rtmp_output) created
info: encoder 'default_h264' (obs_x264) created
info: encoder 'default_aac' (libfdk_aac) created
info: service 'default_service' (rtmp_custom) created
[image2 @ 0x2094500] Could find no file with with path '/media/500gb1/Dropbox/ubu project new/UBU Stream Overlay [Newest].png' and index in the range 0-4
warning: Failed to open file '/media/500gb1/Dropbox/ubu project new/UBU Stream Overlay [Newest].png': No such file or directory
warning: [image_source: 'overlay'] failed to load texture '/media/500gb1/Dropbox/ubu project new/UBU Stream Overlay [Newest].png'
info: source 'overlay' (image_source) created
info: source 'be right back' (scene) created
error: xcompcap: XCompositeRedirectWindow failed: BadWindow (invalid Window parameter)
info: source 'webcam' (xcomposite_input) created
info: source 'livestreaming' (scene) created
error: xcompcap: XCompositeRedirectWindow failed: BadWindow (invalid Window parameter)
info: source 'borderlands' (xcomposite_input) created
info: source 'testing' (scene) created
info: xshm-input: Geometry 1920x1080 @ 1680,0
info: source 'Screen Capture (XSHM)' (xshm_input) created
info: source 'be_right_back' (image_source) created
info: source 'sine wave test' (scene) created
info: source 'Sinewave Sound Source (Test)' (test_sinewave) created
info: pulse-input: Server name: 'pulseaudio 4.0'
info: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor'
info: source 'Audio Output Capture (PulseAudio)' (pulse_output_capture) created
info: pulse-input: Server name: 'pulseaudio 4.0'
info: pulse-input: Audio format: s16le, 48000 Hz, 1 channels
info: pulse-input: Started recording from 'alsa_input.usb-046d_081a_13339CA0-02-U0x46d0x81a.analog-mono'
info: source 'Audio Input Capture (PulseAudio)' (pulse_input_capture) created
info: v4l2-input: Start capture from /dev/video0
info: v4l2-input: Input: 0
info: v4l2-input: Resolution: 432x240
info: v4l2-input: Pixelformat: 842094169
info: v4l2-input: Linesize: 432 Bytes
info: v4l2-input: Framerate: 30.00 fps
info: source 'Video Capture Device (V4L2)' (v4l2_input) created
info: Update check: latest version is: 0.4.0
info: v4l2-input: Found device 'UVC Camera (046d:081a)' at /dev/video0
info: v4l2-input: /dev/video1 seems to not support video capture
info: v4l2-input: Found input 'Camera 1' (Index 0)
info: v4l2-input: Pixelformat: YUV 4:2:2 (YUYV) (available)
info: v4l2-input: Pixelformat: MJPEG (unavailable)
info: v4l2-input: Pixelformat: RGB3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: BGR3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: YU12 (Emulated) (available)
info: v4l2-input: Pixelformat: YV12 (Emulated) (available)
info: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
info: v4l2-input: Pixelformat: YUV 4:2:2 (YUYV) (available)
info: v4l2-input: Pixelformat: MJPEG (unavailable)
info: v4l2-input: Pixelformat: RGB3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: BGR3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: YU12 (Emulated) (available)
info: v4l2-input: Pixelformat: YV12 (Emulated) (available)
info: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
info: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
info: v4l2-input: Stepwise and Continuous framerates are currently hardcoded
info: v4l2-input: Stopped capture after 0 frames
info: v4l2-input: Start capture from /dev/video0
info: v4l2-input: Input: 0
info: v4l2-input: Resolution: 320x240
info: v4l2-input: Pixelformat: 842094169
info: v4l2-input: Linesize: 320 Bytes
info: v4l2-input: Framerate: 30.00 fps
info: v4l2-input: Stopped capture after 0 frames
info: v4l2-input: Start capture from /dev/video0
info: v4l2-input: Input: 0
info: v4l2-input: Resolution: 320x240
info: v4l2-input: Pixelformat: 842094169
info: v4l2-input: Linesize: 320 Bytes
info: v4l2-input: Framerate: 15.00 fps
info: [x264 encoder: 'default_h264'] preset: medium
info: [x264 encoder: 'default_h264'] settings:
    bitrate:     2000
    buffer size: 2000
    fps_num:     60
    fps_den:     1
    width:       1280
    height:      720
    keyint:      60
    cbr:         on
info: [x264 encoder: 'default_h264'] custom settings: keyint=60
info: libfdk_aac encoder created
info: libfdk_aac bitrate: 128, channels: 2
info: [flv output: 'default_file_output'] Writing FLV file '/home/ubu/Videos/obs-studio/2014-10-22 22-57-38.flv'...
info: v4l2-input: Found device 'UVC Camera (046d:081a)' at /dev/video0
info: v4l2-input: /dev/video1 seems to not support video capture
info: v4l2-input: Found input 'Camera 1' (Index 0)
info: v4l2-input: Pixelformat: YUV 4:2:2 (YUYV) (available)
info: v4l2-input: Pixelformat: MJPEG (unavailable)
info: v4l2-input: Pixelformat: RGB3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: BGR3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: YU12 (Emulated) (available)
info: v4l2-input: Pixelformat: YV12 (Emulated) (available)
info: v4l2-input: Pixelformat: YUV 4:2:2 (YUYV) (available)
info: v4l2-input: Pixelformat: MJPEG (unavailable)
info: v4l2-input: Pixelformat: RGB3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: BGR3 (Emulated) (unavailable)
info: v4l2-input: Pixelformat: YU12 (Emulated) (available)
info: v4l2-input: Pixelformat: YV12 (Emulated) (available)
info: [flv output: 'default_file_output'] FLV file output complete
info: Output 'default_file_output': stopping
info: Output 'default_file_output': Total frames: 4920
info: Output 'default_file_output': Number of skipped frames: 0 (0%)
Attempted path: ../../data/obs-studio/locale.ini
info: Freeing OBS context data
info:     13 user source(s) were remaining
info: source 'be right back' destroyed
info: source 'be_right_back' destroyed
info: source 'livestreaming' destroyed
info: source 'overlay' destroyed
info: source 'borderlands' destroyed
info: source 'webcam' destroyed
info: source 'testing' destroyed
info: source 'Screen Capture (XSHM)' destroyed
info: source 'Audio Output Capture (PulseAudio)' destroyed
info: pulse-input: Stopped recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor'
info: pulse-input: Got 324405 packets with 12459487 frames
info: source 'Audio Input Capture (PulseAudio)' destroyed
info: pulse-input: Stopped recording from 'alsa_input.usb-046d_081a_13339CA0-02-U0x46d0x81a.analog-mono'
info: pulse-input: Got 170737 packets with 13555533 frames
info: source 'Video Capture Device (V4L2)' destroyed
info: v4l2-input: Stopped capture after 3926 frames
info: source 'sine wave test' destroyed
info: source 'Sinewave Sound Source (Test)' destroyed
info: output 'default_stream' destroyed
info: output 'default_file_output' destroyed
info:     2 output(s) were remaining
info: encoder 'default_aac' destroyed
info: libfdk_aac encoder destroyed
info: encoder 'default_h264' destroyed
info:     2 encoder(s) were remaining
info: service 'default_service' destroyed
info:     1 service(s) were remaining
Segmentation fault (core dumped)
```

NOTE: if you can't get your v4l device to work properly than I suggest installing guvcview, running it and than just using Window Capture (XComposite) in OBS as your source and this way you can even crop it if you want


----------



## ZeroLabs (Nov 12, 2014)

Continuing from this thread...
https://obsproject.com/forum/thread...-video-unspecified-error-xubuntu-14-04.21227/
I'm running into problems streaming with OBS in Xubuntu Linux 14.04 using multiple USB web cams to do pic in pic. The error returned when I try to add one too many Video Capture Devices to an OBS Scene is 
	
	
    



```
libv4l2: error turning on stream: No space left on device
```
I have found a wealth of information on this topic at these two web sites...
http://superuser.com/questions/431759/using-multiple-usb-webcams-in-linux
http://stackoverflow.com/questions/11394712/libv4l2-error-turning-on-stream-no-space-left-on-device

Which brings me to the question how can I get my Logitec C270 to use MJPEG instead of YUYV?


----------



## ZeroLabs (Nov 12, 2014)

Okay... from the stackoverflow link, this gets me to where I need to be.
	
	
    



```
sudo rmmod uvcvideo
sudo modprobe uvcvideo quirks=128
```
This will be reset every reboot. Because this works, with *sudo mousepad* I created the following file:
*/etc/modprobe.d/uvcvideo.conf* containing the line: *options uvcvideo quirks=128
*
I now have two, count'em TWO webcams streaming simultaneously picture in picture from my Asus 1215n netbook! Wooo Hooooo!


----------



## leonhard (Nov 12, 2014)

ZeroFossilFuel said:


> Which brings me to the question how can I get my Logitec C270 to use MJPEG instead of YUYV?



Try using one of the Pixelformats marked as "Emulated". Those should be native MJPEG in most cases with the v4l2 userspace library converting them to something obs can handle.


----------



## ZeroLabs (Nov 14, 2014)

leonhard said:


> Try using one of the Pixelformats marked as "Emulated". Those should be native MJPEG in most cases with the v4l2 userspace library converting them to something obs can handle.


Good call! That lowered the resource load greatly.


----------



## ubuntuaddicted (Dec 9, 2014)

any dev interested in getting the the hd-pvr 1212 working with this plugin? sadly it's only component 720p but there's no much out there for us linux users who want to capture external sources.

I have some more info. attempting to use VLC here's some info










but as you can see the video is black. i'm not sure why vlc can't display the video stream from the hdpvr 1212 because according to the mythtv wiki http://www.mythtv.org/wiki/Hauppauge_HD-PVR for hdpvr v4l2-ctl can interact with the device. when I just use cat /dev/videoX > video.ts and then atttempt to play the file back VLC returns this but does still play the file back.

```
[0x210c118] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0x7f0840c01748] ts demux error: MPEG-4 descriptor not found
[0x7f0840ef0368] packetizer_mpeg4audio packetizer: AAC channels: 2 samplerate: 48000
Fontconfig warning: FcPattern object size does not accept value "0"
Fontconfig warning: FcPattern object size does not accept value "0"
Fontconfig warning: FcPattern object size does not accept value "0"
Fontconfig warning: FcPattern object size does not accept value "0"
[0x7f0824001248] main vout display error: Failed to resize display
```
 let me know if you need anymore info.


----------



## mangopuncher (Feb 11, 2015)

Hey all, I've been using Windows to stream my speedruns and I'm frankly sick of Windows (I've been using Linux for most of my computing life). I'm glad to see OBS progressing as it is, but I'd like to investing a capture card that has a good chance of being supported when the time comes. I'm currently looking at Magewell XI USB 3.0. Link: http://www.amazon.com/Magewell-XI100DUSB-HDMI-Video-Capture-Dongle/dp/B00I16VQOY

According to the description from the company it has V4L2 support by default, which is pretty nifty. Is this capture card a good bet? I'd like to know your input. Thanks!


----------



## mangopuncher (Feb 15, 2015)

For those of you wondering how well the Magewell XI100DUSB works, it works perfectly. Right out of the box with no issues so far in Ubuntu 14.04 if anyone is in the future looking to use OBS in linux for speedrunning.


----------



## bazukas (Feb 15, 2015)

mangopuncher said:


> For those of you wondering how well the Magewell XI100DUSB works, it works perfectly. Right out of the box with no issues so far in Ubuntu 14.04 if anyone is in the future looking to use OBS in linux for speedrunning.


Thank you for the feedback!


----------



## ubuntuaddicted (Feb 15, 2015)

mangopuncher said:


> For those of you wondering how well the Magewell XI100DUSB works, it works perfectly. Right out of the box with no issues so far in Ubuntu 14.04 if anyone is in the future looking to use OBS in linux for speedrunning.


does it only do 1080p@30 FPS? Curious because my friend is about to buy the PCIe Avermedia capture card that does 1080p@60


----------



## mangopuncher (Feb 16, 2015)

ubuntuaddicted said:


> does it only do 1080p@30 FPS? Curious because my friend is about to buy the PCIe Avermedia capture card that does 1080p@60



It will do 1080p@60fps just fine (important to me because the game I speedrun is locked at 60fps), the only drawback I can see is that like other professional grade capture cards it will require you to split the HDMI signal in order to play and capture at the same time, no big problem as those are easy to find cheap.


----------



## KingDD83 (Apr 15, 2015)

Any plan/timeline for supporting h264 video from v4l2 devices that support it?  Such as the Logitech c920?


----------



## lorddrachenblut (Jun 4, 2015)

KingDD83 said:


> Any plan/timeline for supporting h264 video from v4l2 devices that support it?  Such as the Logitech c920?



I hope so KingDD83.


----------



## ZeroLabs (Jul 8, 2015)

mangopuncher said:


> Hey all, I've been using Windows to stream my speedruns and I'm frankly sick of Windows (I've been using Linux for most of my computing life). I'm glad to see OBS progressing as it is, but I'd like to investing a capture card that has a good chance of being supported when the time comes. I'm currently looking at Magewell XI USB 3.0. Link: http://www.amazon.com/Magewell-XI100DUSB-HDMI-Video-Capture-Dongle/dp/B00I16VQOY
> 
> According to the description from the company it has V4L2 support by default, which is pretty nifty. Is this capture card a good bet? I'd like to know your input. Thanks!


Holy crap! $300? Man I sure would like to see that come down.


----------



## lorddrachenblut (Jul 8, 2015)

mangopuncher said:


> Hey all, I've been using Windows to stream my speedruns and I'm frankly sick of Windows (I've been using Linux for most of my computing life). I'm glad to see OBS progressing as it is, but I'd like to investing a capture card that has a good chance of being supported when the time comes. I'm currently looking at Magewell XI USB 3.0. Link: http://www.amazon.com/Magewell-XI100DUSB-HDMI-Video-Capture-Dongle/dp/B00I16VQOY
> 
> According to the description from the company it has V4L2 support by default, which is pretty nifty. Is this capture card a good bet? I'd like to know your input. Thanks!



One thing to keep in mind is that this device does not handle hdcp so you will want to track down a HDMI splitter that will strip hdcp


----------



## Radzaquiel (Aug 9, 2015)

I'm wondering...why can't OBS MP handle directly MJPEG with "V4L2_PIX_FMT_MJPEG" instead of going through emulated formats ?
Nowadays, many webcams (720p & +) uses internal MJPEG compression to keep a decent framerate with USB2 connection.

I managed to hack a little for OBS MP to recognize directly MJPEG but when I choose "MJPEG" then, it shows me a frozen pic or a messed one... =/


----------



## lorddrachenblut (Aug 9, 2015)

Radzaquiel said:


> I'm wondering...why can't OBS MP handle directly MJPEG with "V4L2_PIX_FMT_MJPEG" instead of going through emulated formats ?
> Nowadays, many webcams (720p & +) uses internal MJPEG compression to keep a decent framerate with USB2 connection.
> 
> I managed to hack a little for OBS MP to recognize directly MJPEG but when I choose "MJPEG" then, it shows me a frozen pic or a messed one... =/



I hope this is something you can get working.  I'll be watching for news of this


----------



## Radzaquiel (Aug 9, 2015)

lorddrachenblut said:


> I hope this is something you can get working.  I'll be watching for news of this


Well, given my pretty basic knowledge in C/C++, that's not sure I'll be able to finish this ^^'
For exemple, I must first understand why "Pixelformat" string seem inversed in output (VYUY instead of YUYV, GPJM instead of MJPG, etc...) & if it's normal...


----------



## FireStarW (Nov 20, 2015)

Here's some data for a dormant thread on some nameless logitech usb webcam I found at the thrift.
Edit: It's a C200 it looks like
(OBS 1.20.0)

```
ioctl: VIDIOC_ENUM_FMT
   Index  : 0
   Type  : Video Capture
   Pixel Format: 'YUYV'
   Name  : YUYV 4:2:2

   Index  : 1
   Type  : Video Capture
   Pixel Format: 'MJPG' (compressed)
   Name  : Motion-JPEG
```
Edit: Just shows up as grey screen in OBS no matter the settings

Mplayer window capture works at least..


----------



## Terry Knight (Jun 29, 2016)

Logitec C170 webcam not working on OBS 0.14.2 - at best I get one still image capture in OBS. Webcam works fine in V4L2 test, Cheese, VLC and Skype - but can't use these as alternate capture methods because they also freeze up when OBS is started.
(Camera worked fine in 0.13.x)


```
v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUV 4:2:2 (YUYV)

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : MJPEG
```


----------



## ZeroLabs (Jul 5, 2016)

Have you tried YU12 or YV12 emulated formats?


----------



## Terry Knight (Sep 4, 2016)

ZeroFossilFuel said:


> Have you tried YU12 or YV12 emulated formats?


Yes, I've tried both emulations as well as the default - no difference.
I still have the issue in the latest version 0.15.4. Ironically, everything was fine in 0.13.x - it's only since OBS went to 0.14.x and higher that this issue occured.


----------



## Leeo97one (Sep 13, 2016)

https://obsproject.com/forum/threads/53840/


----------



## mtnorbeach (Nov 22, 2016)

Hello, I'm trying to use two Android devices as web cams for live streaming with OBS on my Linux Ubuntu 16.10 laptop. I'm using the IP Webcam app, from the Android Play Store, on both Android devices and this Linux script, on my laptop, to allow OBS to use the web cam video streams: https://github.com/bluezio/ipwebcam-gst/

Each Android device works separately with OBS. 

My problem is that I can't get both Android devices to work with OBS at the same time - either USB wired or wireless.

I have read the script - linked to above - in detail and I have tried making changes to the CONFIG section as suggested within the script.

I have given up trying to get them to both work over wireless at the same time and I'm now trying to get them to work while plugged in via USB.

I have made two copies of the script and tried changing the CONFIG section in each, including each devices adb device id as suggested within the script:...

# 3. Are you plugging several devices into your PC?
#
# By default, the script assumes you're only plugging one device into
# your computer. If you're plugging in several Android devices to your
# computer, you will first need to tell this script which one should
# be used. Run 'adb devices' with only the desired device plugged in,
# and note down the identifer.
#
# Then, uncomment the line that adds the -s flag to ADB_FLAGS below,
# replacing 'deviceid' with the ID you just found, and run the script
# normally.

...and I have uncommented and made changes to the # DEVICE=/dev/video1 line i.e. I have tried uncommenting the line in both scripts and making one device DEVICE=/dev/video1 and the other DEVICE=/dev/video2 - as suggested in the section from the script, included below...

# Loopback device to be used. This only needs to be uncommented if you
# want to skip autodetection (e.g. for multiple webcams):
# DEVICE=/dev/video1

When I uncomment the DEVICE=/dev/video1 it seems to stop the device working at all!

Any help with this would be much appreciated.

Thanks, Mike


----------



## Yagisama (Dec 26, 2016)

Hello, I'm trying to get my Hauppauge HD PVR 1212 to work with OBS.
I am able to add Video Capture Device (V4L2) and see the Hauppauge HD PVR in the list but the screen is just grey.
The HD PVR works with other softwares so I know it's working.

I can record with it by using:

```
$ cat /dev/video0 > test_clip.ts
```

and I can use it together with MPV and see that it's working that way also:

```
$ mpv /dev/video0
```

Here is some other information that might be helpful:

```
$ v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'MPEG' (compressed)
    Name        : MPEG-1/2/4
```


```
03:47:09 PM.879: Processor: 4 logical cores
03:47:09 PM.879: Processor: AMD Phenom(tm) II X4 965 Processor
03:47:09 PM.880: Physical Memory: 7963MB Total
03:47:09 PM.880: Kernel Version: Linux 4.8.15-300.fc25.x86_64
03:47:09 PM.880: Distribution: Fedora 25
03:47:09 PM.880: Portable mode: false
03:47:09 PM.916: OBS 0.16.6 (linux)
03:47:09 PM.916: ---------------------------------
03:47:09 PM.916: ---------------------------------
03:47:09 PM.916: audio settings reset:
03:47:09 PM.916:     samples per sec: 44100
03:47:09 PM.916:     speakers:        2
03:47:10 PM.076: OpenGL version: 3.2.0 NVIDIA 375.26
03:47:10 PM.076:
03:47:10 PM.102: ---------------------------------
03:47:10 PM.102: video settings reset:
03:47:10 PM.102:     base resolution:   1920x1080
03:47:10 PM.102:     output resolution: 1280x720
03:47:10 PM.102:     downscale filter:  Bicubic
03:47:10 PM.102:     fps:               30/1
03:47:10 PM.102:     format:            NV12
03:47:10 PM.102: ---------------------------------
03:47:10 PM.122: No blackmagic support
03:47:10 PM.140: NVENC supported
03:47:10 PM.157: os_dlopen(libvlc.so.5->libvlc.so.5): libvlc.so.5: cannot open shared object file: No such file or directory
03:47:10 PM.157:
03:47:10 PM.157: Couldn't find VLC installation, VLC video source disabled
03:47:10 PM.157: ---------------------------------
03:47:10 PM.157:   Loaded Modules:
03:47:10 PM.157:     vlc-video.so
03:47:10 PM.157:     text-freetype2.so
03:47:10 PM.157:     rtmp-services.so
03:47:10 PM.157:     obs-x264.so
03:47:10 PM.157:     obs-transitions.so
03:47:10 PM.157:     obs-outputs.so
03:47:10 PM.157:     obs-filters.so
03:47:10 PM.157:     obs-ffmpeg.so
03:47:10 PM.157:     linux-v4l2.so
03:47:10 PM.157:     linux-pulseaudio.so
03:47:10 PM.157:     linux-jack.so
03:47:10 PM.157:     linux-decklink.so
03:47:10 PM.157:     linux-capture.so
03:47:10 PM.157:     linux-alsa.so
03:47:10 PM.157:     image-source.so
03:47:10 PM.157:     frontend-tools.so
03:47:10 PM.157: ==== Startup complete ===============================================
03:47:10 PM.158: Service '' not found
03:47:10 PM.166: All scene data cleared
03:47:10 PM.166: ------------------------------------------------
03:47:10 PM.174: pulse-input: Server name: 'pulseaudio 9.0'
03:47:10 PM.174: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
03:47:10 PM.175: pulse-input: Started recording from 'alsa_output.pci-0000_00_14.2.analog-stereo.monitor'
03:47:10 PM.178: pulse-input: Server name: 'pulseaudio 9.0'
03:47:10 PM.178: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
03:47:10 PM.179: pulse-input: Started recording from 'alsa_input.usb-BLUE_MICROPHONE_Blue_Snowball_201011-00.analog-stereo'
03:47:10 PM.179: v4l2-input: Start capture from /dev/video0
03:47:10 PM.181: v4l2-input: Unable to open device
03:47:10 PM.181: v4l2-input: Initialization failed
03:47:10 PM.183: Switched to scene 'Scene'
03:47:10 PM.183: ------------------------------------------------
03:47:10 PM.183: Loaded scenes:
03:47:10 PM.183: - scene 'Scene':
03:47:10 PM.183:     - source: 'Video Capture Device (V4L2)' (v4l2_input)
03:47:10 PM.183: ------------------------------------------------
03:47:10 PM.681: adding 23 milliseconds of audio buffering, total audio buffering is now 23 milliseconds
03:47:10 PM.885: Update check: last known remote version is 0.4.0
03:47:12 PM.130: adding 23 milliseconds of audio buffering, total audio buffering is now 46 milliseconds
03:47:16 PM.038: ==== Shutting down ==================================================
03:47:16 PM.042: Switched to scene '(null)'
03:47:16 PM.191: pulse-input: Stopped recording from 'alsa_output.pci-0000_00_14.2.analog-stereo.monitor'
03:47:16 PM.191: pulse-input: Got 1271 packets with 353215 frames
03:47:16 PM.192: pulse-input: Stopped recording from 'alsa_input.usb-BLUE_MICROPHONE_Blue_Snowball_201011-00.analog-stereo'
03:47:16 PM.192: pulse-input: Got 595 packets with 263771 frames
03:47:16 PM.193: All scene data cleared
03:47:16 PM.193: ------------------------------------------------
03:47:16 PM.269: Freeing OBS context data
03:47:16 PM.279: == Profiler Results =============================
03:47:16 PM.279: run_program_init: 708.106 ms
03:47:16 PM.279:  ┣OBSApp::AppInit: 5.785 ms
03:47:16 PM.279:  ┃ ┗OBSApp::InitLocale: 1.956 ms
03:47:16 PM.279:  ┗OBSApp::OBSInit: 391.304 ms
03:47:16 PM.280:    ┣obs_startup: 1.086 ms
03:47:16 PM.280:    ┗OBSBasic::OBSInit: 317.459 ms
03:47:16 PM.280:      ┣OBSBasic::InitBasicConfig: 0.105 ms
03:47:16 PM.280:      ┣OBSBasic::ResetAudio: 0.114 ms
03:47:16 PM.280:      ┣OBSBasic::ResetVideo: 186.375 ms
03:47:16 PM.280:      ┣OBSBasic::InitOBSCallbacks: 0.005 ms
03:47:16 PM.280:      ┣OBSBasic::InitHotkeys: 0.043 ms
03:47:16 PM.280:      ┣obs_load_all_modules: 54.484 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(frontend-tools.so): 1.608 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(image-source.so): 0.004 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(linux-alsa.so): 0.002 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(linux-capture.so): 0.488 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(linux-decklink.so): 0.178 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(linux-jack.so): 0.003 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(linux-pulseaudio.so): 0.004 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(linux-v4l2.so): 0.005 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(obs-ffmpeg.so): 8.918 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(obs-filters.so): 0.019 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(obs-outputs.so): 0.002 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(obs-transitions.so): 0.011 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(obs-x264.so): 0.001 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(rtmp-services.so): 0.714 ms
03:47:16 PM.280:      ┃ ┣obs_init_module(text-freetype2.so): 0.019 ms
03:47:16 PM.280:      ┃ ┗obs_init_module(vlc-video.so): 1.122 ms
03:47:16 PM.280:      ┣OBSBasic::ResetOutputs: 0.567 ms
03:47:16 PM.280:      ┣OBSBasic::CreateHotkeys: 0.026 ms
03:47:16 PM.280:      ┣OBSBasic::InitService: 0.049 ms
03:47:16 PM.280:      ┣OBSBasic::InitPrimitives: 6.014 ms
03:47:16 PM.280:      ┗OBSBasic::Load: 19.061 ms
03:47:16 PM.280: obs_hotkey_thread(25 ms): min=0.054 ms, median=0.277 ms, max=28.513 ms, 99th percentile=17.447 ms, 99.5935% below 25 ms
03:47:16 PM.280: audio_thread(Audio): min=0 ms, median=0.149 ms, max=0.491 ms, 99th percentile=0.344 ms
03:47:16 PM.280: obs_video_thread(33.3333 ms): min=1.377 ms, median=3.492 ms, max=30.431 ms, 99th percentile=29.68 ms, 100% below 33.333 ms
03:47:16 PM.280:  ┣tick_sources: min=0 ms, median=0.014 ms, max=0.055 ms, 99th percentile=0.02 ms
03:47:16 PM.280:  ┣render_displays: min=0.198 ms, median=1.049 ms, max=27.429 ms, 99th percentile=26.78 ms
03:47:16 PM.280:  ┗output_frame: min=0.753 ms, median=2.333 ms, max=7.707 ms, 99th percentile=6.511 ms
03:47:16 PM.280:    ┣gs_context(video->graphics): min=0.359 ms, median=1.031 ms, max=5.275 ms, 99th percentile=3.93 ms
03:47:16 PM.280:    ┃ ┣render_video: min=0.215 ms, median=0.682 ms, max=4.624 ms, 99th percentile=3.725 ms
03:47:16 PM.280:    ┃ ┃ ┣render_main_texture: min=0.05 ms, median=0.149 ms, max=1.548 ms, 99th percentile=0.914 ms
03:47:16 PM.280:    ┃ ┃ ┣render_output_texture: min=0.003 ms, median=0.193 ms, max=3.094 ms, 99th percentile=1.603 ms
03:47:16 PM.280:    ┃ ┃ ┣render_convert_texture: min=0.002 ms, median=0.158 ms, max=1.034 ms, 99th percentile=0.944 ms
03:47:16 PM.280:    ┃ ┃ ┗stage_output_texture: min=0 ms, median=0.093 ms, max=3.869 ms, 99th percentile=3.193 ms
03:47:16 PM.280:    ┃ ┣download_frame: min=0 ms, median=0.006 ms, max=0.252 ms, 99th percentile=0.09 ms
03:47:16 PM.280:    ┃ ┗gs_flush: min=0.005 ms, median=0.018 ms, max=0.258 ms, 99th percentile=0.104 ms
03:47:16 PM.280:    ┗output_video_data: min=0.52 ms, median=1.281 ms, max=7.166 ms, 99th percentile=2.993 ms
03:47:16 PM.280: video_thread(video): min=0.001 ms, median=0.002 ms, max=0.893 ms, 99th percentile=0.12 ms
03:47:16 PM.280: =================================================
03:47:16 PM.280: == Profiler Time Between Calls ==================
03:47:16 PM.280: obs_hotkey_thread(25 ms): min=25.128 ms, median=25.379 ms, max=53.597 ms, 85.7143% within ±2% of 25 ms (0% lower, 14.2857% higher)
03:47:16 PM.280: obs_video_thread(33.3333 ms): min=32.794 ms, median=33.331 ms, max=33.87 ms, 100% within ±2% of 33.333 ms (0% lower, 0% higher)
03:47:16 PM.280: =================================================
03:47:16 PM.286: Number of memory leaks: 0
```


----------



## cRaZy-bisCuiT (Feb 3, 2017)

Dear Leonhard,

it seems like settings of the Webcams are still hard coded, right? With guvcview I have access to all settings of the Logitech C920. With OBS this (as well as all cameras) are almost unusable, since higher resolutions with higher framerates are not possible since there's a lack of MJPG and h.264. Could you please implement either a non-hard-coded-way or another possiblity to adjust the output?


```
v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUYV 4:2:2

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'H264' (compressed)
    Name        : H.264

    Index       : 2
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : Motion-JPEG
```

Please also have a look in my thread [0] for details about the OBS settings and missing settings. If you need some kind of log, please do let me know!

[0] https://obsproject.com/forum/threads/missing-webcam-settings-for-obs-linux.62671/


----------



## Take Vos (Dec 10, 2017)

I have multiple cameras: a C922 via USB, and a Magewell Pro HDMI, and in the future I am adding another Magewell Pro HDMI 4k.

My issue is that OBS v4l2 plugin stores /dev/video* devices in the preferences file. But at least on my computer the two devices are enumerated in a different order on each reboot.

It is not possible to change the enumeration of /dev/video* devices using udev. It is only possible to add symbolic links to new names in /dev with udev. Neither will OBS work correctly after manually renaming the /dev/video* devices and recreating them in a different order using mknod.

In the end I had to blacklist the USB driver and manually modprobe it from /etc/rc.local. So that the Magewell Pro was recognised first and always be /dev/video0. I am a little bit scared about having two Magewell cards and the order they will be enumerated though.

In any case storing the /dev/video* device names in the preference files is probably not the best way to consistently point to the same actual device.

I am not sure what is better, for me the description strings are different, I have not checked if those can be modified from within udev though. Or maybe a way for people to actually enter a device filename, one which can be created from within udev.


----------



## Take Vos (Dec 16, 2017)

Is it possible to add a few 21:9 resolution options to the v4l2 plugin. I compiled OBS myself and added 2560x1080, which is the resolution of my LG monitor I capture. LG also has another 21:9 monitor with this resolution: 3440x1440.

I have created a pull request for this issue: https://github.com/jp9000/obs-studio/pull/1117


----------



## Kyle1974 (Jan 7, 2018)

Hi
So I have been happily using OBS for a week and have been using different cameras I had laying around. I have just bought two identical webcams for streaming. Now I find that both the 2 new HD cameras work but my old existing webcam cannot be added as a third option? I have tried or I cannot see a preview from it in OBS.

I can use the two new cameras only but it would be nice if I could have my third shot back? Is this a linux issue or my configuration rather than an OBS problem?

This is what I got when I used the v4l2-ctl --list-formats command.

ioctl: VIDIOC_ENUM_FMT
   Index       : 0
   Type        : Video Capture
   Pixel Format: 'MJPG' (compressed)
   Name        : Motion-JPEG

Do I need to include the OBS log file as well? Sorry, I am new to this aspect.

Thanks
Kyle


----------



## leonardocortes (Mar 20, 2018)

No space left on device..... #df -m?


----------



## Harold (Jun 4, 2018)

@xovertheyearsx How did you install OBS?


----------



## nunks (Jul 14, 2018)

Hi, comparing video input options on OBS running both on Windows 8 and Ubuntu Linux 18.04, I noticed the Windows version has a lot more configuration options, like image correction, auto white balance, power line frequency, auto focus etc. Is there any way to incorporate this settings on OBS for Linux as well? My camera supports these settings through v4l2, and I can set them from the command line, but it would be awesome to see them on OBS GUI as well:

I'm using a Logitech C925e camera and OBS versions 21.1.0 (from the official PPA) and 21.1.1-208-g88ee9a0c (I built it to use to try out GloriousEgroll's VAAPI plugin).


```
nunks@konata:~$ uname -a
Linux konata 4.15.0-24-generic #26-Ubuntu SMP Wed Jun 13 08:44:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

nunks@konata:~$ v4l2-ctl --list-devices
Logitech Webcam C925e (usb-0000:00:14.0-4):
        /dev/video1

WebCam SC-13HDL11939N: WebCam S (usb-0000:00:1a.0-1.4):
        /dev/video0

nunks@konata:~$ v4l2-ctl -d /dev/video1 --list-ctrls
                     brightness 0x00980900 (int)    : min=0 max=255 step=1 default=128 value=128
                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=128 value=128
                     saturation 0x00980902 (int)    : min=0 max=255 step=1 default=128 value=128
 white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1
                           gain 0x00980913 (int)    : min=0 max=255 step=1 default=0 value=0
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=2 value=2
      white_balance_temperature 0x0098091a (int)    : min=2000 max=6500 step=1 default=4000 value=4000 flags=inactive
                      sharpness 0x0098091b (int)    : min=0 max=255 step=1 default=128 value=128
         backlight_compensation 0x0098091c (int)    : min=0 max=1 step=1 default=0 value=0
                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=3
              exposure_absolute 0x009a0902 (int)    : min=3 max=2047 step=1 default=250 value=250 flags=inactive
         exposure_auto_priority 0x009a0903 (bool)   : default=0 value=1
                   pan_absolute 0x009a0908 (int)    : min=-36000 max=36000 step=3600 default=0 value=0
                  tilt_absolute 0x009a0909 (int)    : min=-36000 max=36000 step=3600 default=0 value=0
                 focus_absolute 0x009a090a (int)    : min=0 max=250 step=5 default=0 value=0 flags=inactive
                     focus_auto 0x009a090c (bool)   : default=1 value=1
                  zoom_absolute 0x009a090d (int)    : min=100 max=500 step=1 default=100 value=100
```


----------



## YaLTeR (Jul 29, 2018)

Hello!

The cam support works great, however I've the following issue: I have two USB webcams, I'm using both in OBS, but it seems that their order is random every boot, so occasionally the first source starts showing the second webcam and the second source starts showing the first webcam (and I need to manually go into their settings and fix them).

Is there any way of dealing with this? Perhaps storing webcam sources by device name? (I've no idea how it currently works)

Thanks in advance!


----------



## majenko (Aug 3, 2018)

Is there a way of "fixing" cameras to specific sources? I have a couple of USB cameras, but they're not always connected at bootup. Thus, the order they appear in /dev/ changes. OBS seems to store /dev/videoX in the source settings, so the cameras keep switching around and i have to reconfigure my scenes every time to get the right cameras showing in the right places.

It would be much nicer if instead you could select the /dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_4CF27C6F-video-index0 (for example) links so that no matter what order your video devices are detected in (or connected in) you get the same setup. It would make life so much better...

Or is there already a way of "bending" the system to do that by editing some configuration files somewhere?

----

Edit: I found .config/obs-studio/basic/scenes/Untitled.json which contains the selected devices. I changed those to the links instead and it *appears* to work.  Is this the generally accepted method, or is there a better one?


----------



## retanicus (Nov 26, 2018)

Hey all!
So I have an Hauppauge WinTV PVR-150 that doesn't seem to be capturing, I made a post here: https://obsproject.com/forum/threads/hauppauge-wintv-pvr-150-and-ubuntu-16-04.97515/ (however I've been waiting on the mods to make it public since Friday...).

I have details in the post including a dmesg output as well as v4l2-ctl output.  I thought the PVR-150 worked in OBS?  I get audio output from the card, but no matter what I do, I can't seem to get video output. /dev/video32 is the output for the card.


----------



## THG (Feb 4, 2019)

> Colorspace/Range is currently handled incorrectly (not at all)



Any update on this? It would be great to be able to capture with full range. I'm faffing around with ffmpeg itself trying to get that sorted out and would rather be using OBS for ease of use.


----------



## THG (Feb 7, 2019)

I should update that a couple days after posting the above post, this pull request appeared:
https://github.com/obsproject/obs-studio/pull/1648


----------



## DMJC (Feb 27, 2019)

I've got a Logitech Brio 1080p@60fps/4K@30fps webcam.
When I run guvcview I can use 1080p@30/60fps and when I use USB-C I can get 4K. I can also get 1080p/60 in qv4l2. In both cases I get an option for MJPEG. The emulated modes do NOT work with this camera, they deliver only 5 FPS speed in OBS. Only the mode that has MJPEG works at 30/60FPS. In OBS MJPEG is not a selectable option.

Output of Camera formats:
v4l2-ctl --list-formats -d /dev/video2
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

    [0]: 'YUYV' (YUYV 4:2:2)
    [1]: 'MJPG' (Motion-JPEG, compressed)
    [2]: 'NV12' (Y/CbCr 4:2:0)

When I run this camera in OBS I can't select any resolutions above 800x600, despite my canvas being set to 1920x1080. I want to have my camera footage running at 1920x1080 taking up the full canvas area as I intend to use OBS to record videos for Youtube. (I've just tested and found that 1920x1080 runs at 5FPS in OBS).


----------



## ggodlewski (Apr 19, 2019)

I've implemented MJPEG support for v4l2. Then I discovered that emulated modes do what I need. Few hours wasted.
Anyway, if your camera doesn't support emulated modes you can try it: https://github.com/ggodlewski/obs-studio


----------



## vu2tve (Jul 6, 2019)

majenko said:


> Is there a way of "fixing" cameras to specific sources? I have a couple of USB cameras, but they're not always connected at bootup. Thus, the order they appear in /dev/ changes. OBS seems to store /dev/videoX in the source settings, so the cameras keep switching around and i have to reconfigure my scenes every time to get the right cameras showing in the right places.
> 
> It would be much nicer if instead you could select the /dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_4CF27C6F-video-index0 (for example) links so that no matter what order your video devices are detected in (or connected in) you get the same setup. It would make life so much better...
> 
> ...




I would also love to know if there is a "proper" way for this?


----------



## AlexDarkTech (Jul 24, 2019)

I have h.264 1080p vebcam. In OBS It works 720p max. In VLC, ffmpeg and Qt V4L2 test Utility1080p work fine.


```
v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : Motion-JPEG

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'YUYV'
    Name        : YUYV 4:2:2
```


```
v4l2-ctl -d /dev/video1 --list-formats
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'H264' (compressed)
    Name        : H.264
```


----------



## Paul Daniels (Jul 30, 2019)

For those who are trying to set a fixed device for each time the machine reboots and the USB ordering gets randomised;  I found a way to force it;

Edit the json file in your scenes folder (in my case, Untitled.json) and where you see /dev/video0 (1, 2, 3 etc) replace it with the /dev/v4l/by-id/ name path instead, eg;

           "name": "Facecam",
            "private_settings": {},
            "push-to-mute": false,
            "push-to-mute-delay": 0,
            "push-to-talk": false,
            "push-to-talk-delay": 0,
            "settings": {
                "device_id": "/dev/v4l/by-id/usb-046d_C922_Pro_Stream_Webcam_424D78DF-video-index0",
                "framerate": 65566,
                "input": 0,
                "pixelformat": 842094169,
                "resolution": 125830200
            },

A 'fix' for this would be for OBS to let us pick the device source from paths other than /dev/video* ?


----------



## thobl (Mar 26, 2020)

Hi! My device does not work but in "Qt V4L2 Test Utility" (and other programs) it works, so I hope this is the right thread (although the initial comment from leonhard was some years ago).

My device is a Victure AC800 (an action cam). In other application like Zoom it just works out of the box. When I add it as device in OBS, the device dialog lags heavily and I don't get a picture. I did a little bit of debugging and here is what I believe is happening: With pixel format MJPG and 720p resolution, the camera works and I successfully get a preview in the Qt V4L2 Test Utility. However, when trying to  run it with higher resolution or with pixel format YUYV, the camera just crashes. The only way to get it running again is restarting it. This seems to be an issue with the camera and not with OBS. 
Now the problem is: I cannot add the camera to OBS, without OBS trying to show me a preview with some default settings for the camera, which appears to be with pixel format YUYV. This then crashes the camera and I can't change the settings to anything that would work. If my interpretation is correct, then it would already help me, if I could deactivate the preview in the "add video source"-dialog. Or if I could set the pixel format in some configuration file. Is that possible?

OBS log: https://obsproject.com/logs/mUBK2yDdq4bcjAJo


```
$ v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

    [0]: 'YUYV' (YUYV 4:2:2)
    [1]: 'MJPG' (Motion-JPEG, compressed)
    [2]: 'H264' (H.264, compressed)
```


----------



## thobl (Mar 26, 2020)

thobl said:


> Hi! My device does not work but in "Qt V4L2 Test Utility" (and other programs) it works, so I hope this is the right thread (although the initial comment from leonhard was some years ago).
> 
> My device is a Victure AC800 (an action cam). In other application like Zoom it just works out of the box. When I add it as device in OBS, the device dialog lags heavily and I don't get a picture. I did a little bit of debugging and here is what I believe is happening: With pixel format MJPG and 720p resolution, the camera works and I successfully get a preview in the Qt V4L2 Test Utility. However, when trying to  run it with higher resolution or with pixel format YUYV, the camera just crashes. The only way to get it running again is restarting it. This seems to be an issue with the camera and not with OBS.
> Now the problem is: I cannot add the camera to OBS, without OBS trying to show me a preview with some default settings for the camera, which appears to be with pixel format YUYV. This then crashes the camera and I can't change the settings to anything that would work. If my interpretation is correct, then it would already help me, if I could deactivate the preview in the "add video source"-dialog. Or if I could set the pixel format in some configuration file. Is that possible?
> ...



I found out how (and to what value) to change the pixel format in the configuration file. In `~/.config/obs-studio/basic/scenes/<scene-name>.json`, one has to change the line with `"pixelformat"` from `1448695129` (which represents YUYV) to one of `861030210` (for BGR3), `842093913` (for YU12), or `842094169` (for YV12). With this, the Victure AC800 now works in OBS :-).


----------



## caretaker1003 (Apr 7, 2020)

It says no space left on device.


----------



## mxa (May 24, 2020)

caretaker1003 said:


> It says no space left on device.



Usually "no space left on device" means the USB bandwidth is exceeded for this USB bus. This might happen because the devices allocate more bandwidth then they actually need, so multiple cameras on the same bus actually would work but since their allocation is too greedy the sum of the allocations exceeds the total bandwidth.








						Capturing multiple webcams (uvcvideo) with OpenCV on Linux
					

I am trying to simultaneously stream the images from 3 Logitech Webcam Pro 900 devices using OpenCV 2.1 on Ubuntu 11.10. The uvcvideo driver gets loaded for these.  Capturing two devices works fine,




					stackoverflow.com


----------



## ethaniel (Jun 21, 2020)

Hello!

I have a USB HDMI Encoder card. After some time it freezes up, so I have to deauthorize/authorize it again. This leads to recreation of the /dev/video0 entry and I also reset the video source in OBS. However, it's not enough and I have to restart OBS completely to get it to work.

Before restarting OBS:
07:40:39 AM.886: v4l2-input: Start capture from /dev/video0
07:40:39 AM.886: v4l2-input: Unable to open device
07:40:39 AM.886: v4l2-input: Initialization failed

After restarting OBS:
07:43:14 AM.497: v4l2-input: Start capture from /dev/video0
07:43:14 AM.498: v4l2-input: Input: 0
07:43:14 AM.523: v4l2-input: Resolution: 1920x1080
07:43:14 AM.523: v4l2-input: Pixelformat: 3RGB
07:43:14 AM.523: v4l2-input: Linesize: 5760 Bytes
07:43:14 AM.546: v4l2-input: Framerate: 30.00 fps

Any ideas?


----------



## ethaniel (Jun 22, 2020)

ethaniel said:


> I have a USB HDMI Encoder card. After some time it freezes up, so I have to deauthorize/authorize it again. This leads to recreation of the /dev/video0 entry and I also reset the video source in OBS. However, it's not enough and I have to restart OBS completely to get it to work.



I ended up switch to the gstreamer plugin with a virtual v4l2 loopback device which gave me more freedom in handling errors.


----------



## Peter N (Jul 7, 2020)

Having found this thread, I'll repeat the problem I raised last week under the title "Zoom sees v42lsink virtual webcam but doesn't display video". (Beginner's question: Is it possible to delete my earlier message? I don't see any mechanism for this.)

The background is that owing to restricted supplies of webcams in the UK when I first needed to connect to Zoom, I set up a system in which video output from a PiCamera on a Raspberry Pi 4B was sent by a Python script over SSH to my main PC running PCLinuxOS and displayed in a Firefox browser window.  OBS-Studio picked this up in its "Window Capture" mode, and my intention was to use V4L2sink to generate a virtual webcam for input to Zoom.

I've set up v4l2loopback as root with OBS-Studio and obs-v4l2sink (both at version 25.0.8-4) with the command

modprobe v4l2loopback devices=1 label="OBSoutput" exclusive_caps=1

The 'Path to V4L2 Device' in Tools is shown as "/dev/video0"  and its mode is RGB. However, while Zoom sees a webcam which it identifies as "Dummy video device (0x0000)" the Zoom screen is totally black. I've tested the output from OBS-Studio in Qt V4L2 video capture utility, and the video is clearly there. It feels a bit 'so near and yet so far' so if anybody can help a relative beginner to work out what needs to be done, I would be very grateful


----------



## Sensi_claudio (Jul 8, 2020)

I have a MyGica Video Capture in Kubuntu 20.04 i would register only 720x480 and not 720x 576 :










how can I do ?

In Windows 10 it's ok


----------



## Sensi_claudio (Jul 8, 2020)

Sensi_claudio said:


> I have a MyGica Video Capture in Kubuntu 20.04 i would register only 720x480 and not 720x 576 :
> 
> View attachment 58591
> 
> ...


I have solved don't select the resolution, but click on the numbers and type my desired resolution with the Keyboard

As suggested by Zeros.81 in the forum


----------



## Valentina sfs (Aug 7, 2020)

¡Hola! Acabo de instalar v4l2 en obs para usar la cámara virtual para hacer zoom, el zoom reconoce la cámara pero se ve negra :(, prueba vlc y se ve perfecta pero en el zoom es solo negro! Alguien que me pueda ayudar por favor :(


----------



## dhanushx012 (Sep 11, 2020)

I updated the op with the changes that just got merged to master, so they should soon be available from the ppa.


----------



## Leonpm (Nov 7, 2020)

Hi, I'm new to the forum, this November 6, v4l2loopback was updated and I can no longer transmit webcam with obs, in obs it works but when you enter zoom or Google meet the option of Obs webcam does not appear, does anyone know something?
Reinstall the whole system and it still does not work when entering such video calling platforms.
my system information
Ubuntu studio 20.04
Obs 26.0.2
V4l2loopback-dkms 0.12.3-1 ubuntu0.1


----------



## Leonpm (Nov 7, 2020)

Valentina sfs said:


> ¡Hola! Acabo de instalar v4l2 en obs para usar la cámara virtual para hacer zoom, el zoom reconoce la cámara pero se ve negra :(, prueba vlc y se ve perfecta pero en el zoom es solo negro! Alguien que me pueda ayudar por favor :(



Te comparto un pequeño manual que diseñe es una recopilación para hacer funcionar el v4l2, solo que actualmente no lo detectan las plataformas ya que este 6 de noviembre se actualizo y algo pasó estoy investigando pero no encuentro información al respecto.

Proceso de instalación de V4L2.(abres un terminal y ejecutas linea por linea).
sudo apt install v4l2loopback-dkms
sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="OBS Cam"
sudo apt install qtbase5-dev
git clone --recursive https://github.com/obsproject/obs-studio.git
git clone https://github.com/CatxFish/obs-v4l2sink.git
cd obs-v4l2sink
mkdir build && cd build
cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install

Abres Obs y configuras en ->Herramientas -> v4l2 video output -> /dev/video10
                                                                                                          YUV420 y presionas Start
Debería aparecer en las opciones de cámara de la plataformas que uses para video llamada
si al presionar start marca error cierra todo y abres un terminal y ejecutas la siguiente línea actualmente ya no es necesario usarla
pero antes de la actualización si solía usarla.
sudo modprobe v4l2loopback video_nr=10 card_label="OBS Video Source" exclusive_caps=1

Si alguna línea te arroja error checa que te pide y lo solucionas con estas siguientes línea en otro terminal y continuas con la instalación.
1.- Instalar previamente para evitar errores o falta de dependencias: git
      sudo apt-get install git
2.- cmake
      sudo apt-get install cmake
3.- Qt5
      sudo apt-get install qtbase5-dev
4.- libobs-dev
      sudo apt-get install libobs-dev
5.- Esto evita el error LIBOBS no encontrado en el momento en que cmake está recopilando todas las dependencias: ffmpeg
      sudo apt-get install ffmpeg


----------



## Mvube (Nov 16, 2020)

Leonpm said:


> Hi, I'm new to the forum, this November 6, v4l2loopback was updated and I can no longer transmit webcam with obs, in obs it works but when you enter zoom or Google meet the option of Obs webcam does not appear, does anyone know something?
> Reinstall the whole system and it still does not work when entering such video calling platforms.
> my system information
> Ubuntu studio 20.04
> ...


I have the same problem!  I did a reinstall and got OBS working on Skype (720p) and VLC but cannot get working on Zoom or Messenger.  I need it for Zoom urgently.    All was well in my last conference on 1 November 2020 but since the 7th all has been lost.   
Ubuntu 20.04
OBS 26.0.2-modified (linux)
Zoom 5.4.2 (53391.1108)
obs-v4l2sink 0.1.0
V4l2loopback-dkms 0.12.5-1


----------



## vicissitude (Nov 24, 2020)

Issues:
1/ Frame rate settings allow me only 20fps for Aukey PC-W1 although the webcam is capable of 60fps
2/ Camera preview is delayed at anything higher than 848x480 (I can see my eyes blinking)
CPU usage 10%
OBS 26.0.2. Ubuntu
Thanks for any help.

v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture


----------



## vicissitude (Nov 24, 2020)

LOG


			https://obsproject.com/logs/v66JjyOVfqlcB_e1


----------



## AlpineSkate (Dec 3, 2020)

Paul Daniels said:


> For those who are trying to set a fixed device for each time the machine reboots and the USB ordering gets randomised;  I found a way to force it;
> 
> Edit the json file in your scenes folder (in my case, Untitled.json) and where you see /dev/video0 (1, 2, 3 etc) replace it with the /dev/v4l/by-id/ name path instead, eg;
> 
> ...


Even with the current latest version, the hack you describe is still necessary. Anyhow, I'm hopeful it will get fixed in the next release - https://github.com/obsproject/obs-studio/issues/3003


----------



## ykpur (Dec 3, 2020)

Hi, I created a virtual device using v4l2loopback in linux ubuntu and I'm using obs and this v4l2 plugin to stream an image or video to the /dev/video2 that v4l2loopback created. Now everything works so far, but I have issues with the resolution. The image I'm sending is in 1920x1080, the base canvas is in 1920x1080 and the output of obs is in 1920x1080 aswell. The image that can be seen under /dev/video2 e.g. using ffplay is only in 320x240
(if I understand this output of ffplay correctly:
Input #0, video4linux2,v4l2, from '/dev/video2':B sq=    0B f=0/0  
  Duration: N/A, start: 1650.347834, bitrate: 27648 kb/s
    Stream #0:0: Video: rawvideo (NV12 / 0x3231564E), nv12, 320x240, 27648 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
)

I'm starting the v4l2loopback using this command:
    sudo modprobe v4l2loopback exclusive_caps=1 video_nr=$videoNumber  card_label="virtualCam"
and then this to set the format to NV12:
v4l2loopback-ctl set-caps "video/x-raw, format=NV12, width=1920, height=1080" "/dev/video2"

Then in the obs plugin I choose NV12 aswell.

Using Gstreamer instead of obs I did not have this issue (instead I got other issues with the android emulator...).

How can I fix this issue? Any help is very welcomed!


----------



## JohnDee (Jan 1, 2021)

Previously, I could select which v4l2loopback device to output to. After updating to OBS 26, with the new "Start Virtual Camera", I can only output to the first v4l2loopback device. Is there a setting somewhere? How can I select the output path of the virtual camera?

Details:
I'm using a Canon DSLR to USB3 via g2photo & v4l2loopback. This is itself a v4l2loopback device. When I run "v4l2-ctl --list-devices", it lists two devices. I then use g2photo to send a stream from the camera to /dev/video0 . For OBS to detect the camera, it has to be running into a loopback device BEFORE OBS starts. The issue is that since I can't select where to send OBS virtual camera output path, it is overwriting the camera with the output. This is how I output OBS into something like Zoom. It was working fine with OBS 25.


----------



## frisco (Jan 6, 2021)

JohnDee said:


> Previously, I could select which v4l2loopback device to output to. After updating to OBS 26, with the new "Start Virtual Camera", I can only output to the first v4l2loopback device. Is there a setting somewhere? How can I select the output path of the virtual camera?



It still works for me.  I can go to Tools->V4L2 Video Output, stop the output, change the path, and re-start with a different path.  I tested switching between `/dev/video0` and `/dev/video1`.  That said, when I switch to `/dev/video1` I still see a still image when I peek at `/dev/video0`, which is strange, but the live video feed is definitely going to `/dev/video1`.  Can you maybe elaborate on what you are doing to experience the problem?


----------



## JohnDee (Jan 7, 2021)

Thanks! Can you confirm you're running OBS version > 26? I just did a new install on Ubuntu snap 20.10, v4l2loopback-dkms, on a different machine and I can't find it. If you're running version 26, that would give me a lot of info.


----------



## frisco (Jan 8, 2021)

JohnDee said:


> Thanks! Can you confirm you're running OBS version > 26? I just did a new install on Ubuntu snap 20.10, v4l2loopback-dkms, on a different machine and I can't find it. If you're running version 26, that would give me a lot of info.



I'm running 26.1.0 on arch linux.  That's just the default obs-studio package.  I'm using obs-v4l2sink from git commit 36d5bdb, compiled against obs 26.1.0.


----------



## Quick (Feb 1, 2021)

Hi.

I am super new to Ubuntu. I run a YouTube channel and I can't use my regular things I use for making videos. OBS seems to be the best option along with Shortcut which I plan to use.

I have no idea how to use this stuff. I have been searching all over and can't find a fix. My problem isn't that I can't select V4L2 but that I have no picture at all even when I have it selected. I tried recording, but I still get no picture and don't know where to find my video recordings so I can't check with another program to see if my recording works or not. I think my audio works fine, but it's a little low. So if someone knows how I can actually view what I am recording and also how to turn my mic up that would be awesome.

My webcam is: *PC Webcam for Streaming HD 1080P, Vitade 960A USB Pro Computer Web Camera Video Cam for Mac Windows Laptop Conferencing Gaming with Microphone & Ring Light*
My mic is: *USB Microphone Kit 192KHZ/24BIT MAONO AU-A04T PC Condenser Podcast Streaming Cardioid Mic Plug & Play for Computer, YouTube, Gaming Recording

Thanks to anyone willing to help a complete newb out.*


----------



## Quick (Feb 2, 2021)

Quick said:


> Hi.
> 
> I am super new to Ubuntu. I run a YouTube channel and I can't use my regular things I use for making videos. OBS seems to be the best option along with Shortcut which I plan to use.
> 
> ...


UPDATE: I was able to see my webcam works with cheese but I still can't see anything in OBS Studio
UPDATE: I found out there was more installing to do before it can work. I ran this "sudo apt install v4l-utils v4l2loopback-dkms v4l2loopback-utils"
But now I have to run this "v4l2loopback-utils" but it say "v4l2loopback-utils: command not found"
UPDATE: I was trying to follow the directions here: https://github.com/CatxFish/obs-v4l2sink/issues/54

I got to this step: sudo apt-get install libobs-dev
And I got this message: "E: Unable to correct problems, you have held broken packages."

UPDATE: I ran this command: "sudo dpkg - obs-4l2sink.deb"
And got this message: "dpkg: error: need an action option"

What should I do?


----------



## Quick (Feb 5, 2021)

Update: I now have 2 different plugin options under Tools for v4l2sink; one is just below the other. How do I fix this?


----------



## actuday (Mar 6, 2021)

Hello!
I saw on the v4l2 GitHub that the plugin now ships with OBS. My version is 26.1.2-1, but I don't have the v4l2 option under Tools. I've already installed the v4l2loopback package from pacman and enabled the kernel module with modprobe.
However, I do have an option called "Start Virtual Camera" on the bottom right of OBS, but it doesn't seem to do much and I can't find any settings for it either.


----------



## Schmiddi1206 (Mar 24, 2021)

Hey guys, my english is very bad. I need help. I am a Streamer of a Mobile App and i dont can use the virtual CAM. Pls help me, my favorite league is German ;)


----------



## dsales (Jul 24, 2021)

Hi

I have a problem with usb cameras which don't report the fps properly. The v4l2 plugin sees it as NaN, so it defines a negative timeout, which creates huge amounts of error logs (several GB in a few minutes). 
I posted the issue in the Linux Support Forum, but I haven't received any news, except for someone who has the same problem. You can see the details in this thread: Huge amount of error logs when camera doesn't return framerate

I hope that someone can help me on that here.
Thanks in advance


----------



## OmegaFlatulence (Nov 5, 2021)

Hi, is there any way to set the video capture device to a custom resolution?  I use a datapath Vision card and capture numerous arcade PCB's that have non standard resolutions (such as 384x224 and 448x224) but I'm unable to dial these in like in a Windows build.  Is there any way to manually set these capture resolutions with the current OBS v4l2 module?  Is there a work around if it's not possible?


----------



## Dakas (Mar 6, 2022)

Hi, I think just recently I found "MJPEG" as a native pixel format option (in addition to the previous alternatives of YUV/YVU/BGR3 (emulated) that are still present) for some V4L2 capture devices. A pleasant surprise, but I have not been able to find anything in the release announcements that would suggest when or where this has been added. Anybody has a suggestion when this might have happened? Or is this a consequence of kernel updates or library changes or possibly some other change unrelated to OBS?


----------



## Dakas (Mar 9, 2022)

Dakas said:


> Hi, I think just recently I found "MJPEG" as a native pixel format option (in addition to the previous alternatives of YUV/YVU/BGR3 (emulated) that are still present) for some V4L2 capture devices. A pleasant surprise, but I have not been able to find anything in the release announcements that would suggest when or where this has been added. Anybody has a suggestion when this might have happened? Or is this a consequence of kernel updates or library changes or possibly some other change unrelated to OBS?



I presume that this is due to the following commit (significant time span between creation and actual commit in its current form):

```
commit 1c2aea4f89659d69080c397e3377e6183990a135
Author:     Morten Bøgeskov <source@kosmisk.dk>
AuthorDate: Sun Jun 7 10:12:01 2020 +0200
Commit:     Jim <obs.jim@gmail.com>
CommitDate: Tue Nov 2 06:04:54 2021 -0700

    linux-v4l2: Support for Motion-JPEG codec
```


----------



## Bellator138 (Jul 29, 2022)

Hello! I'm new here. I installed it and the Qt V4L2 video capture utility does not open at all. The Video test utility opens just fine though. I don't know how to run it in a terminal so I need help with that part so I can post a log file.

Thanks!


----------

