Discussion:
How to get v4l (video for linux)
(too old to reply)
root
2020-08-12 14:57:28 UTC
Permalink
Slackbuilds doesn't have it for 14.2 64 and neither does
alien builds. Has it been replaced with something else?
Poprocks
2020-08-12 15:01:54 UTC
Permalink
Post by root
Slackbuilds doesn't have it for 14.2 64 and neither does
alien builds. Has it been replaced with something else?
Can you be more specific as to what you're looking for?

v4l drivers have been included in the vanilla Linux kernel for quite
some time. v4l1 was deprecated years ago and replaced with v4l2.
root
2020-08-12 15:53:04 UTC
Permalink
Post by Poprocks
Post by root
Slackbuilds doesn't have it for 14.2 64 and neither does
alien builds. Has it been replaced with something else?
Can you be more specific as to what you're looking for?
v4l drivers have been included in the vanilla Linux kernel for quite
some time. v4l1 was deprecated years ago and replaced with v4l2.
My wife is trying to get her usb camera/microphone working.
The instructions for how to use mplayer, for example, involve using
either the v411 or v412 driver. When we try the example we
use:
mplayer tv:// -tv driver=v4l2
and get "no such driver".
root
2020-08-12 15:58:20 UTC
Permalink
Post by root
Post by Poprocks
Post by root
Slackbuilds doesn't have it for 14.2 64 and neither does
alien builds. Has it been replaced with something else?
Can you be more specific as to what you're looking for?
v4l drivers have been included in the vanilla Linux kernel for quite
some time. v4l1 was deprecated years ago and replaced with v4l2.
My wife is trying to get her usb camera/microphone working.
The instructions for how to use mplayer, for example, involve using
either the v411 or v412 driver. When we try the example we
mplayer tv:// -tv driver=v4l2
and get "no such driver".
After further experimentation:
mplayer tv:// -tv driver=v4l2:device=/dev/video0:width=1280:height=720:fps=30:outfmt=yuy2
gives a picture but no sound.
root
2020-08-12 16:12:49 UTC
Permalink
Post by root
Post by root
Post by Poprocks
Post by root
Slackbuilds doesn't have it for 14.2 64 and neither does
alien builds. Has it been replaced with something else?
Can you be more specific as to what you're looking for?
v4l drivers have been included in the vanilla Linux kernel for quite
some time. v4l1 was deprecated years ago and replaced with v4l2.
My wife is trying to get her usb camera/microphone working.
The instructions for how to use mplayer, for example, involve using
either the v411 or v412 driver. When we try the example we
mplayer tv:// -tv driver=v4l2
and get "no such driver".
mplayer tv:// -tv driver=v4l2:device=/dev/video0:width=1280:height=720:fps=30:outfmt=yuy2
gives a picture but no sound.
When the camera is connected /dev/video0 appears as does /dev/usb/hiddev0

If we use vlc instead of mplayer we can get a picture using media capture
with video device /dev/vide0, but using /dev/usb/hiddev0 for the audio
device does not work.
Henrik Carlqvist
2020-08-13 06:07:18 UTC
Permalink
Post by root
If we use vlc instead of mplayer we can get a picture using media
capture with video device /dev/vide0, but using /dev/usb/hiddev0 for the
audio device does not work.
Is /dev/usb/hiddev0 really an audio device? What audio devices are you
able to choose from with alsamixer?

regards Henrik
root
2020-08-13 16:41:56 UTC
Permalink
Post by Henrik Carlqvist
Post by root
If we use vlc instead of mplayer we can get a picture using media
capture with video device /dev/vide0, but using /dev/usb/hiddev0 for the
audio device does not work.
Is /dev/usb/hiddev0 really an audio device? What audio devices are you
able to choose from with alsamixer?
regards Henrik
Thanks for responding Henrik. I solved the problem using vlc. Clicking
on the arrow in the right of the Media->Capture sound entry
reveals the choices:
hw 0,0
hw 0,2
hw 2,0

which, I suppose, correspond to the output of the command arecord -l:
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC889 Analog [ALC889 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: ALC889 Alt Analog [ALC889 Alt Analog]
Subdevices: 2/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
card 2: Camera [USB 2.0 Camera], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

Now I am trying to reconcile this finding with what I find
as a command to use mplayer to play a webcam:

mplayer tv:// -tv driver=v4l2:device=/dev/video0:width=1280:height=720:fps=30:outfmt=yuy2

Which works without sound. I tried adding audio with:

-a0 alsa:device=plughw=2.0

but I still got no sound.
Henrik Carlqvist
2020-08-14 05:20:42 UTC
Permalink
Now I am trying to reconcile this finding with what I find as a command
mplayer tv:// -tv
driver=v4l2:device=/dev/video0:width=1280:height=720:fps=30:outfmt=yuy2
-a0 alsa:device=plughw=2.0
I don't have that kind of hardware so I can't test it myself, but reading
the man page makes me think that you should give more options to the -tv
flag:

-tv driver=v4l2:device=/dev/
video0:width=1280:height=720:fps=30:outfmt=yuy2:alsa:adevice=2.0

regards Henrik
root
2020-08-14 14:40:16 UTC
Permalink
Post by Henrik Carlqvist
Now I am trying to reconcile this finding with what I find as a command
mplayer tv:// -tv
driver=v4l2:device=/dev/video0:width=1280:height=720:fps=30:outfmt=yuy2
-a0 alsa:device=plughw=2.0
I don't have that kind of hardware so I can't test it myself, but reading
the man page makes me think that you should give more options to the -tv
-tv driver=v4l2:device=/dev/
video0:width=1280:height=720:fps=30:outfmt=yuy2:alsa:adevice=2.0
regards Henrik
Thanks Henrik. You have given me something more to work with, but
the exact form of your command segafaults MPlayer.
Henrik Carlqvist
2020-08-15 13:01:39 UTC
Permalink
You have given me something more to work with, but the
exact form of your command segafaults MPlayer.
Maybe it would be possible to get a clue to the cause of the segfault by
running:

strace -f mplayer -tv driver=v4l2:device=/dev/
video0:width=1280:height=720:fps=30:outfmt=yuy2:alsa:adevice=2.0

If I know you right the segfault is probably not caused by a permission
problem, but if that were the case strace would show EPERM if mplayer
tries to open some video or alsa device with insufficent permissions.

regards Henrik
root
2020-08-15 16:43:58 UTC
Permalink
Post by Henrik Carlqvist
You have given me something more to work with, but the
exact form of your command segafaults MPlayer.
Maybe it would be possible to get a clue to the cause of the segfault by
strace -f mplayer -tv driver=v4l2:device=/dev/
video0:width=1280:height=720:fps=30:outfmt=yuy2:alsa:adevice=2.0
Thanks again Henrik. I had to change your command:

strace -f mplayer tv:// -tv driver=v4l2:device=/dev/
video0:width=1280:height=720:fps=30:outfmt=yuy2:alsa:adevice=2.0

To add the tv://

Oncd again core was dumped in a segfault. I brought
up gdb and traced the fault to:
#0 0x00007f65fc083625 in std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) () from /usr/lib64/libstdc++.so.6

The strace output said the signal 11 happened in module:filter_video
after a number of vdpau messages.
So I added -vo xv to the command and I got a picture but still no sound
MPlayer even says "Audio:no sound


This work was done on my AV server, not my wife's machine.

On her machine I got picture with no sound. She can use
a tablet to work with the connection so it isn't worth
any more effort to get her web cam to work.

Thanks again for your help.

Alessandro Selli
2020-08-13 15:50:39 UTC
Permalink
Post by root
If we use vlc instead of mplayer we can get a picture using media capture
with video device /dev/vide0, but using /dev/usb/hiddev0 for the audio
device does not work.
HID = Human Interface Device, it's used for input devices. In the case
of USB webcams they usually are buttons.

You can get some basic information about our audio devices running
alsactl init. Detailed information is collected by the script alsa-info.


Bye,


Alesandro Selli
Loading...